closeReadFile void VirtualFile::close_read_file(istream *stream) const; Description: 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. |
getClassType static TypeHandle VirtualFile::get_class_type(void); Undocumented function. |
getFileSize virtual int VirtualFile::get_file_size(istream *stream) const; Description: Returns the current size on disk (or wherever it is) of the already-open file. Pass in the stream that was returned by open_read_file(); some implementations may require this stream to determine the size. |
getFileSystem virtual VirtualFileSystem *VirtualFile::get_file_system(void) const = 0; Undocumented function. |
getFilename virtual Filename VirtualFile::get_filename(void) const = 0; Undocumented function. |
getOriginalFilename Filename const &VirtualFile::get_original_filename(void) const; Description: Returns the original filename as it was used to locate this VirtualFile. This is usually, but not always, the same string returned by get_filename(). |
isDirectory virtual bool VirtualFile::is_directory(void) const; Description: Returns true if this file represents a directory (and scan_directory() may be called), false otherwise. |
isRegularFile virtual bool VirtualFile::is_regular_file(void) const; Description: Returns true if this file represents a regular file (and read_file() may be called), false otherwise. |
ls void VirtualFile::ls(ostream &out = (cout)) const; Description: If the file represents a directory, lists its contents. |
lsAll void VirtualFile::ls_all(ostream &out = (cout)) const; Description: If the file represents a directory, recursively lists its contents and those of all subdirectories. |
openReadFile virtual istream *VirtualFile::open_read_file(void) const; Description: 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. |
output void VirtualFile::output(ostream &out) const; Description: |
readFile string VirtualFile::read_file(void) const; Description: Returns the entire contents of the file as a string. Description: Fills up the indicated string with the contents of the file, if it is a regular file. Returns true on success, false otherwise. Description: Fills up the indicated string with the contents of the just-opened file. Returns true on success, false otherwise. If the string was not empty on entry, the data read from the file will be concatenated onto it. Description: As in read_file() with two parameters, above, but only reads up to max_bytes bytes from the file. |
scanDirectory PointerTo< VirtualFileList > VirtualFile::scan_directory(void) const; Description: If the file represents a directory (that is, is_directory() returns true), this returns the list of files within the directory at the current time. Returns NULL if the file is not a directory or if the directory cannot be read. |
getClassType static TypeHandle TypedReferenceCount::get_class_type(void); Undocumented function. |
getBestParentFromSet int TypedObject::get_best_parent_from_Set(set< int > const &) const; Description: Returns true if the current object is the indicated type exactly. |
getClassType static TypeHandle TypedObject::get_class_type(void); Undocumented function. |
getType virtual TypeHandle TypedObject::get_type(void) const = 0; Derived classes should override this function to return get_class_type(). |
getTypeIndex int TypedObject::get_type_index(void) const; Description: Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. This is equivalent to get_type().get_index(). |
isExactType bool TypedObject::is_exact_type(TypeHandle handle) const; Description: Returns true if the current object is the indicated type exactly. |
isOfType bool TypedObject::is_of_type(TypeHandle handle) const; Description: Returns true if the current object is or derives from the indicated type. |
getClassType static TypeHandle ReferenceCount::get_class_type(void); Undocumented function. |
getRefCount int ReferenceCount::get_ref_count(void) const; Description: Returns the current reference count. |
ref int ReferenceCount::ref(void) const; Description: Explicitly increments the reference count. User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it. The return value is the new reference count. |
testRefCountIntegrity bool ReferenceCount::test_ref_count_integrity(void) const; Description: Does some easy checks to make sure that the reference count isn't completely bogus. Returns true if ok, false otherwise. |
unref int ReferenceCount::unref(void) const; Description: Explicitly decrements the reference count. Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic; plus, we don't have a virtual destructor anyway.) However, see the helper function unref_delete(). User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it. The return value is the new reference count. |