Fabcoin Core
0.16.2
P2P Digital Currency
|
Non-refcounted RAII wrapper for FILE*. More...
#include <streams.h>
Public Member Functions | |
CAutoFile (FILE *filenew, int nTypeIn, int nVersionIn) | |
~CAutoFile () | |
void | fclose () |
FILE * | release () |
Get wrapped FILE* with transfer of ownership. More... | |
FILE * | Get () const |
Get wrapped FILE* without transfer of ownership. More... | |
bool | IsNull () const |
Return true if the wrapped FILE* is nullptr, false otherwise. More... | |
int | GetType () const |
int | GetVersion () const |
void | read (char *pch, size_t nSize) |
void | ignore (size_t nSize) |
void | write (const char *pch, size_t nSize) |
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 | |
const int | nType |
const 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 |
|
inline |
|
inline |
|
inline |
|
inline |