X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=db.h;h=f8032c0e43d3502360fc74346de0ea87684a26f5;hb=ce2e0615420b706e1ff2405fffcedfba37a9adac;hp=13a7e510535fc0cdb2421cc7ce011d5ef982fe73;hpb=fba9223dd99865e3cb90dc353f928ac3da3ac81e;p=nageru diff --git a/db.h b/db.h index 13a7e51..f8032c0 100644 --- a/db.h +++ b/db.h @@ -4,15 +4,27 @@ #include "state.pb.h" #include +#include +#include + +#include "frame_on_disk.h" class DB { public: - explicit DB(const char *filename); + explicit DB(const std::string &filename); DB(const DB &) = delete; StateProto get_state(); void store_state(const StateProto &state); + struct FrameOnDiskAndStreamIdx { + FrameOnDisk frame; + unsigned stream_idx; + }; + std::vector load_frame_file(const std::string &filename, size_t size, unsigned frame_idx); // Empty = none found, or there were no frames. + void store_frame_file(const std::string &filename, size_t size, const std::vector &frames); + void clean_unused_frame_files(const std::vector &used_filenames); + private: StateProto state; sqlite3 *db;