Mercurial > dedupe
comparison FileDBLink.hpp @ 92:f49023c61dac
Support for bulk insertion.
| author | Tom Fredrik Blenning Klaussen <bfg@bfgconsult.no> |
|---|---|
| date | Mon, 21 Oct 2013 20:03:39 +0200 |
| parents | af7962f3274b |
| children | 308a718812ba |
comparison
equal
deleted
inserted
replaced
| 91:a5788991ca9f | 92:f49023c61dac |
|---|---|
| 109 QCryptographicHash::Algorithm = QCryptographicHash::Sha1); | 109 QCryptographicHash::Algorithm = QCryptographicHash::Sha1); |
| 110 | 110 |
| 111 public: | 111 public: |
| 112 enum DBStatus { NONE = 0, MTIME_DIFFERENT, SAME}; | 112 enum DBStatus { NONE = 0, MTIME_DIFFERENT, SAME}; |
| 113 | 113 |
| 114 virtual ~FileDBLink() {} | 114 virtual ~FileDBLink(); |
| 115 | 115 |
| 116 void updateIfModified(const QString& path, bool lazy = false); | 116 void updateIfModified(const QString& path, bool lazy = false); |
| 117 | 117 |
| 118 virtual void addFile(const QString& path, quint64 size, | 118 virtual void addFile(const QString& path, quint64 size, |
| 119 const QDateTime& dtime, const QByteArray& hash) = 0; | 119 const QDateTime& dtime, const QByteArray& hash, |
| 120 bool lazy) = 0; | |
| 120 virtual void keepOnlyFromPrefix(const QString& prefix, | 121 virtual void keepOnlyFromPrefix(const QString& prefix, |
| 121 const QStringList& files) = 0; | 122 const QStringList& files) = 0; |
| 122 virtual void deleteFileFromDB(const QString& path) = 0; | 123 virtual void deleteFileFromDB(const QString& path) = 0; |
| 123 | 124 |
| 124 virtual const QList<dbinf_ptr_t> filesWithSize(quint64 size, const QString& prefix = QString()) const; | 125 virtual const QList<dbinf_ptr_t> filesWithSize(quint64 size, const QString& prefix = QString()) const; |
| 129 | 130 |
| 130 void addFile(const QString& path, quint64 size, const QDateTime& dtime, bool lazy = false); | 131 void addFile(const QString& path, quint64 size, const QDateTime& dtime, bool lazy = false); |
| 131 void addFile(const QFileInfo& fileinfo, bool lazy = false); | 132 void addFile(const QFileInfo& fileinfo, bool lazy = false); |
| 132 | 133 |
| 133 virtual void updateFile(const QString& path, quint64 size, | 134 virtual void updateFile(const QString& path, quint64 size, |
| 134 const QDateTime& dtime, const QByteArray& hash) = 0; | 135 const QDateTime& dtime, const QByteArray& hash, |
| 136 bool lazy = false) = 0; | |
| 135 void updateFile(const QString& path, quint64 size, const QDateTime& dtime, bool lazy = false); | 137 void updateFile(const QString& path, quint64 size, const QDateTime& dtime, bool lazy = false); |
| 136 void updateFile(const QFileInfo& fileinfo, bool lazy = false); | 138 void updateFile(const QFileInfo& fileinfo, bool lazy = false); |
| 137 | 139 |
| 138 virtual bool exists(const QString& path) = 0; | 140 virtual bool exists(const QString& path) = 0; |
| 139 virtual DBStatus existsWithMtime(const QString& path, | 141 virtual DBStatus existsWithMtime(const QString& path, |
| 140 const QDateTime& mtime) = 0; | 142 const QDateTime& mtime) = 0; |
| 141 | 143 |
| 144 virtual bool commit(); | |
| 142 virtual const QList<dbinf_ptr_t> | 145 virtual const QList<dbinf_ptr_t> |
| 143 values(const QString& prefix = QString() ) const = 0; | 146 values(const QString& prefix = QString() ) const = 0; |
| 144 | 147 |
| 145 virtual const QList<dbinf_ptr_t> | 148 virtual const QList<dbinf_ptr_t> |
| 146 computedValues(const QString& prefix = QString() ) const; | 149 computedValues(const QString& prefix = QString() ) const; |
