![]() |
Public API Reference |
#include <vfs.h>
Inheritance diagram for iVFS:
Public Methods | |
virtual bool | ChDir (const char *Path)=0 |
Set current working directory. More... | |
virtual const char * | GetCwd () const=0 |
Get current working directory. More... | |
virtual void | PushDir ()=0 |
Push current directory. More... | |
virtual bool | PopDir ()=0 |
Pop current directory. More... | |
virtual csPtr< iDataBuffer > | ExpandPath (const char *Path, bool IsDir=false) const=0 |
Expand given virtual path, interpret all "." and ".."'s relative to 'currend virtual directory'. More... | |
virtual bool | Exists (const char *Path) const=0 |
Check whenever a file exists. More... | |
virtual csPtr< iStringArray > | FindFiles (const char *Path) const=0 |
Find all files in a virtual directory and return an array with their names. More... | |
virtual csPtr< iFile > | Open (const char *FileName, int Mode)=0 |
Replacement for standard fopen(). More... | |
virtual csPtr< iDataBuffer > | ReadFile (const char *FileName, bool nullterm=true)=0 |
Get an entire file at once. More... | |
virtual bool | WriteFile (const char *Name, const char *Data, size_t Size)=0 |
Write an entire file in one pass. More... | |
virtual bool | DeleteFile (const char *FileName)=0 |
Delete a file on VFS. More... | |
virtual bool | Sync ()=0 |
Close all opened archives, free temporary storage etc. More... | |
virtual bool | Mount (const char *VirtualPath, const char *RealPath)=0 |
Mount an VFS path on a "real-world-filesystem" path. More... | |
virtual bool | Unmount (const char *VirtualPath, const char *RealPath)=0 |
Unmount an VFS path; if RealPath is 0, entire VirtualPath is unmounted. More... | |
virtual csRef< iStringArray > | MountRoot (const char *VirtualPath)=0 |
Mount the root directory or directories beneath the given virtual path. More... | |
virtual bool | SaveMounts (const char *FileName)=0 |
Save current configuration back into configuration file. More... | |
virtual bool | GetFileTime (const char *FileName, csFileTime &oTime) const=0 |
Query file date/time. More... | |
virtual bool | SetFileTime (const char *FileName, const csFileTime &iTime)=0 |
Set file date/time. More... | |
virtual bool | GetFileSize (const char *FileName, size_t &oSize)=0 |
Query file size (without opening it). More... | |
virtual csPtr< iDataBuffer > | GetRealPath (const char *FileName)=0 |
Query real-world path from given VFS path. More... |
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:
Definition at line 173 of file vfs.h.
|
Set current working directory.
|
|
Delete a file on VFS.
|
|
Check whenever a file exists.
|
|
Expand given virtual path, interpret all "." and ".."'s relative to 'currend virtual directory'. Return a new iString object. If IsDir is true, expanded path ends in an '/', otherwise no. |
|
Find 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.
|
|
Query real-world path from given VFS path. This will work only for files that are stored on real filesystem, not in archive files. You should expect this function to return 0 in this case. |
|
Mount an VFS path on a "real-world-filesystem" path.
|
|
Mount the root directory or directories beneath the given virtual path. Returns a list of absolute virtual pathnames mounted by this operation. |
|
Replacement for standard fopen(). Mode: combination of VFS_FILE_XXX.
|
|
Pop current directory.
|
|
Push current 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 an VFS path; if RealPath is 0, entire VirtualPath is unmounted.
|
|
Write an entire file in one pass.
|