crystalspace.jbind.impl.csutil.vfs
Class csVFS

java.lang.Object
  extended bycrystalspace.jbind.impl.csNativeObject
      extended bycrystalspace.jbind.impl.csutil.scf.csBase
          extended bycrystalspace.jbind.impl.csutil.vfs.csVFS
All Implemented Interfaces:
iBase, iPointer, iVFS

public class csVFS
extends csBase
implements iVFS

Author:
qan To change the template for this generated type comment go to Window>Preferences>Java>Code Generation>Code and Comments

Field Summary
 
Fields inherited from class crystalspace.jbind.impl.csNativeObject
ImplFactory, nPointer
 
Constructor Summary
csVFS(iPointer nPointer)
           
 
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.
static java.lang.Class getInterfaceClass()
           
static java.lang.String getInterfaceName()
           
static int getInterfaceVersion()
           
 java.lang.String getName()
          Return the name of the interface
 iDataBuffer getRealPath(java.lang.String FileName)
          Query real-world path from given VFS path.
 int getVersion()
          Return the version of the interface
static void initSCF()
           
protected  boolean isNativePointerValidSafe()
           
 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.
 boolean writeFile(java.lang.String Name, byte[] Data, long Size)
           
 
Methods inherited from class crystalspace.jbind.impl.csutil.scf.csBase
decRef, equals, finalize, getRefCount, incRef, nDelete, queryInterface, queryInterfaceSafe
 
Methods inherited from class crystalspace.jbind.impl.csNativeObject
changePointer, getPointer, getPointer, getPointerArray, hashCode, isMemoryOwner, isNativePointerValid, isNativePointerValidSafe, newNativeObject, setMemoryOwner, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface crystalspace.jbind.interfaces.iutil.scf.iBase
decRef, getRefCount, incRef, queryInterface, queryInterfaceSafe
 
Methods inherited from interface crystalspace.jbind.interfaces.iPointer
changePointer, getPointer, isMemoryOwner, setMemoryOwner
 

Constructor Detail

csVFS

public csVFS(iPointer nPointer)
Method Detail

getVersion

public int getVersion()
Description copied from interface: iBase
Return the version of the interface

Specified by:
getVersion in interface iBase
Specified by:
getVersion in class csBase

getName

public java.lang.String getName()
Description copied from interface: iBase
Return the name of the interface

Specified by:
getName in interface iBase
Specified by:
getName in class csBase

initSCF

public static void initSCF()

chDir

public final boolean chDir(java.lang.String Path)
Description copied from interface: iVFS
Set current working directory.

Specified by:
chDir in interface iVFS
Parameters:
Path -
Returns:

getCwd

public final java.lang.String getCwd()
Description copied from interface: iVFS
Get current working directory.

Specified by:
getCwd in interface iVFS
Returns:

pushDir

public final void pushDir()
Description copied from interface: iVFS
Push current directory.

Specified by:
pushDir in interface iVFS

popDir

public final boolean popDir()
Description copied from interface: iVFS
Pop current directory.

Specified by:
popDir in interface iVFS
Returns:

expandPath

public final iDataBuffer expandPath(java.lang.String Path,
                                    boolean IsDir)
Description copied from interface: iVFS
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. Implemented in csVFS

Specified by:
expandPath in interface iVFS
Parameters:
Path -
IsDir -
Returns:

exists

public final boolean exists(java.lang.String Path)
Description copied from interface: iVFS
Check whenever a file exists.

Specified by:
exists in interface iVFS
Parameters:
Path -
Returns:

findFiles

public final iStringArray findFiles(java.lang.String Path)
Description copied from interface: iVFS
Find all files in a virtual directory and return an array with their names. Implemented in csVFS

Specified by:
findFiles in interface iVFS
Parameters:
Path -
Returns:

open

public final iFile open(java.lang.String FileName,
                        int Mode)
Description copied from interface: iVFS
Replacement for standard fopen(). Mode: combination of VFS_FILE_XXX. See also: VFS_FILE_MODE Implemented in csVFS.

Specified by:
open in interface iVFS
Parameters:
FileName -
Mode -
Returns:

readFile

public final iDataBuffer readFile(java.lang.String FileName,
                                  boolean nullterm)
Description copied from interface: iVFS
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. Parameters: FileName VFS path of the file to be read.ยต nullterm Null-terminate the returned buffer. Returns: Interface to the contained data. Remarks: Null-termination might have a performance penalty (dependent on where the file is stored.) Use only when needed. Implemented in csVFS

Specified by:
readFile in interface iVFS
Parameters:
FileName -
nullterm -
Returns:

writeFile

public final boolean writeFile(java.lang.String Name,
                               byte[] Data,
                               long Size)

deleteFile

public final boolean deleteFile(java.lang.String FileName)
Description copied from interface: iVFS
Delete a file on VFS. Implemented in csVFS.

Specified by:
deleteFile in interface iVFS
Parameters:
FileName -
Returns:

sync

public final boolean sync()
Description copied from interface: iVFS
Close all opened archives, free temporary storage etc. Implemented in csVFS.

Specified by:
sync in interface iVFS
Returns:

mount

public final boolean mount(java.lang.String VirtualPath,
                           java.lang.String RealPath)
Description copied from interface: iVFS
Mount an VFS path on a "real-world-filesystem" path. Implemented in csVFS.

Specified by:
mount in interface iVFS
Parameters:
VirtualPath -
RealPath -
Returns:

unmount

public final boolean unmount(java.lang.String VirtualPath,
                             java.lang.String RealPath)
Description copied from interface: iVFS
Unmount an VFS path; if RealPath is 0, entire VirtualPath is unmounted. Implemented in csVFS.

Specified by:
unmount in interface iVFS
Parameters:
VirtualPath -
RealPath -
Returns:

mountRoot

public final iStringArray mountRoot(java.lang.String VirtualPath)
Description copied from interface: iVFS
Mount the root directory or directories beneath the given virtual path. Returns a list of absolute virtual pathnames mounted by this operation. Implemented in csVFS.

Specified by:
mountRoot in interface iVFS
Parameters:
VirtualPath -
Returns:

saveMounts

public final boolean saveMounts(java.lang.String FileName)
Description copied from interface: iVFS
Save current configuration back into configuration file. Implemented in csVFS.

Specified by:
saveMounts in interface iVFS
Parameters:
FileName -
Returns:

getFileTime

public final java.util.Date getFileTime(java.lang.String FileName)
Description copied from interface: iVFS
Query file date/time. Implemented in csVFS

Specified by:
getFileTime in interface iVFS
Parameters:
FileName -
Returns:

setFileTime

public final boolean setFileTime(java.lang.String FileName,
                                 java.util.Date dDate)
Description copied from interface: iVFS
Set file date/time. Implemented in csVFS

Specified by:
setFileTime in interface iVFS
Parameters:
FileName -
dDate -
Returns:

getFileSize

public final java.lang.Long getFileSize(java.lang.String FileName)
Description copied from interface: iVFS
Query file size (without opening it). Implemented in csVFS

Specified by:
getFileSize in interface iVFS
Parameters:
FileName -
Returns:

getRealPath

public final iDataBuffer getRealPath(java.lang.String FileName)
Description copied from interface: iVFS
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. Implemented in csVFS.

Specified by:
getRealPath in interface iVFS
Parameters:
FileName -
Returns:

getInterfaceVersion

public static int getInterfaceVersion()

getInterfaceName

public static java.lang.String getInterfaceName()

getInterfaceClass

public static java.lang.Class getInterfaceClass()

isNativePointerValidSafe

protected boolean isNativePointerValidSafe()

writeFile

public boolean writeFile(java.lang.String Name,
                         byte[] Data)
Description copied from interface: iVFS
Write an entire file in one pass. Implemented in csVFS.

Specified by:
writeFile in interface iVFS
Parameters:
Name -
Data -
Returns:
See Also:
iVFS.writeFile(java.lang.String, byte[])