Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
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 () | |
CBufferedFile (const CBufferedFile &)=delete | |
CBufferedFile & | operator= (const CBufferedFile &)=delete |
int | GetVersion () const |
int | GetType () const |
void | fclose () |
bool | eof () const |
void | read (char *pch, size_t nSize) |
uint64_t | GetPos () const |
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 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 |
Detailed Description
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).
Constructor & Destructor Documentation
◆ CBufferedFile() [1/2]
|
inline |
◆ ~CBufferedFile()
|
inline |
◆ CBufferedFile() [2/2]
|
delete |
Member Function Documentation
◆ eof()
|
inline |
◆ fclose()
|
inline |
◆ Fill()
|
inlineprotected |
◆ FindByte()
|
inline |
◆ GetPos()
|
inline |
Definition at line 606 of file streams.h.
References nReadPos.
Referenced by LoadExternalBlockFile().
◆ GetType()
|
inline |
◆ GetVersion()
|
inline |
◆ operator=()
|
delete |
◆ operator>>()
|
inline |
Definition at line 646 of file streams.h.
References Unserialize().
◆ read()
|
inline |
◆ Seek()
|
inline |
◆ SetLimit()
|
inline |
Definition at line 638 of file streams.h.
References nReadLimit, and nReadPos.
Referenced by LoadExternalBlockFile().
◆ SetPos()
|
inline |
Member Data Documentation
◆ nReadLimit
|
private |
Definition at line 528 of file streams.h.
Referenced by read(), and SetLimit().
◆ nReadPos
|
private |
Definition at line 527 of file streams.h.
Referenced by eof(), Fill(), FindByte(), GetPos(), read(), Seek(), SetLimit(), and SetPos().
◆ nRewind
|
private |
◆ nSrcPos
|
private |
◆ nType
|
private |
◆ nVersion
|
private |
Definition at line 523 of file streams.h.
Referenced by GetVersion().
◆ src
|
private |
◆ vchBuf
|
private |
Definition at line 530 of file streams.h.
Referenced by Fill(), FindByte(), and read().
The documentation for this class was generated from the following file:
- src/streams.h