Feathercoin  0.5.0
P2P Digital Currency
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
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 nBufSize, uint64 nRewindIn, int nTypeIn, int nVersionIn)
 
bool good () const
 
bool eof () const
 
CBufferedFileread (char *pch, size_t nSize)
 
uint64 GetPos ()
 
bool SetPos (uint64 nPos)
 
bool Seek (uint64 nPos)
 
bool SetLimit (uint64 nPos=(uint64)(-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 nSrcPos
 
uint64 nReadPos
 
uint64 nReadLimit
 
uint64 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 1220 of file serialize.h.

Constructor & Destructor Documentation

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

Definition at line 1263 of file serialize.h.

Member Function Documentation

bool CBufferedFile::eof ( ) const
inline

Definition at line 1274 of file serialize.h.

bool CBufferedFile::Fill ( )
inlineprotected

Definition at line 1241 of file serialize.h.

void CBufferedFile::FindByte ( char  ch)
inline

Definition at line 1350 of file serialize.h.

uint64 CBufferedFile::GetPos ( )
inline

Definition at line 1302 of file serialize.h.

bool CBufferedFile::good ( ) const
inline

Definition at line 1269 of file serialize.h.

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

Definition at line 1343 of file serialize.h.

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

Definition at line 1279 of file serialize.h.

bool CBufferedFile::Seek ( uint64  nPos)
inline

Definition at line 1320 of file serialize.h.

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

Definition at line 1335 of file serialize.h.

bool CBufferedFile::SetPos ( uint64  nPos)
inline

Definition at line 1307 of file serialize.h.

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

Definition at line 1234 of file serialize.h.

Member Data Documentation

short CBufferedFile::exceptmask
private

Definition at line 1231 of file serialize.h.

uint64 CBufferedFile::nReadLimit
private

Definition at line 1226 of file serialize.h.

uint64 CBufferedFile::nReadPos
private

Definition at line 1225 of file serialize.h.

uint64 CBufferedFile::nRewind
private

Definition at line 1227 of file serialize.h.

uint64 CBufferedFile::nSrcPos
private

Definition at line 1224 of file serialize.h.

int CBufferedFile::nType

Definition at line 1260 of file serialize.h.

int CBufferedFile::nVersion

Definition at line 1261 of file serialize.h.

FILE* CBufferedFile::src
private

Definition at line 1223 of file serialize.h.

short CBufferedFile::state
private

Definition at line 1230 of file serialize.h.

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

Definition at line 1228 of file serialize.h.


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