15 #ifndef VIRTUALFILESIMPLE_H
16 #define VIRTUALFILESIMPLE_H
18 #include "pandabase.h"
20 #include "virtualFile.h"
33 bool implicit_pz_file,
39 virtual Filename get_filename()
const;
45 INLINE
bool is_implicit_pz_file()
const;
70 virtual bool write_file(
const unsigned char *data,
size_t data_size,
bool auto_wrap);
79 bool _implicit_pz_file;
84 return get_class_type();
86 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
94 static void init_type() {
95 VirtualFile::init_type();
96 register_type(_type_handle,
"VirtualFileSimple",
97 VirtualFile::get_class_type());
104 #include "virtualFileSimple.I"
virtual ostream * open_append_file()
Works like open_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 void close_read_write_file(iostream *stream)
Closes a file opened by a previous call to open_read_write_file().
A hierarchy of directories and files that appears to be one continuous file system, even though the files may originate from several different sources that may not be related to the actual OS's file system.
virtual bool atomic_read_contents(string &contents) const
See Filename::atomic_read_contents().
virtual ostream * open_write_file(bool auto_wrap, bool truncate)
Opens the file for writing.
virtual bool copy_file(VirtualFile *new_file)
Attempts to copy the contents of this file to the indicated file.
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...
virtual void close_write_file(ostream *stream)
Closes a file opened by a previous call to open_write_file().
The abstract base class for a file or directory within the VirtualFileSystem.
A specialization of ordered_vector that emulates a standard STL set: one copy of each element is allo...
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 has_file() const
Returns true if this file exists, false otherwise.
virtual bool get_system_info(SubfileInfo &info)
Populates the SubfileInfo structure with the data representing where the file actually resides on dis...
virtual iostream * open_read_write_file(bool truncate)
Opens the file for writing.
virtual time_t get_timestamp() const
Returns a time_t value that represents the time the file was last modified, to within whatever precis...
A list of VirtualFiles, as returned by VirtualFile::scan_directory().
The name of a file, such as a texture file or an Egg file.
virtual iostream * open_read_append_file()
Works like open_read_write_file(), but the file is opened in append mode.
virtual bool delete_file()
Attempts to delete this file or directory.
virtual void close_read_file(istream *stream) const
Closes a file opened by a previous call to open_read_file().
bool write_file(const string &data, bool auto_wrap)
Writes the entire contents of the file as a string, if it is writable.
The abstract base class for a mount definition used within a VirtualFileSystem.
string read_file(bool auto_unwrap) const
Returns the entire contents of the file as a string.
virtual bool rename_file(VirtualFile *new_file)
Attempts to move or rename this file or directory.
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().
This class records a particular byte sub-range within an existing file on disk.
virtual streamsize get_file_size() const
Returns the current size on disk (or wherever it is) of the file before it has been opened...
TypeHandle is the identifier used to differentiate C++ class types.
A simple file or directory within the VirtualFileSystem: this maps to exactly one file on one mount p...
virtual bool is_directory() const
Returns true if this file represents a directory (and scan_directory() may be called), false otherwise.