CloudBuilder  2.8.4
Making social games is easy !
Public Member Functions | List of all members
CloudBuilder::CInputFile Class Referenceabstract

#include <CFilesystem.h>

Public Member Functions

virtual void Close ()=0
 
virtual bool IsOpen ()=0
 
virtual size_t Read (void *aDestBuffer, size_t aNumBytes)=0
 
char * ReadAll ()
 
virtual size_t Tell ()=0
 
virtual bool Seek (long aOffset, int aWhence)=0
 

Detailed Description

Platform-dependent file structures (default implementations provided in CStdioBasedFileImpl.cpp). Represents a file open for reading. Getting an instance of CInputFile does not guarantee the file has actually been opened. Check isOpen() or the result of the read functions.

Member Function Documentation

virtual void CloudBuilder::CInputFile::Close ( )
pure virtual

Should close the file for use by other processes. If already done, should have effect.

virtual bool CloudBuilder::CInputFile::IsOpen ( )
pure virtual

Should tell whether the file has been opened successfully.

Returns
true if the file is ready for read, false otherwise.
virtual size_t CloudBuilder::CInputFile::Read ( void *  aDestBuffer,
size_t  aNumBytes 
)
pure virtual

Reads a chunk of data from the current cursor position.

Parameters
aDestBufferwhere to put the read data.
aNumBytesthe maximum number of bytes to read.
Returns
the number of bytes actually read (may be less than numBytes if the stream came to an end).
char* CloudBuilder::CInputFile::ReadAll ( )

Reads the whole file from the current cursor position.

Returns
resulting string (or null in case of error), to be freed manually!
virtual bool CloudBuilder::CInputFile::Seek ( long  aOffset,
int  aWhence 
)
pure virtual

Replaces the cursor just like fseek.

Parameters
aOffsetoffset relative to whence.
aWhenceone of SEEK_SET (beginning), SEEK_CUR or SEEK_END.
virtual size_t CloudBuilder::CInputFile::Tell ( )
pure virtual

Should give the absolute position of the cursor in the file.

Returns
the position, starting from zero.

The documentation for this class was generated from the following file: