diff options
author | 2022-09-16 12:06:12 -0400 | |
---|---|---|
committer | 2022-09-16 12:06:12 -0400 | |
commit | 62bb6fcd83c2ee6bfd058c2e2f925b9946d185a1 (patch) | |
tree | 25d975e07bf0a570a9cb87fd4ef180873e1fc1bc /signature_db.hpp | |
parent | e93e4ed25011c1e1abaf3049e90e4c2a2c6184ec (diff) | |
download | deduper-62bb6fcd83c2ee6bfd058c2e2f925b9946d185a1.tar.xz |
Add versioning and support for loading on disk db.
Diffstat (limited to 'signature_db.hpp')
-rw-r--r-- | signature_db.hpp | 13 |
1 files changed, 12 insertions, 1 deletions
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); |