LeechCraft 0.6.70-17609-g3dde4097dd
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
ipersistentstorageplugin.h
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#pragma once
10
11#include <memory>
12#include <QtPlugin>
13
14class QByteArray;
15
22{
23public:
26 virtual ~IPersistentStorage () {}
27
36 virtual bool HasKey (const QByteArray& key) = 0;
37
51 virtual QVariant Get (const QByteArray& key) = 0;
52
61 virtual void Set (const QByteArray& key, const QVariant& value) = 0;
62};
63
64using IPersistentStorage_ptr = std::shared_ptr<IPersistentStorage>;
65
90
91Q_DECLARE_INTERFACE (IPersistentStorage, "org.LeechCraft.IPersistentStorage/1.0")
92Q_DECLARE_INTERFACE (IPersistentStoragePlugin, "org.LeechCraft.IPersistentStoragePlugin/1.0")
Provides access to a storage in an IPersistentStoragePlugin.
virtual bool HasKey(const QByteArray &key)=0
Checks if the given key exists in the storage.
virtual void Set(const QByteArray &key, const QVariant &value)=0
Stores the value under the given key.
virtual QVariant Get(const QByteArray &key)=0
Returns the value associated with the given key.
virtual ~IPersistentStorage()
Closes this storage handle.
Interface for plugins providing persistent (and possibly secure) storage.
virtual IPersistentStorage_ptr RequestStorage()=0
Request an proxy handle to the storage.
std::shared_ptr< IPersistentStorage > IPersistentStorage_ptr