5#ifndef BITCOIN_WALLET_MIGRATE_H
6#define BITCOIN_WALLET_MIGRATE_H
45 bool Rewrite(
const char* pszSkip =
nullptr)
override {
return false; }
49 bool Backup(
const std::string& strDest)
const override;
69 std::string
Format()
override {
return "bdb_ro"; }
72 std::unique_ptr<DatabaseBatch>
MakeBatch(
bool flush_on_close =
true)
override;
Double ended buffer combining vector and stream-like interfaces.
Path class wrapper to block calls to the fs::path(std::string) implicit constructor and the fs::path:...
RAII class that provides access to a BerkeleyRODatabase.
BerkeleyROBatch(const BerkeleyROBatch &)=delete
bool ReadKey(DataStream &&key, DataStream &value) override
bool ErasePrefix(Span< const std::byte > prefix) override
bool WriteKey(DataStream &&key, DataStream &&value, bool overwrite=true) override
BerkeleyROBatch(const BerkeleyRODatabase &database)
bool HasActiveTxn() override
BerkeleyROBatch & operator=(const BerkeleyROBatch &)=delete
bool TxnCommit() override
~BerkeleyROBatch()=default
std::unique_ptr< DatabaseCursor > GetNewPrefixCursor(Span< const std::byte > prefix) override
const BerkeleyRODatabase & m_database
std::unique_ptr< DatabaseCursor > GetNewCursor() override
bool EraseKey(DataStream &&key) override
bool HasKey(DataStream &&key) override
BerkeleyROData::const_iterator m_cursor_end
~BerkeleyROCursor()=default
BerkeleyROCursor(const BerkeleyRODatabase &database, Span< const std::byte > prefix={})
BerkeleyROData::const_iterator m_cursor
const BerkeleyRODatabase & m_database
Status Next(DataStream &key, DataStream &value) override
A class representing a BerkeleyDB file from which we can only read records.
void AddRef() override
Indicate the a new database user has began using the database.
void Close() override
Flush to the database file and close the database.
void Flush() override
Make sure all changes are flushed to database file.
void Open() override
Open the database if it is not already opened.
~BerkeleyRODatabase()=default
bool Rewrite(const char *pszSkip=nullptr) override
Rewrite the entire database on disk, with the exception of key pszSkip if non-zero.
const fs::path m_filepath
std::string Format() override
bool PeriodicFlush() override
std::unique_ptr< DatabaseBatch > MakeBatch(bool flush_on_close=true) override
Make a DatabaseBatch connected to this database.
void RemoveRef() override
Indicate that database user has stopped using the database and that it could be flushed or closed.
void IncrementUpdateCounter() override
void ReloadDbEnv() override
std::string Filename() override
Return path to main database file for logs and error messages.
bool Backup(const std::string &strDest) const override
Back up the entire database to a file.
BerkeleyRODatabase(const fs::path &filepath, bool open=true)
Create DB handle.
RAII class that provides access to a WalletDatabase.
An instance of this class represents one database.
static std::string PathToString(const path &path)
Convert path object to a byte string.
std::map< SerializeData, SerializeData, std::less<> > BerkeleyROData
std::unique_ptr< BerkeleyRODatabase > MakeBerkeleyRODatabase(const fs::path &path, const DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error)
Return object giving access to Berkeley Read Only database at specified path.