iVFS Struct Reference
[Virtual File System (VFS)]
The Virtual Filesystem Class is intended to be the only way for Crystal Space engine to access the files.
More...
#include <iutil/vfs.h>
Inheritance diagram for iVFS:

Public Member Functions | |
virtual bool | ChDir (const char *Path)=0 |
Set current working directory. | |
virtual bool | ChDirAuto (const char *path, const csStringArray *paths=0, const char *vfspath=0, const char *filename=0)=0 |
Convenience function to set the current VFS directory to the given path. | |
virtual bool | DeleteFile (const char *FileName)=0 |
Delete a file on VFS. | |
virtual bool | Exists (const char *Path) const =0 |
Check whenever a file exists. | |
virtual csPtr< iDataBuffer > | ExpandPath (const char *Path, bool IsDir=false) const =0 |
Expand given virtual path, interpret all "." and ".."'s relative to 'current virtual directory'. | |
virtual csPtr< iStringArray > | FindFiles (const char *Path) const =0 |
Find absolute paths of all files in a virtual directory and return an array with their names. | |
virtual const char * | GetCwd () const =0 |
Get current working directory. | |
virtual bool | GetFileSize (const char *FileName, size_t &oSize)=0 |
Query file size (without opening it). | |
virtual bool | GetFileTime (const char *FileName, csFileTime &oTime) const =0 |
Query file date/time. | |
virtual csRef< iStringArray > | GetMounts ()=0 |
Get a list of all current virtual mount paths. | |
virtual csRef< iStringArray > | GetRealMountPaths (const char *VirtualPath)=0 |
Get the real paths associated with a mount. | |
virtual csPtr< iDataBuffer > | GetRealPath (const char *FileName)=0 |
Query real-world path from given VFS path. | |
virtual bool | LoadMountsFromFile (iConfigFile *file)=0 |
Loads mounts from a configuration file. | |
virtual bool | Mount (const char *VirtualPath, const char *RealPath)=0 |
Mount an VFS path on a "real-world-filesystem" path. | |
virtual csRef< iStringArray > | MountRoot (const char *VirtualPath)=0 |
Mount the root directory or directories beneath the given virtual path. | |
virtual csPtr< iFile > | Open (const char *FileName, int Mode)=0 |
Open a file on the VFS filesystem. | |
virtual bool | PopDir ()=0 |
Pop current directory. | |
virtual void | PushDir (char const *Path=0)=0 |
Push current directory and optionally change to a different directory. | |
virtual csPtr< iDataBuffer > | ReadFile (const char *FileName, bool nullterm=true)=0 |
Get an entire file at once. | |
virtual bool | SaveMounts (const char *FileName)=0 |
Save current configuration back into configuration file. | |
virtual bool | SetFileTime (const char *FileName, const csFileTime &iTime)=0 |
Set file date/time. | |
virtual bool | Sync ()=0 |
Close all opened archives, free temporary storage etc. | |
virtual bool | Unmount (const char *VirtualPath, const char *RealPath)=0 |
Unmount a VFS path. | |
virtual bool | WriteFile (const char *Name, const char *Data, size_t Size)=0 |
Write an entire file in one pass. |
Detailed Description
The Virtual Filesystem Class is intended to be the only way for Crystal Space engine to access the files.This gives unified control over the way how files are found, read and written. VFS gives the following goodies over the standard file i/o functions:
- Multiple search directories. Several "real" directories can be collected together into one "virtual" directory.
- Directories can be mapped to "real" directories as well as to archives (.zip files). Files are compressed/decompressed transparently for clients.
- The Virtual File System is unique across all operating systems Crystal Space supports, no matter of features of the underlying OS.
This class has only most basic features of a real filesystem: file reading and writing (no simultaneous read and write mode are allowed because it would be rather complex to implement it for archives). However, most programs don't even need such functionality, and for sure Crystal Space itself doesn't need it. Files open for writing are always truncated. A simple meaning for getting a list of files in a virtual directory is implemented; however the user is presented with only a list of file names; no fancy things like file size, time etc (file size can be determined after opening it for reading).
Main creators of instances implementing this interface:
- The VFS plugin (crystalspace.kernel.vfs)
Main ways to get pointers to this interface:
Definition at line 205 of file vfs.h.
Member Function Documentation
|
Set current working directory.
|
|
Convenience function to set the current VFS directory to the given path. The path can be any of the following:
|
|
Delete a file on VFS.
|
|
Check whenever a file exists.
|
|
Expand given virtual path, interpret all "." and ".."'s relative to 'current virtual directory'.
|
|
Find absolute paths of all files in a virtual directory and return an array with their names.
|
|
Get current working directory.
|
|
Query file size (without opening it).
|
|
Query file date/time.
|
|
Get a list of all current virtual mount paths.
|
|
Get the real paths associated with a mount.
|
|
Query real-world path from given VFS path.
|
|
Loads mounts from a configuration file.
|
|
Mount an VFS path on a "real-world-filesystem" path.
|
|
Mount the root directory or directories beneath the given virtual path.
|
|
Open a file on the VFS filesystem.
|
|
Pop current directory. Set the current working directory to the one most recently pushed. |
|
Push current directory and optionally change to a different directory.
|
|
Get an entire file at once. This is more effective than opening files and reading the file in blocks. Note that the returned buffer can be null-terminated (so that it can be conveniently used with string functions) but the extra null-terminator is not counted as part of the returned size.
|
|
Save current configuration back into configuration file.
|
|
Set file date/time.
|
|
Close all opened archives, free temporary storage etc.
|
|
Unmount a VFS path.
|
|
Write an entire file in one pass.
|
The documentation for this struct was generated from the following file:
- iutil/vfs.h
Generated for Crystal Space by doxygen 1.4.6