-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsqlitecacheadapter.hpp
More file actions
41 lines (31 loc) · 951 Bytes
/
sqlitecacheadapter.hpp
File metadata and controls
41 lines (31 loc) · 951 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef BIDSTACK_CACHE_SQLITECACHEADAPTER_HPP
#define BIDSTACK_CACHE_SQLITECACHEADAPTER_HPP
#include <QObject>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlError>
#include <QDebug>
#include "abstractcacheadapter.hpp"
namespace Bidstack {
namespace Cache {
class SqliteCacheAdapter : public AbstractCacheAdapter {
Q_OBJECT
public:
SqliteCacheAdapter(QString filename, QObject *parent = 0);
public:
bool store(QString key, QString data);
bool store(QString key, QString data, int ttl);
bool has(QString key);
bool remove(QString key);
bool clear();
QString fetch(QString key);
QString fetch(QString key, QString defaultValue);
private:
bool init(QString filename);
uint now();
private:
QSqlDatabase m_connection;
};
};
};
#endif