|
|
|
The abstract base class for a mount definition used within a VirtualFileSystem.
More...
#include "virtualFileMount.h"
List of all members.
Public Member Functions |
| virtual bool | atomic_compare_and_exchange_contents (const Filename &file, string &orig_contents, const string &old_contents, const string &new_contents) |
| | See Filename::atomic_compare_and_exchange_contents().
|
| virtual bool | atomic_read_contents (const Filename &file, string &contents) const |
| | See Filename::atomic_read_contents().
|
| virtual void | close_read_file (istream *stream) const |
| | Closes a file opened by a previous call to open_read_file().
|
| virtual void | close_read_write_file (iostream *stream) |
| | Closes a file opened by a previous call to open_read_write_file().
|
| virtual void | close_write_file (ostream *stream) |
| | Closes a file opened by a previous call to open_write_file().
|
| virtual bool | copy_file (const Filename &orig_filename, const Filename &new_filename) |
| | Attempts to copy the contents of the indicated file to the indicated file.
|
| virtual bool | create_file (const Filename &file) |
| | Attempts to create the indicated file within the mount, if it does not already exist.
|
| virtual bool | delete_file (const Filename &file) |
| | Attempts to delete the indicated file or directory within the mount.
|
|
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 bool | get_system_info (const Filename &file, SubfileInfo &info) |
| | Populates the SubfileInfo structure with the data representing where the file actually resides on disk, if this is knowable.
|
|
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 bool | is_writable (const Filename &file) const |
| | Returns true if the named file or directory may be written to, false otherwise.
|
| virtual bool | make_directory (const Filename &file) |
| | Attempts to create the indicated file within the mount, if it does not already exist.
|
| virtual ostream * | open_append_file (const Filename &file) |
| | Works like open_write_file(), but the file is opened in append mode.
|
| virtual iostream * | open_read_append_file (const Filename &file) |
| | Works like open_read_write_file(), but the file is opened in append mode.
|
| istream * | open_read_file (const Filename &file, bool do_uncompress) const |
| | Opens the file for reading.
|
|
virtual istream * | open_read_file (const Filename &file) const =0 |
| virtual iostream * | open_read_write_file (const Filename &file, bool truncate) |
| | Opens the file for writing.
|
| virtual ostream * | open_write_file (const Filename &file, bool truncate) |
| | Opens the file for writing.
|
| ostream * | open_write_file (const Filename &file, bool do_compress, bool truncate) |
| | Opens the file for writing.
|
|
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 | rename_file (const Filename &orig_filename, const Filename &new_filename) |
| | Attempts to rename the contents of the indicated file to the indicated file.
|
|
virtual bool | scan_directory (vector_string &contents, const Filename &dir) const =0 |
|
virtual void | write (ostream &out) const |
| virtual bool | write_file (const Filename &file, bool do_compress, const unsigned char *data, size_t data_size) |
| | Writes the indicated data to the file, if it is a writable file.
|
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 bool int | open_flags |
|
virtual const Filename & | original_filename |
Protected Attributes |
|
VirtualFileSystem * | _file_system |
|
int | _mount_flags |
|
Filename | _mount_point |
Friends |
|
class | VirtualFileSystem |
Detailed Description
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.
Member Function Documentation
| bool VirtualFileMount::atomic_compare_and_exchange_contents |
( |
const Filename & |
file, |
|
|
string & |
orig_contents, |
|
|
const string & |
old_contents, |
|
|
const string & |
new_contents |
|
) |
| [virtual] |
| bool VirtualFileMount::atomic_read_contents |
( |
const Filename & |
file, |
|
|
string & |
contents |
|
) |
| const [virtual] |
| void VirtualFileMount::close_read_file |
( |
istream * |
stream | ) |
const [virtual] |
| void VirtualFileMount::close_read_write_file |
( |
iostream * |
stream | ) |
[virtual] |
| void VirtualFileMount::close_write_file |
( |
ostream * |
stream | ) |
[virtual] |
| bool VirtualFileMount::copy_file |
( |
const Filename & |
orig_filename, |
|
|
const Filename & |
new_filename |
|
) |
| [virtual] |
| bool VirtualFileMount::create_file |
( |
const Filename & |
file | ) |
[virtual] |
| bool VirtualFileMount::delete_file |
( |
const Filename & |
file | ) |
[virtual] |
| int VirtualFileMount::get_mount_flags |
( |
| ) |
const [inline] |
| const Filename & VirtualFileMount::get_mount_point |
( |
| ) |
const [inline] |
| static void VirtualFileMount::init_type |
( |
| ) |
[inline, static] |
| bool VirtualFileMount::is_writable |
( |
const Filename & |
file | ) |
const [virtual] |
| bool VirtualFileMount::make_directory |
( |
const Filename & |
file | ) |
[virtual] |
Attempts to create the indicated file within the mount, if it does not already exist.
Returns true on success, or false if it cannot be created. If the directory already existed prior to this call, may return either true or false.
Reimplemented in VirtualFileMountRamdisk, and VirtualFileMountSystem.
Definition at line 130 of file virtualFileMount.cxx.
| ostream * VirtualFileMount::open_append_file |
( |
const Filename & |
file | ) |
[virtual] |
| iostream * VirtualFileMount::open_read_append_file |
( |
const Filename & |
file | ) |
[virtual] |
| 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 220 of file virtualFileMount.cxx.
| iostream * VirtualFileMount::open_read_write_file |
( |
const Filename & |
file, |
|
|
bool |
truncate |
|
) |
| [virtual] |
| ostream * VirtualFileMount::open_write_file |
( |
const Filename & |
file, |
|
|
bool |
do_compress, |
|
|
bool |
truncate |
|
) |
| |
Opens the file for writing.
Returns a newly allocated ostream on success (which you should eventually delete when you are done writing). Returns NULL on failure.
If do_compress is true, the file is also compressed on-the-fly using zlib.
Definition at line 273 of file virtualFileMount.cxx.
References open_write_file().
| ostream * VirtualFileMount::open_write_file |
( |
const Filename & |
file, |
|
|
bool |
truncate |
|
) |
| [virtual] |
| bool VirtualFileMount::read_file |
( |
const Filename & |
file, |
|
|
bool |
do_uncompress, |
|
|
pvector< unsigned char > & |
result |
|
) |
| const [virtual] |
| bool VirtualFileMount::rename_file |
( |
const Filename & |
orig_filename, |
|
|
const Filename & |
new_filename |
|
) |
| [virtual] |
| bool VirtualFileMount::write_file |
( |
const Filename & |
file, |
|
|
bool |
do_compress, |
|
|
const unsigned char * |
data, |
|
|
size_t |
data_size |
|
) |
| [virtual] |
The documentation for this class was generated from the following files:
| | |