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