Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
FileReadStream Class Reference

File byte stream for input using fread(). More...

#include <filereadstream.h>

Public Types

typedef char Ch
 Character type (byte). More...
 

Public Member Functions

 FileReadStream (std::FILE *fp, char *buffer, size_t bufferSize)
 Constructor. More...
 
void Flush ()
 
Ch Peek () const
 
const ChPeek4 () const
 
void Put (Ch)
 
ChPutBegin ()
 
size_t PutEnd (Ch *)
 
Ch Take ()
 
size_t Tell () const
 

Private Member Functions

void Read ()
 

Private Attributes

Chbuffer_
 
ChbufferLast_
 
size_t bufferSize_
 
size_t count_
 Number of characters read. More...
 
Chcurrent_
 
bool eof_
 
std::FILE * fp_
 
size_t readCount_
 

Detailed Description

File byte stream for input using fread().

Note
implements Stream concept

Definition at line 34 of file filereadstream.h.

Member Typedef Documentation

typedef char FileReadStream::Ch

Character type (byte).

Definition at line 37 of file filereadstream.h.

Constructor & Destructor Documentation

FileReadStream::FileReadStream ( std::FILE *  fp,
char *  buffer,
size_t  bufferSize 
)
inline

Constructor.

Parameters
fpFile pointer opened for read.
bufferuser-supplied buffer.
bufferSizesize of buffer in bytes. Must >=4 bytes.

Definition at line 45 of file filereadstream.h.

Member Function Documentation

void FileReadStream::Flush ( )
inline

Definition at line 80 of file filereadstream.h.

Ch FileReadStream::Peek ( ) const
inline

Definition at line 60 of file filereadstream.h.

const Ch* FileReadStream::Peek4 ( ) const
inline

Definition at line 96 of file filereadstream.h.

void FileReadStream::Put ( Ch  )
inline

Definition at line 76 of file filereadstream.h.

Ch* FileReadStream::PutBegin ( )
inline

Definition at line 84 of file filereadstream.h.

size_t FileReadStream::PutEnd ( Ch )
inline

Definition at line 89 of file filereadstream.h.

void FileReadStream::Read ( )
inlineprivate

Definition at line 102 of file filereadstream.h.

Ch FileReadStream::Take ( )
inline

Definition at line 64 of file filereadstream.h.

size_t FileReadStream::Tell ( ) const
inline

Definition at line 70 of file filereadstream.h.

Member Data Documentation

Ch* FileReadStream::buffer_
private

Definition at line 123 of file filereadstream.h.

Ch* FileReadStream::bufferLast_
private

Definition at line 125 of file filereadstream.h.

size_t FileReadStream::bufferSize_
private

Definition at line 124 of file filereadstream.h.

size_t FileReadStream::count_
private

Number of characters read.

Definition at line 128 of file filereadstream.h.

Ch* FileReadStream::current_
private

Definition at line 126 of file filereadstream.h.

bool FileReadStream::eof_
private

Definition at line 129 of file filereadstream.h.

std::FILE* FileReadStream::fp_
private

Definition at line 122 of file filereadstream.h.

size_t FileReadStream::readCount_
private

Definition at line 127 of file filereadstream.h.


The documentation for this class was generated from the following file:


xbot_talker
Author(s): wangxiaoyun
autogenerated on Sat Oct 10 2020 03:27:54