Panda3D
|
The abstract base class for a mount definition used within a VirtualFileSystem. More...
#include "virtualFileMount.h"
Public Member Functions | |
void | close_read_file (istream *stream) const |
Closes a file opened by a previous call to open_read_file(). | |
virtual TypeHandle | force_init_type () |
virtual off_t | get_file_size (const Filename &file, istream *stream) const =0 |
virtual off_t | get_file_size (const Filename &file) const =0 |
VirtualFileSystem * | get_file_system () const |
Returns the file system this mount object is attached to. | |
int | get_mount_flags () const |
Returns the set of flags passed by the user to the VirtualFileSystem::mount() command. | |
const Filename & | get_mount_point () const |
Returns the name of the directory within the virtual file system that this mount object is attached to. | |
virtual time_t | get_timestamp (const Filename &file) const =0 |
virtual TypeHandle | get_type () const |
virtual bool | has_file (const Filename &file) const =0 |
virtual bool | is_directory (const Filename &file) const =0 |
virtual bool | is_regular_file (const Filename &file) const =0 |
virtual istream * | open_read_file (const Filename &file) const =0 |
istream * | open_read_file (const Filename &file, bool do_uncompress) const |
Opens the file for reading. | |
virtual void | output (ostream &out) const |
virtual | PT (VirtualFile) make_virtual_file(const Filename &local_filename |
virtual bool | read_file (const Filename &file, bool do_uncompress, pvector< unsigned char > &result) const |
Fills up the indicated pvector with the contents of the file, if it is a regular file. | |
virtual bool | scan_directory (vector_string &contents, const Filename &dir) const =0 |
virtual void | write (ostream &out) const |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. | |
Public Attributes | |
virtual const Filename bool | implicit_pz_file |
virtual const Filename & | original_filename |
virtual const Filename bool bool | status_only |
Protected Attributes | |
VirtualFileSystem * | _file_system |
int | _mount_flags |
Filename | _mount_point |
Friends | |
class | VirtualFileSystem |
The abstract base class for a mount definition used within a VirtualFileSystem.
Normally users don't need to monkey with this class directly.
Definition at line 33 of file virtualFileMount.h.
void VirtualFileMount::close_read_file | ( | istream * | stream | ) | const |
Closes a file opened by a previous call to open_read_file().
This really just deletes the istream pointer, but it is recommended to use this interface instead of deleting it explicitly, to help work around compiler issues.
Definition at line 128 of file virtualFileMount.cxx.
Referenced by VirtualFileMountSystem::open_read_file().
VirtualFileSystem * VirtualFileMount::get_file_system | ( | ) | const [inline] |
Returns the file system this mount object is attached to.
Definition at line 35 of file virtualFileMount.I.
Referenced by VirtualFileSimple::get_file_system().
int VirtualFileMount::get_mount_flags | ( | ) | const [inline] |
Returns the set of flags passed by the user to the VirtualFileSystem::mount() command.
Definition at line 59 of file virtualFileMount.I.
const Filename & VirtualFileMount::get_mount_point | ( | ) | const [inline] |
Returns the name of the directory within the virtual file system that this mount object is attached to.
This directory name will end with a slash.
Definition at line 48 of file virtualFileMount.I.
Referenced by VirtualFileSimple::get_filename(), VirtualFileSystem::scan_mount_points(), VirtualFileSystem::unmount(), VirtualFileSystem::unmount_all(), and VirtualFileSystem::unmount_point().
static void VirtualFileMount::init_type | ( | ) | [inline, static] |
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Making it inline seems to cause problems in the optimizer.
Reimplemented from TypedReferenceCount.
Reimplemented in VirtualFileMountMultifile, and VirtualFileMountSystem.
Definition at line 83 of file virtualFileMount.h.
References TypedReferenceCount::init_type().
Referenced by VirtualFileMountSystem::init_type(), and VirtualFileMountMultifile::init_type().
istream * VirtualFileMount::open_read_file | ( | const Filename & | file, |
bool | do_uncompress | ||
) | const |
Opens the file for reading.
Returns a newly allocated istream on success (which you should eventually delete when you are done reading). Returns NULL on failure.
If do_uncompress is true, the file is also decompressed on-the-fly using zlib.
Definition at line 104 of file virtualFileMount.cxx.
bool VirtualFileMount::read_file | ( | const Filename & | file, |
bool | do_uncompress, | ||
pvector< unsigned char > & | result | ||
) | const [virtual] |
Fills up the indicated pvector with the contents of the file, if it is a regular file.
Returns true on success, false otherwise.
Reimplemented in VirtualFileMountMultifile.
Definition at line 65 of file virtualFileMount.cxx.
References VirtualFile::simple_read_file().
Referenced by VirtualFileSimple::read_file().