]> git.sesse.net Git - nageru/blob - db.h
Serialize state to disk between runs, using SQLite.
[nageru] / db.h
1 #ifndef DB_H
2 #define DB_H 1
3
4 #include "state.pb.h"
5 #include <sqlite3.h>
6
7 class DB {
8 public:
9         explicit DB(const char *filename);
10         DB(const DB &) = delete;
11
12         StateProto get_state();
13         void store_state(const StateProto &state);
14
15 private:
16         StateProto state;
17         sqlite3 *db;
18 };
19
20 #endif  // !defined(DB_H)