Master Core  v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Public Attributes | Protected Member Functions | Private Attributes | List of all members
CBufferedFile Class Reference

Wrapper around a FILE* that implements a ring buffer to deserialize from. More...

#include <serialize.h>

+ Collaboration diagram for CBufferedFile:

Public Member Functions

 CBufferedFile (FILE *fileIn, uint64_t nBufSize, uint64_t nRewindIn, int nTypeIn, int nVersionIn)
 
bool good () const
 
bool eof () const
 
CBufferedFileread (char *pch, size_t nSize)
 
uint64_t GetPos ()
 
bool SetPos (uint64_t nPos)
 
bool Seek (uint64_t nPos)
 
bool SetLimit (uint64_t nPos=(uint64_t)(-1))
 
template<typename T >
CBufferedFileoperator>> (T &obj)
 
void FindByte (char ch)
 

Public Attributes

int nType
 
int nVersion
 

Protected Member Functions

void setstate (short bits, const char *psz)
 
bool Fill ()
 

Private Attributes

FILE * src
 
uint64_t nSrcPos
 
uint64_t nReadPos
 
uint64_t nReadLimit
 
uint64_t nRewind
 
std::vector< char > vchBuf
 
short state
 
short exceptmask
 

Detailed Description

Wrapper around a FILE* that implements a ring buffer to deserialize from.

It guarantees the ability to rewind a given number of bytes.

Definition at line 1257 of file serialize.h.

Constructor & Destructor Documentation

CBufferedFile::CBufferedFile ( FILE *  fileIn,
uint64_t  nBufSize,
uint64_t  nRewindIn,
int  nTypeIn,
int  nVersionIn 
)
inline

Definition at line 1300 of file serialize.h.

Member Function Documentation

bool CBufferedFile::eof ( ) const
inline

Definition at line 1311 of file serialize.h.

Referenced by LoadExternalBlockFile().

+ Here is the caller graph for this function:

bool CBufferedFile::Fill ( )
inlineprotected

Definition at line 1278 of file serialize.h.

References nReadPos, read(), and setstate().

Referenced by FindByte(), and read().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CBufferedFile::FindByte ( char  ch)
inline

Definition at line 1387 of file serialize.h.

References Fill().

Referenced by LoadExternalBlockFile().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint64_t CBufferedFile::GetPos ( )
inline

Definition at line 1339 of file serialize.h.

References nReadPos.

Referenced by LoadExternalBlockFile().

+ Here is the caller graph for this function:

bool CBufferedFile::good ( ) const
inline

Definition at line 1306 of file serialize.h.

Referenced by LoadExternalBlockFile().

+ Here is the caller graph for this function:

template<typename T >
CBufferedFile& CBufferedFile::operator>> ( T &  obj)
inline

Definition at line 1380 of file serialize.h.

References Unserialize().

+ Here is the call graph for this function:

CBufferedFile& CBufferedFile::read ( char *  pch,
size_t  nSize 
)
inline

Definition at line 1316 of file serialize.h.

References Fill(), memcpy(), and nReadPos.

Referenced by Fill().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool CBufferedFile::Seek ( uint64_t  nPos)
inline

Definition at line 1357 of file serialize.h.

Referenced by LoadExternalBlockFile().

+ Here is the caller graph for this function:

bool CBufferedFile::SetLimit ( uint64_t  nPos = (uint64_t)(-1))
inline

Definition at line 1372 of file serialize.h.

Referenced by LoadExternalBlockFile().

+ Here is the caller graph for this function:

bool CBufferedFile::SetPos ( uint64_t  nPos)
inline

Definition at line 1344 of file serialize.h.

References nRewind, and nSrcPos.

Referenced by LoadExternalBlockFile().

+ Here is the caller graph for this function:

void CBufferedFile::setstate ( short  bits,
const char *  psz 
)
inlineprotected

Definition at line 1271 of file serialize.h.

Referenced by Fill().

+ Here is the caller graph for this function:

Member Data Documentation

short CBufferedFile::exceptmask
private

Definition at line 1268 of file serialize.h.

uint64_t CBufferedFile::nReadLimit
private

Definition at line 1263 of file serialize.h.

uint64_t CBufferedFile::nReadPos
private

Definition at line 1262 of file serialize.h.

Referenced by Fill(), GetPos(), and read().

uint64_t CBufferedFile::nRewind
private

Definition at line 1264 of file serialize.h.

Referenced by SetPos().

uint64_t CBufferedFile::nSrcPos
private

Definition at line 1261 of file serialize.h.

Referenced by SetPos().

int CBufferedFile::nType

Definition at line 1297 of file serialize.h.

int CBufferedFile::nVersion

Definition at line 1298 of file serialize.h.

FILE* CBufferedFile::src
private

Definition at line 1260 of file serialize.h.

short CBufferedFile::state
private

Definition at line 1267 of file serialize.h.

std::vector<char> CBufferedFile::vchBuf
private

Definition at line 1265 of file serialize.h.


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