 |
Bitcoin Core
21.99.0
P2P Digital Currency
|
Go to the documentation of this file.
6 #ifndef BITCOIN_FLATFILE_H
7 #define BITCOIN_FLATFILE_H
90 #endif // BITCOIN_FLATFILE_H
friend bool operator==(const FlatFilePos &a, const FlatFilePos &b)
std::string ToString() const
#define VARINT_MODE(obj, mode)
const size_t m_chunk_size
size_t Allocate(const FlatFilePos &pos, size_t add_size, bool &out_of_space)
Allocate additional space in a file after the given starting position.
SERIALIZE_METHODS(FlatFilePos, obj)
FlatFilePos(int nFileIn, unsigned int nPosIn)
FlatFileSeq represents a sequence of numbered files storing raw data.
FlatFileSeq(fs::path dir, const char *prefix, size_t chunk_size)
Constructor.
FILE * Open(const FlatFilePos &pos, bool read_only=false)
Open a handle to the file at the given position.
friend bool operator!=(const FlatFilePos &a, const FlatFilePos &b)
fs::path FileName(const FlatFilePos &pos) const
Get the name of the file at the given position.
const char *const m_prefix
bool Flush(const FlatFilePos &pos, bool finalize=false)
Commit a file to disk, and optionally truncate off extra pre-allocated bytes if final.