comparison 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
comparison
equal deleted inserted replaced
84:848496a57039 85:1f9e27a0bd7f
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); 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, qint64 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 void addFile(const QString& path, qint64 size, const QDateTime& dtime); 124 virtual const QList<dbinf_ptr_t> filesWithSize(qint64 size, const QString& prefix = QString()) const;
125 void addFile(const QFileInfo& fileinfo); 125
126 bool updateAllWithSize(qint64 size);
127
128 virtual dbinf_ptr_t value(const QString& path) const;
129
130 void addFile(const QString& path, qint64 size, const QDateTime& dtime, bool lazy = false);
131 void addFile(const QFileInfo& fileinfo, bool lazy = false);
126 132
127 virtual void updateFile(const QString& path, qint64 size, 133 virtual void updateFile(const QString& path, qint64 size,
128 const QDateTime& dtime, const QByteArray& hash) = 0; 134 const QDateTime& dtime, const QByteArray& hash) = 0;
129 void updateFile(const QString& path, qint64 size, const QDateTime& dtime); 135 void updateFile(const QString& path, qint64 size, const QDateTime& dtime, bool lazy = false);
130 void updateFile(const QFileInfo& fileinfo); 136 void updateFile(const QFileInfo& fileinfo, bool lazy = false);
131 137
132 virtual bool exists(const QString& path) = 0; 138 virtual bool exists(const QString& path) = 0;
133 virtual DBStatus existsWithMtime(const QString& path, 139 virtual DBStatus existsWithMtime(const QString& path,
134 const QDateTime& mtime) = 0; 140 const QDateTime& mtime) = 0;
135 141