Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

fileio Class Reference

#include <fileio.h>

Collaboration diagram for fileio:

Collaboration graph
List of all members.

Detailed Description

FileIO class.


Public Member Functions

 fileio (const string &FileName, open_mode OpenMode)
 File constructor.

 ~fileio (void)
 File destructor.

fileiooperator<< (const string &String)
 Write by the end a string to the file.

void ReadFull (void) const
 Read all the data in a file.

void ReadBlock (streamoff FileOffset, streamsize BlockSize) const
 Read a block in base to pBlockSize.

char * GetCurrentBlock (void) const
 Get current block content pointer.

streamsize GetCurrentBlockSize (void) const
 Get current block size.

streamsize GetSize (void) const
 Return the number of bytes in file.


Private Member Functions

void ReadContent (streamoff FileOffset) const
 Read file data and stores it in memory.

void WriteContent (const char *pContent, streamsize ContentSize, streamoff FileOffset)
 Write data to the file at specified position.

void DeleteContent (void) const
 Delete Content of the current block.


Private Attributes

fstream m_FStream
 File stream.

char * m_pContent
 Pointer to block content.

streamsize m_BlockSize
 Size of the current block.


Constructor & Destructor Documentation

fileio::fileio const string &  FileName,
open_mode  OpenMode
 

File constructor.

Parameters:
FileName: File name.
OpenMode: Open mode.

fileio::~fileio void   ) 
 

File destructor.

Here is the call graph for this function:


Member Function Documentation

fileio & fileio::operator<< const string &  String  ) 
 

Write by the end a string to the file.

Here is the call graph for this function:

void fileio::ReadFull void   )  const
 

Read all the data in a file.

Here is the call graph for this function:

void fileio::ReadBlock streamoff  FileOffset,
streamsize  BlockSize
const
 

Read a block in base to pBlockSize.

Parameters:
FileOffset: The data will be read from that offset of the file.
BlockSize: The amount of bytes to try to read.
Note:
FileOffset < filesize & BlockSize > 0

Here is the call graph for this function:

char * fileio::GetCurrentBlock void   )  const
 

Get current block content pointer.

Returns:
Current block content pointer.
Note:
NULL means that there is no current block.

streamsize fileio::GetCurrentBlockSize void   )  const
 

Get current block size.

Returns:
Current block size.

streamsize fileio::GetSize void   )  const
 

Return the number of bytes in file.

Returns:
Total bytes in file.

void fileio::ReadContent streamoff  FileOffset  )  const [private]
 

Read file data and stores it in memory.

Parameters:
FileOffset: The data will be read from that offset of the file.
Note:
ReadContent does NOT check the Size and the Offset, better use ReadBlock or ReadFull.

void fileio::WriteContent const char *  pContent,
streamsize  ContentSize,
streamoff  FileOffset
[private]
 

Write data to the file at specified position.

Parameters:
pContent: Block of data to be stored on file.
ContentSize: Size of de block.
FileOffset: The data will be wrote from that offset of the file.
Note:
WriteContent does NOT check the Size and the Offset, better use operator <<.

void fileio::DeleteContent void   )  const [private]
 

Delete Content of the current block.


Member Data Documentation

fstream fileio::m_FStream [mutable, private]
 

File stream.

char* fileio::m_pContent [mutable, private]
 

Pointer to block content.

streamsize fileio::m_BlockSize [mutable, private]
 

Size of the current block.


The documentation for this class was generated from the following files:
doxygen sourceforge id3lib