|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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).
Method Summary | |
boolean |
chDir(java.lang.String Path)
Set current working directory. |
boolean |
deleteFile(java.lang.String FileName)
Delete a file on VFS. |
boolean |
exists(java.lang.String Path)
Check whenever a file exists. |
iDataBuffer |
expandPath(java.lang.String Path,
boolean IsDir)
Expand given virtual path, interpret all "." and ".."' |
iStringArray |
findFiles(java.lang.String Path)
Find all files in a virtual directory and return an array with their names. |
java.lang.String |
getCwd()
Get current working directory. |
java.lang.Long |
getFileSize(java.lang.String FileName)
Query file size (without opening it). |
java.util.Date |
getFileTime(java.lang.String FileName)
Query file date/time. |
iDataBuffer |
getRealPath(java.lang.String FileName)
Query real-world path from given VFS path. |
boolean |
mount(java.lang.String VirtualPath,
java.lang.String RealPath)
Mount an VFS path on a "real-world-filesystem" path. |
iStringArray |
mountRoot(java.lang.String VirtualPath)
Mount the root directory or directories beneath the given virtual path. |
iFile |
open(java.lang.String FileName,
int Mode)
Replacement for standard fopen(). |
boolean |
popDir()
Pop current directory. |
void |
pushDir()
Push current directory. |
iDataBuffer |
readFile(java.lang.String FileName,
boolean nullterm)
Get an entire file at once. |
boolean |
saveMounts(java.lang.String FileName)
Save current configuration back into configuration file. |
boolean |
setFileTime(java.lang.String FileName,
java.util.Date dDate)
Set file date/time. |
boolean |
sync()
Close all opened archives, free temporary storage etc. |
boolean |
unmount(java.lang.String VirtualPath,
java.lang.String RealPath)
Unmount an VFS path; if RealPath is 0, entire VirtualPath is unmounted. |
boolean |
writeFile(java.lang.String Name,
byte[] Data)
Write an entire file in one pass. |
Methods inherited from interface crystalspace.jbind.interfaces.iutil.scf.iBase |
decRef, getName, getRefCount, getVersion, incRef, queryInterface, queryInterfaceSafe |
Methods inherited from interface crystalspace.jbind.interfaces.iPointer |
changePointer, getPointer, isMemoryOwner, setMemoryOwner |
Method Detail |
public boolean chDir(java.lang.String Path)
Path
-
public java.lang.String getCwd()
public void pushDir()
public boolean popDir()
public iDataBuffer expandPath(java.lang.String Path, boolean IsDir)
Path
- IsDir
-
public boolean exists(java.lang.String Path)
Path
-
public iStringArray findFiles(java.lang.String Path)
Path
-
public iFile open(java.lang.String FileName, int Mode)
FileName
- Mode
-
public iDataBuffer readFile(java.lang.String FileName, boolean nullterm)
FileName
- nullterm
-
public boolean writeFile(java.lang.String Name, byte[] Data)
Name
- Data
-
public boolean deleteFile(java.lang.String FileName)
FileName
-
public boolean sync()
public boolean mount(java.lang.String VirtualPath, java.lang.String RealPath)
VirtualPath
- RealPath
-
public boolean unmount(java.lang.String VirtualPath, java.lang.String RealPath)
VirtualPath
- RealPath
-
public iStringArray mountRoot(java.lang.String VirtualPath)
VirtualPath
-
public boolean saveMounts(java.lang.String FileName)
FileName
-
public java.util.Date getFileTime(java.lang.String FileName)
FileName
-
public boolean setFileTime(java.lang.String FileName, java.util.Date dDate)
FileName
- dDate
-
public java.lang.Long getFileSize(java.lang.String FileName)
FileName
-
public iDataBuffer getRealPath(java.lang.String FileName)
FileName
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |