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

ReadBuffer Class Reference

Provide a growable read buffer on a File object. More...

#include <ReadBuffer.hpp>

List of all members.

Public Methods

 ReadBuffer (File &file, int bufferSize)
 ~ReadBuffer ()
void read (char *data, int length)
const char * peek (int length)
const char * read (int length)
void seekg (File::offset_type position, std::fstream::seekdir direction)
File::offset_type tellg ()
int rdstate ()
void invalidateg ()

Private Attributes

File::offset_type _filePosition
char * _buffer
File_file
int _bufferSize
int _bufferPosition
int _bufferDataLength
bool _gValid


Detailed Description

Provide a growable read buffer on a File object.


Constructor & Destructor Documentation

ReadBuffer::ReadBuffer File   file,
int    bufferSize
 

wrap <file> in a ReadBuffer with initial buffer size <bufferSize>. The buffer may grow if necessary to support large peek() and read() requests.

ReadBuffer::~ReadBuffer  
 


Member Function Documentation

void ReadBuffer::invalidateg  
 

marks the underlying stream pointer as invalid--call this if you seek the underlying file to a new location

const char * ReadBuffer::peek int    length
 

return a pointer to a buffer containing the next <length> bytes, but do not advance the read pointer

int ReadBuffer::rdstate  
 

return the current read state bits, eofbit, badbit, etc. (same semantics as std::ifstream::rdstate())

const char * ReadBuffer::read int    length
 

return a pointer to a buffer containing the next <length> bytes, and advance the read pointer

void ReadBuffer::read char *    data,
int    length
 

standard read() semantics; will perform an unbuffered read if the read size is large enough

void ReadBuffer::seekg File::offset_type    position,
std::fstream::seekdir    direction
 

move the internal read pointer to <position>, which may be relative to the beginning, end or current position of the file as specified by <direction>.

File::offset_type ReadBuffer::tellg  
 

return the read pointer location with reference to the beginning of the file


Member Data Documentation

char* ReadBuffer::_buffer [private]
 

int ReadBuffer::_bufferDataLength [private]
 

int ReadBuffer::_bufferPosition [private]
 

int ReadBuffer::_bufferSize [private]
 

File& ReadBuffer::_file [private]
 

File::offset_type ReadBuffer::_filePosition [private]
 

bool ReadBuffer::_gValid [private]
 


The documentation for this class was generated from the following files:
Generated on Fri Feb 6 07:12:06 2004 for LEMUR by doxygen1.2.16