00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef LEMUR_READBUFFER_HPP
00020 #define LEMUR_READBUFFER_HPP
00021
00022 #include "File.hpp"
00023
00025 class ReadBuffer {
00026 private:
00027 File::offset_type _filePosition;
00028 char* _buffer;
00029 File& _file;
00030 int _bufferSize;
00031 int _bufferPosition;
00032 int _bufferDataLength;
00033 bool _gValid;
00034
00035 public:
00040 ReadBuffer( File& file, int bufferSize );
00041 ~ReadBuffer();
00042
00046 void read( char* data, int length );
00047
00051 const char* peek( int length );
00052
00056 const char* read( int length );
00057
00062 void seekg( File::offset_type position, std::fstream::seekdir direction );
00063
00066 File::offset_type tellg();
00067
00071 int rdstate();
00072
00076 void invalidateg();
00077 };
00078
00079 #endif // LEMUR_READBUFFER_HPP