Public Member Functions |
| virtual bool | atomic_compare_and_exchange_contents (string &orig_contents, const string &old_contents, const string &new_contents) |
| | See Filename::atomic_compare_and_exchange_contents().
|
| virtual bool | atomic_read_contents (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 (VirtualFile *new_file) |
| | Attempts to copy the contents of this file to the indicated file.
|
| virtual bool | delete_file () |
| | Attempts to delete this file or directory.
|
|
virtual TypeHandle | force_init_type () |
| virtual off_t | get_file_size (istream *stream) const |
| | Returns the current size on disk (or wherever it is) of the already-open file.
|
| virtual off_t | get_file_size () const |
| | Returns the current size on disk (or wherever it is) of the file before it has been opened.
|
|
virtual VirtualFileSystem * | get_file_system () const =0 |
|
virtual Filename | get_filename () const =0 |
| const Filename & | get_original_filename () const |
| | Returns the original filename as it was used to locate this VirtualFile.
|
| virtual bool | get_system_info (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 |
| | Returns a time_t value that represents the time the file was last modified, to within whatever precision the operating system records this information (on a Windows95 system, for instance, this may only be accurate to within 2 seconds).
|
|
virtual TypeHandle | get_type () const |
| virtual bool | has_file () const |
| | Returns true if this file exists, false otherwise.
|
| virtual bool | is_directory () const |
| | Returns true if this file represents a directory (and scan_directory() may be called), false otherwise.
|
| virtual bool | is_regular_file () const |
| | Returns true if this file represents a regular file (and read_file() may be called), false otherwise.
|
| virtual bool | is_writable () const |
| | Returns true if this file may be written to, which implies write_file() may be called (unless it is a directory instead of a regular file).
|
| void | ls (ostream &out=cout) const |
| | If the file represents a directory, lists its contents.
|
| void | ls_all (ostream &out=cout) const |
| | If the file represents a directory, recursively lists its contents and those of all subdirectories.
|
| virtual ostream * | open_append_file () |
| | Works like open_write_file(), but the file is opened in append mode.
|
| virtual iostream * | open_read_append_file () |
| | Works like open_read_write_file(), but the file is opened in append mode.
|
| virtual istream * | open_read_file (bool auto_unwrap) const |
| | Opens the file for reading.
|
| virtual iostream * | open_read_write_file (bool truncate) |
| | Opens the file for writing.
|
| virtual ostream * | open_write_file (bool auto_wrap, bool truncate) |
| | Opens the file for writing.
|
|
void | output (ostream &out) const |
|
| PT (VirtualFileList) scan_directory() const |
| string | read_file (bool auto_unwrap) const |
| | Returns the entire contents of the file as a string.
|
| bool | read_file (string &result, bool auto_unwrap) const |
| | Fills up the indicated string with the contents of the file, if it is a regular file.
|
| virtual bool | read_file (pvector< unsigned char > &result, bool auto_unwrap) const |
| | Fills up the indicated pvector with the contents of the file, if it is a regular file.
|
| virtual bool | rename_file (VirtualFile *new_file) |
| | Attempts to move or rename this file or directory.
|
| void | set_original_filename (const Filename &filename) |
| | Stores the original filename that was used to locate this VirtualFile.
|
| virtual bool | was_read_successful () const |
| | Call this method after a reading the istream returned by open_read_file() to completion.
|
| bool | write_file (const string &data, bool auto_wrap) |
| | Writes the entire contents of the file as a string, if it is writable.
|
| virtual bool | write_file (const unsigned char *data, size_t data_size, bool auto_wrap) |
| | Writes the indicated data to the file, if it is writable.
|
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.
|
| static bool | simple_read_file (istream *stream, pvector< unsigned char > &result) |
| | Fills up the indicated pvector with the contents of the just-opened file.
|
| static bool | simple_read_file (istream *stream, pvector< unsigned char > &result, size_t max_bytes) |
| | As in simple_read_file() with two parameters, above, but only reads up to max_bytes bytes from the file.
|
Protected Member Functions |
| virtual bool | scan_local_directory (VirtualFileList *file_list, const ov_set< string > &mount_points) const |
| | Fills file_list up with the list of files that are within this directory, excluding those whose basenames are listed in mount_points.
|
Friends |
|
class | VirtualFileComposite |
The abstract base class for a file or directory within the VirtualFileSystem.
Definition at line 37 of file virtualFile.h.