#include <database-sqlite3.h>
Public Member Functions | |
ModStorageDatabaseSQLite3 (const std::string &savedir) | |
virtual | ~ModStorageDatabaseSQLite3 () |
virtual void | getModEntries (const std::string &modname, StringMap *storage) |
virtual void | getModKeys (const std::string &modname, std::vector< std::string > *storage) |
virtual bool | getModEntry (const std::string &modname, const std::string &key, std::string *value) |
virtual bool | hasModEntry (const std::string &modname, const std::string &key) |
virtual bool | setModEntry (const std::string &modname, const std::string &key, std::string_view value) |
virtual bool | removeModEntry (const std::string &modname, const std::string &key) |
virtual bool | removeModEntries (const std::string &modname) |
virtual void | listMods (std::vector< std::string > *res) |
virtual void | beginSave () |
virtual void | endSave () |
Public Member Functions inherited from ModStorageDatabase | |
virtual | ~ModStorageDatabase ()=default |
virtual void | getModEntries (const std::string &modname, StringMap *storage)=0 |
virtual void | getModKeys (const std::string &modname, std::vector< std::string > *storage)=0 |
virtual bool | hasModEntry (const std::string &modname, const std::string &key)=0 |
virtual bool | getModEntry (const std::string &modname, const std::string &key, std::string *value)=0 |
virtual bool | setModEntry (const std::string &modname, const std::string &key, std::string_view value)=0 |
virtual bool | removeModEntry (const std::string &modname, const std::string &key)=0 |
virtual bool | removeModEntries (const std::string &modname)=0 |
virtual void | listMods (std::vector< std::string > *res)=0 |
virtual void | beginSave ()=0 |
virtual void | endSave ()=0 |
virtual bool | initialized () const |
Protected Member Functions | |
virtual void | createDatabase () |
virtual void | initStatements () |
Private Attributes | |
sqlite3_stmt * | m_stmt_get_all = nullptr |
sqlite3_stmt * | m_stmt_get_keys = nullptr |
sqlite3_stmt * | m_stmt_get = nullptr |
sqlite3_stmt * | m_stmt_has = nullptr |
sqlite3_stmt * | m_stmt_set = nullptr |
sqlite3_stmt * | m_stmt_remove = nullptr |
sqlite3_stmt * | m_stmt_remove_all = nullptr |
Private Attributes inherited from Database_SQLite3 | |
sqlite3 * | m_database = nullptr |
Additional Inherited Members | |
Private Member Functions inherited from Database_SQLite3 | |
virtual | ~Database_SQLite3 () |
void | beginSave () |
void | endSave () |
bool | initialized () const |
Database_SQLite3 (const std::string &savedir, const std::string &dbname) | |
void | verifyDatabase () |
void | str_to_sqlite (sqlite3_stmt *s, int iCol, std::string_view str) const |
void | int_to_sqlite (sqlite3_stmt *s, int iCol, int val) const |
void | int64_to_sqlite (sqlite3_stmt *s, int iCol, s64 val) const |
void | double_to_sqlite (sqlite3_stmt *s, int iCol, double val) const |
std::string_view | sqlite_to_string_view (sqlite3_stmt *s, int iCol) |
std::string | sqlite_to_string (sqlite3_stmt *s, int iCol) |
std::string_view | sqlite_to_blob (sqlite3_stmt *s, int iCol) |
s32 | sqlite_to_int (sqlite3_stmt *s, int iCol) |
u32 | sqlite_to_uint (sqlite3_stmt *s, int iCol) |
s64 | sqlite_to_int64 (sqlite3_stmt *s, int iCol) |
u64 | sqlite_to_uint64 (sqlite3_stmt *s, int iCol) |
float | sqlite_to_float (sqlite3_stmt *s, int iCol) |
const v3f | sqlite_to_v3f (sqlite3_stmt *s, int iCol) |
void | sqlite3_vrfy (int s, std::string_view m="", int r=SQLITE_OK) const |
void | sqlite3_vrfy (const int s, const int r, std::string_view m="") const |
virtual void | createDatabase ()=0 |
virtual void | initStatements ()=0 |
virtual void | beginSave ()=0 |
virtual void | endSave ()=0 |
virtual bool | initialized () const |
ModStorageDatabaseSQLite3::ModStorageDatabaseSQLite3 | ( | const std::string & | savedir | ) |
|
virtual |
References FINALIZE_STATEMENT, m_stmt_get, m_stmt_get_all, m_stmt_get_keys, m_stmt_has, m_stmt_remove, m_stmt_remove_all, and m_stmt_set.
|
inlinevirtual |
Reimplemented from Database_SQLite3.
References Database_SQLite3::beginSave().
|
protectedvirtual |
Implements Database_SQLite3.
References Database_SQLite3::m_database, and SQLOK.
|
inlinevirtual |
Reimplemented from Database_SQLite3.
References Database_SQLite3::endSave().
|
virtual |
Implements ModStorageDatabase.
References Database_SQLite3::m_database, m_stmt_get_all, Database_SQLite3::sqlite3_vrfy(), Database_SQLite3::sqlite_to_blob(), Database_SQLite3::str_to_sqlite(), and Database_SQLite3::verifyDatabase().
|
virtual |
Implements ModStorageDatabase.
References m_stmt_get, Database_SQLite3::sqlite_to_blob(), SQLOK, Database_SQLite3::str_to_sqlite(), TOSTRING, and Database_SQLite3::verifyDatabase().
|
virtual |
Implements ModStorageDatabase.
References Database_SQLite3::m_database, m_stmt_get_keys, Database_SQLite3::sqlite3_vrfy(), Database_SQLite3::sqlite_to_blob(), Database_SQLite3::str_to_sqlite(), and Database_SQLite3::verifyDatabase().
|
virtual |
Implements ModStorageDatabase.
References m_stmt_has, SQLOK, Database_SQLite3::str_to_sqlite(), TOSTRING, and Database_SQLite3::verifyDatabase().
|
protectedvirtual |
Implements Database_SQLite3.
References PREPARE_STATEMENT, and remove().
|
virtual |
Implements ModStorageDatabase.
References Database_SQLite3::m_database, and Database_SQLite3::verifyDatabase().
|
virtual |
Implements ModStorageDatabase.
References Database_SQLite3::m_database, m_stmt_remove_all, Database_SQLite3::sqlite3_vrfy(), Database_SQLite3::str_to_sqlite(), and Database_SQLite3::verifyDatabase().
|
virtual |
Implements ModStorageDatabase.
References Database_SQLite3::m_database, m_stmt_remove, Database_SQLite3::sqlite3_vrfy(), SQLOK, Database_SQLite3::str_to_sqlite(), TOSTRING, and Database_SQLite3::verifyDatabase().
|
virtual |
Implements ModStorageDatabase.
References m_stmt_set, SQLOK, SQLRES, Database_SQLite3::str_to_sqlite(), TOSTRING, and Database_SQLite3::verifyDatabase().
|
private |
Referenced by ~ModStorageDatabaseSQLite3(), and getModEntry().
|
private |
Referenced by ~ModStorageDatabaseSQLite3(), and getModEntries().
|
private |
Referenced by ~ModStorageDatabaseSQLite3(), and getModKeys().
|
private |
Referenced by ~ModStorageDatabaseSQLite3(), and hasModEntry().
|
private |
Referenced by ~ModStorageDatabaseSQLite3(), and removeModEntry().
|
private |
Referenced by ~ModStorageDatabaseSQLite3(), and removeModEntries().
|
private |
Referenced by ~ModStorageDatabaseSQLite3(), and setModEntry().