Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
Database_LevelDB Class Reference

#include <database-leveldb.h>

+ Inheritance diagram for Database_LevelDB:
+ Collaboration diagram for Database_LevelDB:

Public Member Functions

 Database_LevelDB (const std::string &savedir)
 
 ~Database_LevelDB ()=default
 
bool saveBlock (const v3s16 &pos, std::string_view data)
 
void loadBlock (const v3s16 &pos, std::string *block)
 
bool deleteBlock (const v3s16 &pos)
 
void listAllLoadableBlocks (std::vector< v3s16 > &dst)
 
void beginSave ()
 
void endSave ()
 
- Public Member Functions inherited from MapDatabase
virtual ~MapDatabase ()=default
 
- Public Member Functions inherited from Database
virtual bool initialized () const
 

Private Attributes

std::unique_ptr< leveldb::DB > m_database
 

Additional Inherited Members

- Static Public Member Functions inherited from MapDatabase
static s64 getBlockAsInteger (const v3s16 &pos)
 
static v3s16 getIntegerAsBlock (s64 i)
 

Constructor & Destructor Documentation

◆ Database_LevelDB()

Database_LevelDB::Database_LevelDB ( const std::string & savedir)

◆ ~Database_LevelDB()

Database_LevelDB::~Database_LevelDB ( )
default

Member Function Documentation

◆ beginSave()

void Database_LevelDB::beginSave ( )
inlinevirtual

Implements Database.

◆ deleteBlock()

bool Database_LevelDB::deleteBlock ( const v3s16 & pos)
virtual

Implements MapDatabase.

References MapDatabase::getBlockAsInteger(), i64tos(), m_database, and warningstream.

+ Here is the call graph for this function:

◆ endSave()

void Database_LevelDB::endSave ( )
inlinevirtual

Implements Database.

◆ listAllLoadableBlocks()

void Database_LevelDB::listAllLoadableBlocks ( std::vector< v3s16 > & dst)
virtual

Implements MapDatabase.

References ENSURE_STATUS_OK, MapDatabase::getIntegerAsBlock(), m_database, and stoi64().

+ Here is the call graph for this function:

◆ loadBlock()

void Database_LevelDB::loadBlock ( const v3s16 & pos,
std::string * block )
virtual

Implements MapDatabase.

References MapDatabase::getBlockAsInteger(), i64tos(), and m_database.

+ Here is the call graph for this function:

◆ saveBlock()

bool Database_LevelDB::saveBlock ( const v3s16 & pos,
std::string_view data )
virtual

Implements MapDatabase.

References MapDatabase::getBlockAsInteger(), i64tos(), m_database, and warningstream.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_database

std::unique_ptr<leveldb::DB> Database_LevelDB::m_database
private

The documentation for this class was generated from the following files: