NSFileSystem::TVirtualFileReal Class Reference

This class defines real file from disk (or another device). More...

#include <VirtualFileReal.h>

Inheritance diagram for NSFileSystem::TVirtualFileReal:

Inheritance graph
[legend]
Collaboration diagram for NSFileSystem::TVirtualFileReal:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void Close (void)
 Close file and destroy object.
virtual const TStringGetName (void) const
 Returns name of this file.
virtual const LONG GetSize (void) const
 Returns size of this file in bytes.
virtual BOOL Eof (void)
 Determine whether file position is after last character.
virtual LONG Tell (void)
 Returns actual position in file (in bytes).
virtual BOOL Seek (const LONG &position)
 Seek to specified position in file.
virtual BOOL SeekToStart (void)
 Seek file to begin.
virtual BOOL SeekToEnd (void)
 Seek file to end.
virtual BOOL SeekRelative (const LONG &offset)
 Seek file relative to actual position.
virtual int GetChar (void)
 Return next character from file or EOF at end of file.
virtual DWORD Read (void *buffer, const DWORD &size)
 Read specified number of bytes into buffer.
virtual BOOL FindChar (int ch)
 Read file until specified character.
virtual BOOL ReadUntil (int ch, TString &res)
 Read file until specified character and store it into string.
virtual BOOL ReadString (TString &text)
 Read next string - "..".

Static Public Member Functions

static TVirtualFileOpenFile (const TString &filename)
 Return pointer to specified file or NULL when file could be opened.

Protected Member Functions

virtual ~TVirtualFileReal (void)
 Virtual destructor.

Detailed Description

This class defines real file from disk (or another device).

Thus file can be opened with classic OS routines.

You can only get pointer to opened TVirtualFile via static OpenFile method.

Definition at line 39 of file VirtualFileReal.h.


Constructor & Destructor Documentation

TVirtualFileReal::~TVirtualFileReal void   )  [protected, virtual]
 

Virtual destructor.

Definition at line 21 of file VirtualFileReal.cpp.


Member Function Documentation

void NSFileSystem::TVirtualFileReal::Close void   )  [inline, virtual]
 

Close file and destroy object.

After calling this method pointer to object is invalid and should be set to null.

Via this method you destroy object.

Implements NSFileSystem::TVirtualFile.

Definition at line 93 of file VirtualFileReal.h.

BOOL NSFileSystem::TVirtualFileReal::Eof void   )  [inline, virtual]
 

Determine whether file position is after last character.

Implements NSFileSystem::TVirtualFile.

Definition at line 114 of file VirtualFileReal.h.

BOOL NSFileSystem::TVirtualFileReal::FindChar int  ch  )  [inline, virtual]
 

Read file until specified character.

If character was found then TRUE is returned and file is at position after this character.

Parameters:
ch [in] character to find

Implements NSFileSystem::TVirtualFile.

Definition at line 155 of file VirtualFileReal.h.

int NSFileSystem::TVirtualFileReal::GetChar void   )  [inline, virtual]
 

Return next character from file or EOF at end of file.

Implements NSFileSystem::TVirtualFile.

Definition at line 133 of file VirtualFileReal.h.

const TString & NSFileSystem::TVirtualFileReal::GetName void   )  const [inline, virtual]
 

Returns name of this file.

Implements NSFileSystem::TVirtualFile.

Definition at line 100 of file VirtualFileReal.h.

const LONG NSFileSystem::TVirtualFileReal::GetSize void   )  const [inline, virtual]
 

Returns size of this file in bytes.

Implements NSFileSystem::TVirtualFile.

Definition at line 107 of file VirtualFileReal.h.

TVirtualFile * TVirtualFileReal::OpenFile const TString filename  )  [static]
 

Return pointer to specified file or NULL when file could be opened.

Via this method you can open files from disk.

Parameters:
filename [in] name of opened file

Definition at line 38 of file VirtualFileReal.cpp.

References TString::c_str().

Referenced by NSFileSystem::TFSFileSystem::GetFile().

Here is the call graph for this function:

DWORD NSFileSystem::TVirtualFileReal::Read void *  buffer,
const DWORD size
[inline, virtual]
 

Read specified number of bytes into buffer.

Parameters:
buffer [in] destination buffer with required size
size [in] number of bytes to read

Implements NSFileSystem::TVirtualFile.

Definition at line 143 of file VirtualFileReal.h.

BOOL NSFileSystem::TVirtualFileReal::ReadString TString text  )  [inline, virtual]
 

Read next string - "..".

Method founds first character '"' and then reads string until next ". Final string doesnt contain begin and end character '"'. String parameter TEXT is always cleared.

After returning TRUE position in file is set to first character after end of string (after '"');

Readed string musn't contains symbol '"' - escape characters arent recognized too.

Parameters:
text [out] output string

Implements NSFileSystem::TVirtualFile.

Definition at line 212 of file VirtualFileReal.h.

References TString::Add(), TString::ClearDeallocOff(), and FALSE.

Here is the call graph for this function:

BOOL NSFileSystem::TVirtualFileReal::ReadUntil int  ch,
TString res
[inline, virtual]
 

Read file until specified character and store it into string.

Terminal character is not included in result string.

String RES is automatically cleared in function.

Return TRUE if specified character was found, FALSE otherwise (EOF was reached and terminal character was not found).

Parameters:
ch [in] terminal string
res [out] output string

Implements NSFileSystem::TVirtualFile.

Definition at line 185 of file VirtualFileReal.h.

References TString::Add(), and TString::ClearDeallocOff().

Here is the call graph for this function:

BOOL TVirtualFileReal::Seek const LONG position  )  [virtual]
 

Seek to specified position in file.

If position is outside then EOF is set.

Returns TRUE if seeking was successful.

Parameters:
position [in] final position in file

Implements NSFileSystem::TVirtualFile.

Definition at line 65 of file VirtualFileReal.cpp.

BOOL TVirtualFileReal::SeekRelative const LONG offset  )  [virtual]
 

Seek file relative to actual position.

If result is outside then is set to START or END of file.

Returns TRUE if seeking was successful.

Parameters:
offset [in] specified offset from actual position

Implements NSFileSystem::TVirtualFile.

Definition at line 109 of file VirtualFileReal.cpp.

BOOL TVirtualFileReal::SeekToEnd void   )  [virtual]
 

Seek file to end.

Returns TRUE if seeking was successful.

Implements NSFileSystem::TVirtualFile.

Definition at line 97 of file VirtualFileReal.cpp.

BOOL TVirtualFileReal::SeekToStart void   )  [virtual]
 

Seek file to begin.

Returns TRUE if seeking was successful.

Implements NSFileSystem::TVirtualFile.

Definition at line 88 of file VirtualFileReal.cpp.

LONG NSFileSystem::TVirtualFileReal::Tell void   )  [inline, virtual]
 

Returns actual position in file (in bytes).

Implements NSFileSystem::TVirtualFile.

Definition at line 121 of file VirtualFileReal.h.


The documentation for this class was generated from the following files:
Generated on Wed Nov 28 22:45:19 2007 for Joy4D by  doxygen 1.4.6-NO