From 62bb6fcd83c2ee6bfd058c2e2f925b9946d185a1 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Fri, 16 Sep 2022 12:06:12 -0400 Subject: Add versioning and support for loading on disk db. --- signature_db.hpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'signature_db.hpp') diff --git a/signature_db.hpp b/signature_db.hpp index f7259bb..5b8f890 100644 --- a/signature_db.hpp +++ b/signature_db.hpp @@ -21,9 +21,20 @@ class signature_db private: signature_db_priv *p; public: - signature_db(); + //open a signature database + //if dbpath is an empty path (default), the database will reside in RAM + //and will be automatically initialized + //otherwise it opens the database specified by dbpath + //if the database specified by dbpath doesn't exist, it will be created + //and initialized + //if the database file exists but is not a valid signature database, it + //will be immediately closed and any subsequent calls to this signature db + //object will do nothing. The object will be marked invalid. + signature_db(const fs::path &dbpath = fs::path()); ~signature_db(); + bool valid(); + //insert image signature into database //id must be unique void put_signature(size_t id, const fs::path &path, const signature &sig); -- cgit v1.2.3