27 lines
489 B
C
27 lines
489 B
C
|
#pragma once
|
||
|
|
||
|
#include <filesystem>
|
||
|
#include <unordered_map>
|
||
|
|
||
|
#include "sqlite_base.h"
|
||
|
|
||
|
namespace Infra {
|
||
|
|
||
|
typedef std::unordered_map<std::string, std::string> kgm_ekey_db_t;
|
||
|
extern bool g_init_sqlite_ok;
|
||
|
|
||
|
class SQLite {
|
||
|
public:
|
||
|
explicit SQLite(const std::filesystem::path& db_path);
|
||
|
~SQLite();
|
||
|
|
||
|
[[nodiscard]] bool is_ok() const { return ok_; }
|
||
|
kgm_ekey_db_t dump_ekey(int& error);
|
||
|
|
||
|
private:
|
||
|
bool ok_ = false;
|
||
|
sqlite3* db_{nullptr};
|
||
|
};
|
||
|
|
||
|
} // namespace Infra
|