![]() |
PIVX Core
5.6.99
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 |
| CBufferedFile (const CBufferedFile &)=delete | |
| CBufferedFile & | operator= (const CBufferedFile &)=delete |
| void | fclose () |
| bool | eof () const |
| void | read (char *pch, size_t nSize) |
| uint64_t | GetPos () |
| bool | SetPos (uint64_t nPos) |
| rewind to a given reading position More... | |
| bool | SetLimit (uint64_t nPos=std::numeric_limits< uint64_t >::max()) |
| prevent reading beyond a certain position no argument removes the limit More... | |
| 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 |
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).
|
inline |
|
inline |
|
delete |
|
inline |
|
inline |
|
inlineprotected |
|
inline |
|
inline |
|
delete |
|
inline |
|
inline |
|
inline |
|
inline |