Mercurial > dedupe
comparison MemoryDbLink.hpp @ 0:a3834af36579
Working with memory backend.
| author | Tom Fredrik Blenning Klaussen <bfg@blenning.no> |
|---|---|
| date | Mon, 20 Aug 2012 15:49:48 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:a3834af36579 |
|---|---|
| 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 |
