Mercurial > dedupe
comparison SqliteDBLink.hpp @ 2:2833b7f8884a
Sql backend is working.
Need to get more speed on comparisson.
| author | Tom Fredrik Blenning Klaussen <bfg@blenning.no> |
|---|---|
| date | Tue, 21 Aug 2012 14:25:33 +0200 |
| parents | |
| children | 5e4985407feb |
comparison
equal
deleted
inserted
replaced
| 1:aae83c0a771d | 2:2833b7f8884a |
|---|---|
| 1 #ifndef SQLITEDBLINK_HPP | |
| 2 #define SQLITEDBLINK_HPP | |
| 3 #include "FileDBLink.hpp" | |
| 4 | |
| 5 #include <QtCore/QMap> | |
| 6 #include <QtCore/QSharedPointer> | |
| 7 | |
| 8 #include <QtSql/QSqlDatabase> | |
| 9 | |
| 10 class SqliteDBLink : public FileDBLink { | |
| 11 public: | |
| 12 SqliteDBLink(const QString& dbpath); | |
| 13 ~SqliteDBLink(); | |
| 14 | |
| 15 virtual void addFile(const QString& path, qint64 size, const QDateTime& dtime, const QByteArray& hash); | |
| 16 virtual void updateFile(const QString& path, qint64 size, const QDateTime& dtime, const QByteArray& hash); | |
| 17 bool exists(const QString& path); | |
| 18 DBStatus existsWithMtime(const QString& path, const QDateTime& mtime); | |
| 19 | |
| 20 QStringList toStringList(); | |
| 21 const QList<QSharedPointer<DBInfo> > values(const QString& prefix = QString() ) const; | |
| 22 | |
| 23 private: | |
| 24 void addFile(const DBInfo& info); | |
| 25 bool tryAddFile(const DBInfo& info); | |
| 26 void updateFile(const DBInfo& dbinfo); | |
| 27 | |
| 28 QSqlDatabase db; | |
| 29 }; | |
| 30 | |
| 31 #endif //MEMORYDBLINK_HPP |
