NGL  6.5
The NCCA Graphics Library
FileReadStream Class Reference

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

#include <filereadstream.h>

+ Collaboration diagram for FileReadStream:

Public Types

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

Public Member Functions

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

Private Member Functions

void Read ()
 

Private Attributes

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

Detailed Description

File byte stream for input using fread().

Note
implements Stream concept

Definition at line 27 of file filereadstream.h.

Member Typedef Documentation

typedef char FileReadStream::Ch

Character type (byte).

Definition at line 29 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 37 of file filereadstream.h.

References fp_, RAPIDJSON_ASSERT, and Read().

+ Here is the call graph for this function:

Member Function Documentation

void FileReadStream::Flush ( )
inline

Definition at line 49 of file filereadstream.h.

References RAPIDJSON_ASSERT.

Ch FileReadStream::Peek ( ) const
inline

Definition at line 43 of file filereadstream.h.

References current_.

const Ch* FileReadStream::Peek4 ( ) const
inline

Definition at line 54 of file filereadstream.h.

References bufferLast_, and current_.

void FileReadStream::Put ( Ch  )
inline

Definition at line 48 of file filereadstream.h.

References RAPIDJSON_ASSERT.

Ch* FileReadStream::PutBegin ( )
inline

Definition at line 50 of file filereadstream.h.

References RAPIDJSON_ASSERT.

size_t FileReadStream::PutEnd ( Ch )
inline

Definition at line 51 of file filereadstream.h.

References RAPIDJSON_ASSERT.

void FileReadStream::Read ( )
inlineprivate

Definition at line 59 of file filereadstream.h.

References buffer_, bufferLast_, bufferSize_, count_, current_, eof_, fp_, and readCount_.

+ Here is the caller graph for this function:

Ch FileReadStream::Take ( )
inline

Definition at line 44 of file filereadstream.h.

References current_, and Read().

+ Here is the call graph for this function:

size_t FileReadStream::Tell ( ) const
inline

Definition at line 45 of file filereadstream.h.

References buffer_, count_, and current_.

Member Data Documentation

Ch* FileReadStream::buffer_
private

Definition at line 77 of file filereadstream.h.

Ch* FileReadStream::bufferLast_
private

Definition at line 79 of file filereadstream.h.

size_t FileReadStream::bufferSize_
private

Definition at line 78 of file filereadstream.h.

size_t FileReadStream::count_
private

Number of characters read.

Definition at line 82 of file filereadstream.h.

Ch* FileReadStream::current_
private

Definition at line 80 of file filereadstream.h.

bool FileReadStream::eof_
private

Definition at line 83 of file filereadstream.h.

std::FILE* FileReadStream::fp_
private

Definition at line 76 of file filereadstream.h.

size_t FileReadStream::readCount_
private

Definition at line 81 of file filereadstream.h.


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