geostat/ocdb.h

32 wiersze
594 B
C++

#pragma once
#include <string>
#include <nlohmann/json_fwd.hpp>
typedef struct sqlite3 sqlite3;
typedef struct sqlite3_stmt sqlite3_stmt;
class Okapi;
using json = nlohmann::json;
class OCdb {
private:
sqlite3* db;
sqlite3_stmt* stmt;
bool request(std::string req);
bool init_part(std::string json_file); // read db dump
bool parse_item(json j);
bool update_cache(json j);
bool update_log(json j);
bool read_revision();
public:
int revision;
OCdb(std::string db_file);
~OCdb();
bool init(std::string json_file); // read db dump
bool update(Okapi& oc); // apply changelog
};