36 return (file != (
VirtualFile *)NULL && file->is_directory());
48 return (file != (
VirtualFile *)NULL && file->is_regular_file());
61 scan_directory(const
Filename &filename)
const {
67 return file->scan_directory();
81 <<
"Not found: " << filename <<
"\n";
99 <<
"Not found: " << filename <<
"\n";
120 bool okflag =
read_file(filename, result, auto_unwrap);
121 nassertr(okflag,
string());
136 return write_file(filename, (
const unsigned char *)data.data(), data.size(), auto_wrap);
155 return (file != (
VirtualFile *)NULL && file->read_file(result, auto_unwrap));
174 return (file != (
VirtualFile *)NULL && file->read_file(result, auto_unwrap));
189 return (file != (
VirtualFile *)NULL && file->write_file(data, data_size, auto_wrap));
bool is_directory(const Filename &filename) const
Convenience function; returns true if the named file exists and is a directory.
void ls_all(const Filename &filename) const
Convenience function; lists the files within the indicated directory, and all files below...
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.
string read_file(const Filename &filename, bool auto_unwrap) const
Convenience function; returns the entire contents of the indicated file as a string.
void ls(const Filename &filename) const
Convenience function; lists the files within the indicated directory.
The abstract base class for a file or directory within the VirtualFileSystem.
PointerTo< VirtualFile > create_file(const Filename &filename)
Attempts to create a file by the indicated name in the filesystem, if possible, and returns it...
bool write_file(const Filename &filename, const string &data, bool auto_wrap)
Convenience function; writes the entire contents of the indicated file as a string.
A list of VirtualFiles, as returned by VirtualFile::scan_directory().
The name of a file, such as a texture file or an Egg file.
bool is_regular_file(const Filename &filename) const
Convenience function; returns true if the named file exists and is a regular file.
PointerTo< VirtualFile > get_file(const Filename &filename, bool status_only=false) const
Looks up the file by the indicated name in the file system.
bool exists(const Filename &filename) const
Convenience function; returns true if the named file exists.