Panda3D
Public Member Functions | Static Public Member Functions | List of all members
VirtualFileSimple Class Reference

A simple file or directory within the VirtualFileSystem: this maps to exactly one file on one mount point. More...

Inheritance diagram for VirtualFileSimple:
VirtualFile TypedReferenceCount TypedObject ReferenceCount

Public Member Functions

VirtualFileMount getMount ()
 Returns the VirtualFileMount this file is associated with. More...
 
bool isImplicitPzFile ()
 Returns true if this file is a .pz file that should be implicitly decompressed on load, or false if it is not a .pz file or if it should not be decompressed. More...
 
- Public Member Functions inherited from VirtualFile
 closeReadFile (Istream stream)
 Closes a file opened by a previous call to open_read_file(). More...
 
 closeReadWriteFile (Iostream stream)
 Closes a file opened by a previous call to open_read_write_file(). More...
 
 closeWriteFile (Ostream stream)
 Closes a file opened by a previous call to open_write_file(). More...
 
bool copyFile (VirtualFile new_file)
 Attempts to copy the contents of this file to the indicated file. More...
 
bool deleteFile ()
 Attempts to delete this file or directory. More...
 
Filename getFilename ()
 
Streamsize getFileSize ()
 Returns the current size on disk (or wherever it is) of the file before it has been opened. More...
 
Streamsize getFileSize (Istream stream)
 Returns the current size on disk (or wherever it is) of the already-open file. More...
 
VirtualFileSystem getFileSystem ()
 
const Filename getOriginalFilename ()
 Returns the original filename as it was used to locate this VirtualFile. More...
 
bool getSystemInfo (SubfileInfo info)
 Populates the SubfileInfo structure with the data representing where the file actually resides on disk, if this is knowable. More...
 
time_t getTimestamp ()
 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). More...
 
bool hasFile ()
 Returns true if this file exists, false otherwise. More...
 
bool isDirectory ()
 Returns true if this file represents a directory (and scan_directory() may be called), false otherwise. More...
 
bool isRegularFile ()
 Returns true if this file represents a regular file (and read_file() may be called), false otherwise. More...
 
bool isWritable ()
 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). More...
 
 ls (Ostream out)
 If the file represents a directory, lists its contents. More...
 
 lsAll (Ostream out)
 If the file represents a directory, recursively lists its contents and those of all subdirectories. More...
 
Ostream openAppendFile ()
 Works like open_write_file(), but the file is opened in append mode. More...
 
Iostream openReadAppendFile ()
 Works like open_read_write_file(), but the file is opened in append mode. More...
 
Istream openReadFile (bool auto_unwrap)
 Opens the file for reading. More...
 
Iostream openReadWriteFile (bool truncate)
 Opens the file for writing. More...
 
Ostream openWriteFile (bool auto_wrap, bool truncate)
 Opens the file for writing. More...
 
 output (Ostream out)
 
object readFile (bool auto_unwrap)
 Returns the entire contents of the file as a string. More...
 
bool renameFile (VirtualFile new_file)
 Attempts to move or rename this file or directory. More...
 
VirtualFileList scanDirectory ()
 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. More...
 
bool wasReadSuccessful ()
 Call this method after a reading the istream returned by open_read_file() to completion. More...
 
object writeFile (object data, bool auto_wrap)
 
- Public Member Functions inherited from TypedObject
TypeHandle getType ()
 
int getTypeIndex ()
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More...
 
bool isExactType (TypeHandle handle)
 Returns true if the current object is the indicated type exactly. More...
 
bool isOfType (TypeHandle handle)
 Returns true if the current object is or derives from the indicated type. More...
 
- Public Member Functions inherited from ReferenceCount
int getRefCount ()
 Returns the current reference count. More...
 
 ref ()
 Explicitly increments the reference count. More...
 
bool testRefCountIntegrity ()
 Does some easy checks to make sure that the reference count isn't completely bogus. More...
 
bool testRefCountNonzero ()
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More...
 
bool unref ()
 Explicitly decrements the reference count. More...
 

Static Public Member Functions

static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from VirtualFile
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedReferenceCount
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedObject
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle getClassType ()
 

Additional Inherited Members

- Public Attributes inherited from TypedObject
TypeHandle type
 Returns the TypeHandle representing this object's type. More...
 
- Public Attributes inherited from ReferenceCount
int ref_count
 The current reference count. More...
 

Detailed Description

A simple file or directory within the VirtualFileSystem: this maps to exactly one file on one mount point.

Most directories, and all regular files, are of this kind.

Member Function Documentation

◆ getClassType()

static TypeHandle getClassType ( )
static

◆ getMount()

VirtualFileMount getMount ( )

Returns the VirtualFileMount this file is associated with.

◆ isImplicitPzFile()

bool isImplicitPzFile ( )

Returns true if this file is a .pz file that should be implicitly decompressed on load, or false if it is not a .pz file or if it should not be decompressed.