Anoncoin  0.9.4
P2P Digital Currency
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>

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 1266 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 1309 of file serialize.h.

Member Function Documentation

bool CBufferedFile::eof ( ) const
inline

Definition at line 1320 of file serialize.h.

Here is the caller graph for this function:

bool CBufferedFile::Fill ( )
inlineprotected

Definition at line 1287 of file serialize.h.

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 1396 of file serialize.h.

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t CBufferedFile::GetPos ( )
inline

Definition at line 1348 of file serialize.h.

Here is the caller graph for this function:

bool CBufferedFile::good ( ) const
inline

Definition at line 1315 of file serialize.h.

Here is the caller graph for this function:

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

Definition at line 1389 of file serialize.h.

Here is the call graph for this function:

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

Definition at line 1325 of file serialize.h.

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 1366 of file serialize.h.

Here is the caller graph for this function:

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

Definition at line 1381 of file serialize.h.

Here is the caller graph for this function:

bool CBufferedFile::SetPos ( uint64_t  nPos)
inline

Definition at line 1353 of file serialize.h.

Here is the caller graph for this function:

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

Definition at line 1280 of file serialize.h.

Here is the caller graph for this function:

Member Data Documentation

short CBufferedFile::exceptmask
private

Definition at line 1277 of file serialize.h.

uint64_t CBufferedFile::nReadLimit
private

Definition at line 1272 of file serialize.h.

uint64_t CBufferedFile::nReadPos
private

Definition at line 1271 of file serialize.h.

uint64_t CBufferedFile::nRewind
private

Definition at line 1273 of file serialize.h.

uint64_t CBufferedFile::nSrcPos
private

Definition at line 1270 of file serialize.h.

int CBufferedFile::nType

Definition at line 1306 of file serialize.h.

int CBufferedFile::nVersion

Definition at line 1307 of file serialize.h.

FILE* CBufferedFile::src
private

Definition at line 1269 of file serialize.h.

short CBufferedFile::state
private

Definition at line 1276 of file serialize.h.

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

Definition at line 1274 of file serialize.h.


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