Mercurial > dedupe
comparison FileDBLink.hpp @ 86:af7962f3274b
Use quint64 for sizes, rather than qint64.
| author | Tom Fredrik Blenning Klaussen <bfg@bfgconsult.no> |
|---|---|
| date | Thu, 10 Oct 2013 16:07:35 +0200 |
| parents | 1f9e27a0bd7f |
| children | f49023c61dac |
comparison
equal
deleted
inserted
replaced
| 85:1f9e27a0bd7f | 86:af7962f3274b |
|---|---|
| 7 | 7 |
| 8 class FileDBLink { | 8 class FileDBLink { |
| 9 public: | 9 public: |
| 10 class DBInfo { | 10 class DBInfo { |
| 11 public: | 11 public: |
| 12 DBInfo(const QString& path, qint64 size, | 12 DBInfo(const QString& path, quint64 size, |
| 13 const QDateTime& mtime, const QByteArray& hash) : path_(path), | 13 const QDateTime& mtime, const QByteArray& hash) : path_(path), |
| 14 size_(size), | 14 size_(size), |
| 15 mtime_(mtime), | 15 mtime_(mtime), |
| 16 hash_(hash) | 16 hash_(hash) |
| 17 {} | 17 {} |
| 55 return str; | 55 return str; |
| 56 } | 56 } |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 QString path_; | 59 QString path_; |
| 60 qint64 size_; | 60 quint64 size_; |
| 61 QDateTime mtime_; | 61 QDateTime mtime_; |
| 62 QByteArray hash_; | 62 QByteArray hash_; |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 class ExtendedDBInfo : public DBInfo { | 65 class ExtendedDBInfo : public DBInfo { |
| 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, qint64 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) = 0; |
| 120 virtual void keepOnlyFromPrefix(const QString& prefix, | 120 virtual void keepOnlyFromPrefix(const QString& prefix, |
| 121 const QStringList& files) = 0; | 121 const QStringList& files) = 0; |
| 122 virtual void deleteFileFromDB(const QString& path) = 0; | 122 virtual void deleteFileFromDB(const QString& path) = 0; |
| 123 | 123 |
| 124 virtual const QList<dbinf_ptr_t> filesWithSize(qint64 size, const QString& prefix = QString()) const; | 124 virtual const QList<dbinf_ptr_t> filesWithSize(quint64 size, const QString& prefix = QString()) const; |
| 125 | 125 |
| 126 bool updateAllWithSize(qint64 size); | 126 bool updateAllWithSize(quint64 size); |
| 127 | 127 |
| 128 virtual dbinf_ptr_t value(const QString& path) const; | 128 virtual dbinf_ptr_t value(const QString& path) const; |
| 129 | 129 |
| 130 void addFile(const QString& path, qint64 size, const QDateTime& dtime, bool lazy = false); | 130 void addFile(const QString& path, quint64 size, const QDateTime& dtime, bool lazy = false); |
| 131 void addFile(const QFileInfo& fileinfo, bool lazy = false); | 131 void addFile(const QFileInfo& fileinfo, bool lazy = false); |
| 132 | 132 |
| 133 virtual void updateFile(const QString& path, qint64 size, | 133 virtual void updateFile(const QString& path, quint64 size, |
| 134 const QDateTime& dtime, const QByteArray& hash) = 0; | 134 const QDateTime& dtime, const QByteArray& hash) = 0; |
| 135 void updateFile(const QString& path, qint64 size, const QDateTime& dtime, bool lazy = false); | 135 void updateFile(const QString& path, quint64 size, const QDateTime& dtime, bool lazy = false); |
| 136 void updateFile(const QFileInfo& fileinfo, bool lazy = false); | 136 void updateFile(const QFileInfo& fileinfo, bool lazy = false); |
| 137 | 137 |
| 138 virtual bool exists(const QString& path) = 0; | 138 virtual bool exists(const QString& path) = 0; |
| 139 virtual DBStatus existsWithMtime(const QString& path, | 139 virtual DBStatus existsWithMtime(const QString& path, |
| 140 const QDateTime& mtime) = 0; | 140 const QDateTime& mtime) = 0; |
