Cafu Engine
cf::FileSys::FileI Class Referenceabstract
Inheritance diagram for cf::FileSys::FileI:

Public Types

enum  SeekFromT { FROM_BEGINNING, FROM_CURRENT_POS, FROM_END }
 The values of this enumeration define from where the seek operation applies the offset. More...
 

Public Member Functions

virtual ~FileI ()
 The virtual destructor, so that derived classes can safely be deleted via a FileI (base class) pointer. More...
 
virtual bool IsOpen () const =0
 Returns whether the file has successfully been opened and is still open. More...
 
virtual const std::string & GetBaseName () const =0
 Returns the base name of this file. The base name is relative to and agnostic of the file system this file is in. More...
 
virtual const std::string & GetFullName () const =0
 Returns the full name of this file. More...
 
virtual uint64_t GetPos () const =0
 Returns the current read/write position in the file. More...
 
virtual bool Seek (int32_t Offset, SeekFromT SeekFrom)=0
 Modifies the position of the read/write pointer in the file. More...
 

Member Enumeration Documentation

The values of this enumeration define from where the seek operation applies the offset.

Constructor & Destructor Documentation

virtual cf::FileSys::FileI::~FileI ( )
inlinevirtual

The virtual destructor, so that derived classes can safely be deleted via a FileI (base class) pointer.

Member Function Documentation

virtual const std::string& cf::FileSys::FileI::GetBaseName ( ) const
pure virtual

Returns the base name of this file. The base name is relative to and agnostic of the file system this file is in.

Implemented in cf::FileSys::LocalOutFileT, cf::FileSys::MemoryInFileT, and cf::FileSys::LocalInFileT.

virtual const std::string& cf::FileSys::FileI::GetFullName ( ) const
pure virtual

Returns the full name of this file.

The full name is the base name prepended by the file system specific path/URL. TODO: Have a GetFileSys() method instead???

Implemented in cf::FileSys::LocalOutFileT, cf::FileSys::MemoryInFileT, and cf::FileSys::LocalInFileT.

virtual uint64_t cf::FileSys::FileI::GetPos ( ) const
pure virtual

Returns the current read/write position in the file.

Implemented in cf::FileSys::LocalOutFileT, cf::FileSys::MemoryInFileT, and cf::FileSys::LocalInFileT.

virtual bool cf::FileSys::FileI::IsOpen ( ) const
pure virtual

Returns whether the file has successfully been opened and is still open.

Implemented in cf::FileSys::LocalOutFileT, cf::FileSys::MemoryInFileT, and cf::FileSys::LocalInFileT.

virtual bool cf::FileSys::FileI::Seek ( int32_t  Offset,
SeekFromT  SeekFrom 
)
pure virtual

Modifies the position of the read/write pointer in the file.

Parameters
OffsetHow much to move the pointer.
SeekFromDefines from where the offset is applied, see SeekFromT for possible values.
Returns
true if the seek operation was successful, false otherwise.

Implemented in cf::FileSys::LocalOutFileT, cf::FileSys::MemoryInFileT, and cf::FileSys::LocalInFileT.


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