aboutsummaryrefslogtreecommitdiff
path: root/qdeduper/sigdb_qt.hpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2022-09-19 12:40:21 -0400
committerGravatar Chris Xiong <chirs241097@gmail.com> 2022-09-19 12:40:21 -0400
commitbbe461a515ff55cd6733ec0392b0a4f664499ecf (patch)
tree08b83459e0074c0b988cbba8b1bf6bd38c972b85 /qdeduper/sigdb_qt.hpp
parent8ec24c0ac9a0c699721c50a70630c91cc36b1c30 (diff)
downloaddeduper-bbe461a515ff55cd6733ec0392b0a4f664499ecf.tar.xz
Implement database save & load.
Diffstat (limited to 'qdeduper/sigdb_qt.hpp')
-rw-r--r--qdeduper/sigdb_qt.hpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/qdeduper/sigdb_qt.hpp b/qdeduper/sigdb_qt.hpp
index 8a5178a..070662d 100644
--- a/qdeduper/sigdb_qt.hpp
+++ b/qdeduper/sigdb_qt.hpp
@@ -22,18 +22,25 @@ private:
std::unordered_map<fs::path, size_t> frmap;
std::map<std::pair<size_t, size_t>, double> distmap;
std::vector<std::vector<size_t>> groups;
+
+ void create_priv_struct();
public:
SignatureDB();
- SignatureDB(const fs::path& dbpath);
+ SignatureDB(const fs::path &dbpath);
~SignatureDB();
+ bool valid();
+
void scan_files(const std::vector<fs::path> &files, int njobs);
size_t num_groups();
std::vector<size_t> get_group(size_t gid);
std::map<std::pair<size_t, size_t>, double> group_distances(size_t gid);
fs::path get_image_path(size_t id);
- size_t get_path_id(const fs::path& p);
+ size_t get_path_id(const fs::path &p);
+
+ bool load(const fs::path &p);
+ bool save(const fs::path &p);
Q_SIGNALS:
void image_scanned(size_t n);
};