Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
Non-refcounted RAII wrapper for FILE*.
More...
#include <streams.h>
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).
Definition at line 410 of file streams.h.
◆ CAutoFile() [1/2]
CAutoFile::CAutoFile |
( |
FILE * |
filenew, |
|
|
int |
nTypeIn, |
|
|
int |
nVersionIn |
|
) |
| |
|
inline |
◆ ~CAutoFile()
CAutoFile::~CAutoFile |
( |
| ) |
|
|
inline |
◆ CAutoFile() [2/2]
◆ fclose()
void CAutoFile::fclose |
( |
| ) |
|
|
inline |
◆ Get()
FILE* CAutoFile::Get |
( |
| ) |
const |
|
inline |
Get wrapped FILE* without transfer of ownership.
- Note
- Ownership of the FILE* will remain with this class. Use this only if the scope of the CAutoFile outlives use of the passed pointer.
Definition at line 451 of file streams.h.
References file.
Referenced by DumpMempool(), and GetTransaction().
◆ GetType()
int CAutoFile::GetType |
( |
| ) |
const |
|
inline |
◆ GetVersion()
int CAutoFile::GetVersion |
( |
| ) |
const |
|
inline |
◆ ignore()
void CAutoFile::ignore |
( |
size_t |
nSize | ) |
|
|
inline |
◆ IsNull()
bool CAutoFile::IsNull |
( |
| ) |
const |
|
inline |
◆ operator<<()
template<typename T >
CAutoFile& CAutoFile::operator<< |
( |
const T & |
obj | ) |
|
|
inline |
◆ operator=()
◆ operator>>()
◆ read()
void CAutoFile::read |
( |
char * |
pch, |
|
|
size_t |
nSize |
|
) |
| |
|
inline |
◆ release()
FILE* CAutoFile::release |
( |
| ) |
|
|
inline |
Get wrapped FILE* with transfer of ownership.
- Note
- This will invalidate the CAutoFile object, and makes it the responsibility of the caller of this function to clean up the returned FILE*.
Definition at line 445 of file streams.h.
References file.
◆ write()
void CAutoFile::write |
( |
const char * |
pch, |
|
|
size_t |
nSize |
|
) |
| |
|
inline |
◆ file
◆ nType
const int CAutoFile::nType |
|
private |
◆ nVersion
const int CAutoFile::nVersion |
|
private |
The documentation for this class was generated from the following file: