![]() |
Dash Core
0.12.2.1
P2P Digital Currency
|
#include <streams.h>
Public Member Functions | |
CAutoFile (FILE *filenew, int nTypeIn, int nVersionIn) | |
~CAutoFile () | |
void | fclose () |
FILE * | release () |
FILE * | Get () const |
bool | IsNull () const |
void | SetType (int n) |
int | GetType () |
void | SetVersion (int n) |
int | GetVersion () |
void | ReadVersion () |
void | WriteVersion () |
CAutoFile & | read (char *pch, size_t nSize) |
CAutoFile & | write (const char *pch, size_t nSize) |
template<typename T > | |
unsigned int | GetSerializeSize (const T &obj) |
template<typename T > | |
CAutoFile & | operator<< (const T &obj) |
template<typename T > | |
CAutoFile & | operator>> (T &obj) |
Private Member Functions | |
CAutoFile (const CAutoFile &) | |
CAutoFile & | operator= (const CAutoFile &) |
Private Attributes | |
int | nType |
int | nVersion |
FILE * | file |
Non-refcounted RAII wrapper for FILE*
Will automatically close the file when it goes out of scope if not null. If you're returning the file pointer, return file.release(). If you need to close the file early, use file.fclose() instead of fclose(file).
|
private |
|
inline |
|
inline |
Definition at line 371 of file streams.h.
Referenced by ~CAutoFile().
|
inline |
|
inline |
|
inline |
Return true if the wrapped FILE* is NULL, false otherwise.
Definition at line 393 of file streams.h.
Referenced by AppInit2(), PrepareShutdown(), and ReadBlockFromDisk().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
Definition at line 356 of file streams.h.
Referenced by CAutoFile(), fclose(), Get(), IsNull(), operator<<(), operator>>(), read(), release(), and write().
|
private |
Definition at line 353 of file streams.h.
Referenced by CAutoFile(), GetSerializeSize(), GetType(), operator<<(), operator>>(), and SetType().
|
private |
Definition at line 354 of file streams.h.
Referenced by CAutoFile(), GetSerializeSize(), GetVersion(), operator<<(), operator>>(), ReadVersion(), SetVersion(), and WriteVersion().