Mercurial > dedupe
diff FileDBLink.hpp @ 85:1f9e27a0bd7f
Allow for lazy calculation of checksums, ignore them, if only one file of given size.
| author | Tom Fredrik Blenning Klaussen <bfg@bfgconsult.no> |
|---|---|
| date | Thu, 10 Oct 2013 15:55:30 +0200 |
| parents | b9515dc35fe4 |
| children | af7962f3274b |
line wrap: on
line diff
--- a/FileDBLink.hpp Thu Oct 10 14:14:20 2013 +0200 +++ b/FileDBLink.hpp Thu Oct 10 15:55:30 2013 +0200 @@ -113,7 +113,7 @@ virtual ~FileDBLink() {} - void updateIfModified(const QString& path); + void updateIfModified(const QString& path, bool lazy = false); virtual void addFile(const QString& path, qint64 size, const QDateTime& dtime, const QByteArray& hash) = 0; @@ -121,13 +121,19 @@ const QStringList& files) = 0; virtual void deleteFileFromDB(const QString& path) = 0; - void addFile(const QString& path, qint64 size, const QDateTime& dtime); - void addFile(const QFileInfo& fileinfo); + virtual const QList<dbinf_ptr_t> filesWithSize(qint64 size, const QString& prefix = QString()) const; + + bool updateAllWithSize(qint64 size); + + virtual dbinf_ptr_t value(const QString& path) const; + + void addFile(const QString& path, qint64 size, const QDateTime& dtime, bool lazy = false); + void addFile(const QFileInfo& fileinfo, bool lazy = false); virtual void updateFile(const QString& path, qint64 size, const QDateTime& dtime, const QByteArray& hash) = 0; - void updateFile(const QString& path, qint64 size, const QDateTime& dtime); - void updateFile(const QFileInfo& fileinfo); + void updateFile(const QString& path, qint64 size, const QDateTime& dtime, bool lazy = false); + void updateFile(const QFileInfo& fileinfo, bool lazy = false); virtual bool exists(const QString& path) = 0; virtual DBStatus existsWithMtime(const QString& path,
