Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
Generic Dumping and Loading
More...#include <flat-database.h>
Public Member Functions | |
CFlatDB (std::string strFilenameIn, std::string strMagicMessageIn) | |
bool | Load (T &objToLoad) |
bool | Dump (T &objToSave) |
Private Types | |
enum | ReadResult { Ok, FileError, HashReadError, IncorrectHash, IncorrectMagicMessage, IncorrectMagicNumber, IncorrectFormat } |
Private Member Functions | |
bool | Write (const T &objToSave) |
ReadResult | Read (T &objToLoad, bool fDryRun=false) |
Private Attributes | |
fs::path | pathDB |
std::string | strFilename |
std::string | strMagicMessage |
Detailed Description
template<typename T>
class CFlatDB< T >
Generic Dumping and Loading
Definition at line 21 of file flat-database.h.
Member Enumeration Documentation
◆ ReadResult
|
private |
Enumerator | |
---|---|
Ok | |
FileError | |
HashReadError | |
IncorrectHash | |
IncorrectMagicMessage | |
IncorrectMagicNumber | |
IncorrectFormat |
Definition at line 25 of file flat-database.h.
Constructor & Destructor Documentation
◆ CFlatDB()
|
inline |
Definition at line 166 of file flat-database.h.
References GetDataDir(), CFlatDB< T >::pathDB, CFlatDB< T >::strFilename, and CFlatDB< T >::strMagicMessage.
Member Function Documentation
◆ Dump()
|
inline |
Definition at line 195 of file flat-database.h.
References CFlatDB< T >::FileError, GetTimeMillis(), CFlatDB< T >::IncorrectFormat, LogPrintf, CFlatDB< T >::Ok, CFlatDB< T >::Read(), CFlatDB< T >::strFilename, and CFlatDB< T >::Write().
Referenced by AppInitMain(), and PrepareShutdown().
◆ Load()
|
inline |
Definition at line 173 of file flat-database.h.
References CFlatDB< T >::FileError, CFlatDB< T >::IncorrectFormat, LogPrintf, CFlatDB< T >::Ok, CFlatDB< T >::Read(), and CFlatDB< T >::strFilename.
Referenced by AppInitMain().
◆ Read()
|
inlineprivate |
Definition at line 74 of file flat-database.h.
References CDataStream::begin(), CLIENT_VERSION, CDataStream::end(), error(), CFlatDB< T >::FileError, FLATDATA, fsbridge::fopen(), GetTimeMillis(), Hash(), CFlatDB< T >::HashReadError, CFlatDB< T >::IncorrectFormat, CFlatDB< T >::IncorrectHash, CFlatDB< T >::IncorrectMagicMessage, CFlatDB< T >::IncorrectMagicNumber, LogPrintf, CFlatDB< T >::Ok, Params(), CFlatDB< T >::pathDB, SER_DISK, CFlatDB< T >::strFilename, and CFlatDB< T >::strMagicMessage.
Referenced by CFlatDB< T >::Dump(), and CFlatDB< T >::Load().
◆ Write()
|
inlineprivate |
Definition at line 39 of file flat-database.h.
References CDataStream::begin(), CLIENT_VERSION, CDataStream::end(), error(), fileout, FLATDATA, fsbridge::fopen(), GetTimeMillis(), Hash(), LogPrintf, Params(), CFlatDB< T >::pathDB, SER_DISK, CFlatDB< T >::strFilename, and CFlatDB< T >::strMagicMessage.
Referenced by CFlatDB< T >::Dump().
Member Data Documentation
◆ pathDB
|
private |
Definition at line 35 of file flat-database.h.
Referenced by CFlatDB< T >::CFlatDB(), CFlatDB< T >::Read(), and CFlatDB< T >::Write().
◆ strFilename
|
private |
Definition at line 36 of file flat-database.h.
Referenced by CFlatDB< T >::CFlatDB(), CFlatDB< T >::Dump(), CFlatDB< T >::Load(), CFlatDB< T >::Read(), and CFlatDB< T >::Write().
◆ strMagicMessage
|
private |
Definition at line 37 of file flat-database.h.
Referenced by CFlatDB< T >::CFlatDB(), CFlatDB< T >::Read(), and CFlatDB< T >::Write().
The documentation for this class was generated from the following file:
- src/flat-database.h