blob: 82babe0ecd4dbb303164537f96bdcee84d7f2415 (
plain) (
tree)
|
|
#ifndef LIBRARY_HPP
#define LIBRARY_HPP
#include "mapdump.hpp"
#include <filesystem>
#include <string>
#include <vector>
struct sqlite3;
class map_library
{
public:
map_library();
~map_library();
std::vector<int> map_ids() const;
bool has_map(int id) const;
void set_map(const map_t &map);
map_t get_map(int id) const;
std::vector<int64_t> groups() const;
int64_t new_group(const map_group_t &g);
bool has_group(int64_t gid) const;
void set_group(int64_t gid, const map_group_t &g);
map_group_t get_group(int64_t gid);
void remove_group(int64_t gid) const;
void tally_diff(const std::vector<int> &tally,
std::vector<int> &a_b,
std::vector<int> &b_a) const;
bool open_db(const std::filesystem::path &p);
private:
void init_db();
bool verify_db();
sqlite3 *db;
};
#endif
|