X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=db.h;h=f8032c0e43d3502360fc74346de0ea87684a26f5;hb=ce2e0615420b706e1ff2405fffcedfba37a9adac;hp=826ab3f9c30152b701dedf8a0cf2995a792a76fb;hpb=58b5adcca3af1abbf4c69b00853bee037bb7fec7;p=nageru diff --git a/db.h b/db.h index 826ab3f..f8032c0 100644 --- a/db.h +++ b/db.h @@ -2,16 +2,29 @@ #define DB_H 1 #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;