MercuryFile Class Reference

Base file object for accessing files. More...

#include <MercuryFiles.h>

Inheritance diagram for MercuryFile:

Inheritance graph
[legend]
Collaboration diagram for MercuryFile:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MercuryFile ()
virtual ~MercuryFile ()
virtual bool Init (const MString &sPath, FilePermission p)
 [internal] Initialize the file
virtual void Close ()=0
 Close the file.
virtual bool Seek (unsigned long position)=0
 Set the current seek position.
virtual unsigned long Tell ()=0
 Return the current seek position.
virtual unsigned long Length ()=0
 Return the length of the file (in bytes).
virtual bool Write (void *data, unsigned long length)=0
 Writes length bytes, returns true if it wrote successfully.
virtual unsigned long Read (void *data, unsigned long length)=0
 Returns the number of bytes read.
virtual bool ReadLine (MString &data)
 Reads one line from the file.
virtual bool Check ()=0
 Returns non-zero value if there's an error.
virtual bool Eof ()=0
 Return true if end of file.
virtual unsigned long GetModTime ()
 Return the last time the file was modified, if 0, this means unknown.
MString GetName ()

Protected Attributes

MString m_sPath
FilePermission m_p

Detailed Description

Base file object for accessing files.

Definition at line 21 of file MercuryFiles.h.


Constructor & Destructor Documentation

MercuryFile::MercuryFile (  ) 

Definition at line 162 of file MercuryFiles.cpp.

MercuryFile::~MercuryFile (  )  [virtual]

Definition at line 167 of file MercuryFiles.cpp.


Member Function Documentation

bool MercuryFile::Init ( const MString sPath,
FilePermission  p 
) [virtual]

[internal] Initialize the file

Reimplemented in MercuryFileObjectDirect, and MercuryFileObjectNet.

Definition at line 172 of file MercuryFiles.cpp.

virtual void MercuryFile::Close (  )  [pure virtual]

Close the file.

Implemented in MercuryFileObjectDirect, MercuryFileObjectPacked, MercuryFileObjectZipped, and MercuryFileObjectNet.

virtual bool MercuryFile::Seek ( unsigned long  position  )  [pure virtual]

Set the current seek position.

Implemented in MercuryFileObjectDirect, MercuryFileObjectPacked, MercuryFileObjectZipped, and MercuryFileObjectNet.

virtual unsigned long MercuryFile::Tell (  )  [pure virtual]

Return the current seek position.

Implemented in MercuryFileObjectDirect, MercuryFileObjectPacked, MercuryFileObjectZipped, and MercuryFileObjectNet.

virtual unsigned long MercuryFile::Length (  )  [pure virtual]

Return the length of the file (in bytes).

Implemented in MercuryFileObjectDirect, MercuryFileObjectPacked, MercuryFileObjectZipped, and MercuryFileObjectNet.

virtual bool MercuryFile::Write ( void *  data,
unsigned long  length 
) [pure virtual]

Writes length bytes, returns true if it wrote successfully.

Implemented in MercuryFileObjectDirect, MercuryFileObjectPacked, MercuryFileObjectZipped, and MercuryFileObjectNet.

virtual unsigned long MercuryFile::Read ( void *  data,
unsigned long  length 
) [pure virtual]

Returns the number of bytes read.

Implemented in MercuryFileObjectDirect, MercuryFileObjectPacked, MercuryFileObjectZipped, and MercuryFileObjectNet.

bool MercuryFile::ReadLine ( MString data  )  [virtual]

Reads one line from the file.

Definition at line 179 of file MercuryFiles.cpp.

virtual bool MercuryFile::Check (  )  [pure virtual]

Returns non-zero value if there's an error.

Implemented in MercuryFileObjectDirect, MercuryFileObjectPacked, MercuryFileObjectZipped, and MercuryFileObjectNet.

virtual bool MercuryFile::Eof (  )  [pure virtual]

Return true if end of file.

Implemented in MercuryFileObjectDirect, MercuryFileObjectPacked, MercuryFileObjectZipped, and MercuryFileObjectNet.

virtual unsigned long MercuryFile::GetModTime (  )  [inline, virtual]

Return the last time the file was modified, if 0, this means unknown.

Reimplemented in MercuryFileObjectDirect.

Definition at line 47 of file MercuryFiles.h.

MString MercuryFile::GetName (  )  [inline]

Definition at line 49 of file MercuryFiles.h.


Member Data Documentation

MString MercuryFile::m_sPath [protected]

Definition at line 51 of file MercuryFiles.h.

FilePermission MercuryFile::m_p [protected]

Definition at line 52 of file MercuryFiles.h.


The documentation for this class was generated from the following files:
Hosted by SourceForge.net Logo