6#ifndef BITCOIN_FLATFILE_H
7#define BITCOIN_FLATFILE_H
FlatFileSeq represents a sequence of numbered files storing raw data.
fs::path FileName(const FlatFilePos &pos) const
Get the name of the file at the given position.
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.
bool Flush(const FlatFilePos &pos, bool finalize=false)
Commit a file to disk, and optionally truncate off extra pre-allocated bytes if final.
const char *const m_prefix
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.
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)