#include <database-sqlite3.h>
Public Member Functions | |
AuthDatabaseSQLite3 (const std::string &savedir) | |
virtual | ~AuthDatabaseSQLite3 () |
virtual bool | getAuth (const std::string &name, AuthEntry &res) |
virtual bool | saveAuth (const AuthEntry &authEntry) |
virtual bool | createAuth (AuthEntry &authEntry) |
virtual bool | deleteAuth (const std::string &name) |
virtual void | listNames (std::vector< std::string > &res) |
virtual void | reload () |
Public Member Functions inherited from AuthDatabase | |
virtual | ~AuthDatabase ()=default |
Protected Member Functions | |
virtual void | createDatabase () |
virtual void | initStatements () |
Private Member Functions | |
virtual void | writePrivileges (const AuthEntry &authEntry) |
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 |
Private Attributes | |
sqlite3_stmt * | m_stmt_read = nullptr |
sqlite3_stmt * | m_stmt_write = nullptr |
sqlite3_stmt * | m_stmt_create = nullptr |
sqlite3_stmt * | m_stmt_delete = nullptr |
sqlite3_stmt * | m_stmt_list_names = nullptr |
sqlite3_stmt * | m_stmt_read_privs = nullptr |
sqlite3_stmt * | m_stmt_write_privs = nullptr |
sqlite3_stmt * | m_stmt_delete_privs = nullptr |
sqlite3_stmt * | m_stmt_last_insert_rowid = nullptr |
Private Attributes inherited from Database_SQLite3 | |
sqlite3 * | m_database = nullptr |
AuthDatabaseSQLite3::AuthDatabaseSQLite3 | ( | const std::string & | savedir | ) |
|
virtual |
|
virtual |
Implements AuthDatabase.
References Database_SQLite3::beginSave(), Database_SQLite3::endSave(), AuthEntry::id, Database_SQLite3::int64_to_sqlite(), AuthEntry::last_login, m_stmt_create, m_stmt_last_insert_rowid, AuthEntry::name, AuthEntry::password, Database_SQLite3::sqlite3_vrfy(), Database_SQLite3::sqlite_to_uint(), Database_SQLite3::str_to_sqlite(), and writePrivileges().
|
protectedvirtual |
Implements Database_SQLite3.
References Database_SQLite3::m_database, and SQLOK.
|
virtual |
Implements AuthDatabase.
References Database_SQLite3::m_database, m_stmt_delete, Database_SQLite3::sqlite3_vrfy(), Database_SQLite3::str_to_sqlite(), and Database_SQLite3::verifyDatabase().
|
virtual |
Implements AuthDatabase.
References AuthEntry::id, Database_SQLite3::int64_to_sqlite(), AuthEntry::last_login, m_stmt_read, m_stmt_read_privs, AuthEntry::name, AuthEntry::password, AuthEntry::privileges, Database_SQLite3::sqlite_to_int64(), Database_SQLite3::sqlite_to_string_view(), Database_SQLite3::sqlite_to_uint(), Database_SQLite3::str_to_sqlite(), and Database_SQLite3::verifyDatabase().
|
protectedvirtual |
Implements Database_SQLite3.
References PREPARE_STATEMENT.
|
virtual |
Implements AuthDatabase.
References m_stmt_list_names, Database_SQLite3::sqlite_to_string_view(), and Database_SQLite3::verifyDatabase().
|
virtual |
Implements AuthDatabase.
|
virtual |
Implements AuthDatabase.
References Database_SQLite3::beginSave(), Database_SQLite3::endSave(), AuthEntry::id, Database_SQLite3::int64_to_sqlite(), AuthEntry::last_login, m_stmt_write, AuthEntry::name, AuthEntry::password, Database_SQLite3::sqlite3_vrfy(), Database_SQLite3::str_to_sqlite(), and writePrivileges().
|
privatevirtual |
References AuthEntry::id, Database_SQLite3::int64_to_sqlite(), m_stmt_delete_privs, m_stmt_write_privs, AuthEntry::privileges, Database_SQLite3::sqlite3_vrfy(), and Database_SQLite3::str_to_sqlite().
Referenced by createAuth(), and saveAuth().
|
private |
Referenced by ~AuthDatabaseSQLite3(), and createAuth().
|
private |
Referenced by ~AuthDatabaseSQLite3(), and deleteAuth().
|
private |
Referenced by ~AuthDatabaseSQLite3(), and writePrivileges().
|
private |
Referenced by ~AuthDatabaseSQLite3(), and createAuth().
|
private |
Referenced by ~AuthDatabaseSQLite3(), and listNames().
|
private |
Referenced by ~AuthDatabaseSQLite3(), and getAuth().
|
private |
Referenced by ~AuthDatabaseSQLite3(), and getAuth().
|
private |
Referenced by ~AuthDatabaseSQLite3(), and saveAuth().
|
private |
Referenced by ~AuthDatabaseSQLite3(), and writePrivileges().