crystalspace.jbind.interfaces.iutil.vfs
Interface iFile

All Superinterfaces:
iBase, iPointer
All Known Implementing Classes:
csFile

public interface iFile
extends iBase

A replacement for FILE type in the virtual file space.

Author:
Java wrapper - Quentin Anciaux, c++ version - http://crystal.sourceforge.net/docs/online/devapi/structiFile.php

Method Summary
 boolean atEOF()
          Replacement for standard feof();.
 void flush()
          Flush stream.
 iDataBuffer getAllData()
          Request whole content of the file as a single data buffer.
 iDataBuffer getAllData(boolean nullterm)
          Request whole content of the file as a single data buffer.
 java.lang.String getName()
          Query file name (in VFS);.
 int getPos()
          Query current file pointer.
 int getSize()
          Query file size.
 int getStatus()
          Check (and clear); file last error status.
 int read(byte[] Data)
          Replacement for standard fread();.
 boolean setPos(int newpos)
          Set new file pointer.
 int Write(byte[] Data)
          Replacement for standard fwrite();.
 
Methods inherited from interface crystalspace.jbind.interfaces.iutil.scf.iBase
decRef, getRefCount, getVersion, incRef, queryInterface, queryInterfaceSafe
 
Methods inherited from interface crystalspace.jbind.interfaces.iPointer
changePointer, getPointer, isMemoryOwner, setMemoryOwner
 

Method Detail

atEOF

public boolean atEOF()
Replacement for standard feof();. Implemented in csMemFile, csPhysicalFile, and csFile.

Returns:

flush

public void flush()
Flush stream. Implemented in csMemFile, csPhysicalFile, and csFile.


getAllData

public iDataBuffer getAllData()
Request whole content of the file as a single data buffer. Parameters: nullterm Set this to true if you want a null char to be appended to the buffer (e.g. for use with string functions.); Remarks: Null-termination might have a performance penalty (dependent on where the file is stored.); Use only when needed. Returns: The complete data contained in the file, or 0 if this doesn't support this function (e.g. write-opened VFS files.); Don't modify the contained data! Implemented in csMemFile, csPhysicalFile, and csFile.

Returns:

getAllData

public iDataBuffer getAllData(boolean nullterm)
Request whole content of the file as a single data buffer. Parameters: nullterm Set this to true if you want a null char to be appended to the buffer (e.g. for use with string functions.); Remarks: Null-termination might have a performance penalty (dependent on where the file is stored.); Use only when needed. Returns: The complete data contained in the file, or 0 if this doesn't support this function (e.g. write-opened VFS files.); Don't modify the contained data! Implemented in csMemFile, csPhysicalFile, and csFile.

Parameters:
nullterm -
Returns:

getName

public java.lang.String getName()
Query file name (in VFS);. Implemented in csMemFile, csPhysicalFile, and csFile.

Specified by:
getName in interface iBase
Returns:

getPos

public int getPos()
Query current file pointer. Implemented in csMemFile, csPhysicalFile, and csFile.

Returns:

getSize

public int getSize()
Query file size. Implemented in csMemFile, csPhysicalFile, and csFile.

Returns:

getStatus

public int getStatus()
Check (and clear); file last error status. See also: VFS_STATUS_ACCESSDENIED Implemented in csMemFile, csPhysicalFile, and csFile.

Returns:

read

public int read(byte[] Data)
Replacement for standard fread();. Implemented in csMemFile, csPhysicalFile, and csFile.

Parameters:
Data -
Returns:

setPos

public boolean setPos(int newpos)
Set new file pointer. Parameters: newpos New position in file. Returns: Whether the position was successfully changed. Implemented in csMemFile, csPhysicalFile, and csFile.

Parameters:
newpos -
Returns:

Write

public int Write(byte[] Data)
Replacement for standard fwrite();. Implemented in csMemFile, csPhysicalFile, and csFile.

Parameters:
Data -
Returns: