-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#include "devnulladapter.hpp" | ||
|
||
using namespace Bidstack::Cache; | ||
|
||
DevNullAdapter::DevNullAdapter(QObject *parent) : AbstractAdapter(parent) { | ||
|
||
} | ||
|
||
bool DevNullAdapter::store(QString key, QString data) { | ||
Q_UNUSED(key); | ||
Q_UNUSED(data); | ||
return true; | ||
} | ||
|
||
bool DevNullAdapter::has(QString key) { | ||
Q_UNUSED(key); | ||
return false; | ||
} | ||
|
||
bool DevNullAdapter::remove(QString key) { | ||
Q_UNUSED(key); | ||
return true; | ||
} | ||
|
||
bool DevNullAdapter::clear() { | ||
return true; | ||
} | ||
|
||
QString DevNullAdapter::fetch(QString key) { | ||
Q_UNUSED(key); | ||
return ""; | ||
} | ||
|
||
QString DevNullAdapter::fetch(QString key, QString defaultValue) { | ||
Q_UNUSED(key); | ||
Q_UNUSED(defaultValue); | ||
return defaultValue; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#ifndef BIDSTACK_CACHE_DEVNULLADAPTER_HPP | ||
#define BIDSTACK_CACHE_DEVNULLADAPTER_HPP | ||
|
||
#include <QObject> | ||
|
||
#include "abstractadapter.hpp" | ||
|
||
namespace Bidstack { | ||
namespace Cache { | ||
|
||
class DevNullAdapter : public AbstractAdapter { | ||
Q_OBJECT | ||
|
||
public: | ||
DevNullAdapter(QObject *parent = 0); | ||
|
||
public: | ||
bool store(QString key, QString data); | ||
bool has(QString key); | ||
bool remove(QString key); | ||
bool clear(); | ||
QString fetch(QString key); | ||
QString fetch(QString key, QString defaultValue); | ||
}; | ||
|
||
}; | ||
}; | ||
|
||
#endif |