Mercurial > dedupe
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MemoryDBLink.hpp Mon Aug 20 17:32:58 2012 +0200 @@ -0,0 +1,25 @@ +#ifndef MEMORYDBLINK_HPP +#define MEMORYDBLINK_HPP +#include "FileDBLink.hpp" + +#include <QtCore/QMap> +#include <QtCore/QSharedPointer> + +class MemoryDBLink : public FileDBLink { +public: + virtual void addFile(const QString& path, qint64 size, const QDateTime& dtime, const QCryptographicHash& hash); + bool exists(const QString& path) + { + return (entries.contains(path)); + } + + QStringList toStringList(); + const QList<QSharedPointer<DBInfo> > values() const; + +private: + void addFile(const DBInfo& info); + bool tryAddFile(const DBInfo& info); + QMap<QString, QSharedPointer<DBInfo> > entries; +}; + +#endif //MEMORYDBLINK_HPP
