Fabcoin Core
0.16.2
P2P Digital Currency
|
Non-refcounted RAII wrapper around a FILE* that implements a ring buffer to deserialize from. More...
#include <streams.h>
Public Member Functions | |
CBufferedFile (FILE *fileIn, uint64_t nBufSize, uint64_t nRewindIn, int nTypeIn, int nVersionIn) | |
~CBufferedFile () | |
int | GetVersion () const |
int | GetType () const |
void | fclose () |
bool | eof () const |
void | read (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 > | |
CBufferedFile & | operator>> (T &obj) |
void | FindByte (char ch) |
Protected Member Functions | |
bool | Fill () |
Private Member Functions | |
CBufferedFile (const CBufferedFile &) | |
CBufferedFile & | operator= (const CBufferedFile &) |
Private Attributes | |
const int | nType |
const int | nVersion |
FILE * | src |
uint64_t | nSrcPos |
uint64_t | nReadPos |
uint64_t | nReadLimit |
uint64_t | nRewind |
std::vector< char > | vchBuf |
Non-refcounted RAII wrapper around a FILE* that implements a ring buffer to deserialize from.
It guarantees the ability to rewind a given number of bytes.
Will automatically close the file when it goes out of scope if not null. If you need to close the file early, use file.fclose() instead of fclose(file).
|
private |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
|
inline |
|
inline |
|
inline |
|
inline |