Mercurial > dedupe
comparison MemoryDBLink.hpp @ 1:aae83c0a771d
Refactor:
-Rename all Db to DB.
Add setup script
Add support for Sqlite3 in configuration.
| author | Tom Fredrik Blenning Klaussen <bfg@blenning.no> |
|---|---|
| date | Mon, 20 Aug 2012 17:32:58 +0200 |
| parents | MemoryDbLink.hpp@a3834af36579 |
| children | d6fdca3bf24e |
comparison
equal
deleted
inserted
replaced
| 0:a3834af36579 | 1:aae83c0a771d |
|---|---|
| 1 #ifndef MEMORYDBLINK_HPP | |
| 2 #define MEMORYDBLINK_HPP | |
| 3 #include "FileDBLink.hpp" | |
| 4 | |
| 5 #include <QtCore/QMap> | |
| 6 #include <QtCore/QSharedPointer> | |
| 7 | |
| 8 class MemoryDBLink : public FileDBLink { | |
| 9 public: | |
| 10 virtual void addFile(const QString& path, qint64 size, const QDateTime& dtime, const QCryptographicHash& hash); | |
| 11 bool exists(const QString& path) | |
| 12 { | |
| 13 return (entries.contains(path)); | |
| 14 } | |
| 15 | |
| 16 QStringList toStringList(); | |
| 17 const QList<QSharedPointer<DBInfo> > values() const; | |
| 18 | |
| 19 private: | |
| 20 void addFile(const DBInfo& info); | |
| 21 bool tryAddFile(const DBInfo& info); | |
| 22 QMap<QString, QSharedPointer<DBInfo> > entries; | |
| 23 }; | |
| 24 | |
| 25 #endif //MEMORYDBLINK_HPP |
