LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
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 
14 class QByteArray;
15 
22 {
23 public:
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 
64 using IPersistentStorage_ptr = std::shared_ptr<IPersistentStorage>;
65 
79 {
80 public:
82 
89 };
90 
91 Q_DECLARE_INTERFACE (IPersistentStorage, "org.LeechCraft.IPersistentStorage/1.0")
92 Q_DECLARE_INTERFACE (IPersistentStoragePlugin, "org.LeechCraft.IPersistentStoragePlugin/1.0")
IPersistentStoragePlugin::RequestStorage
virtual IPersistentStorage_ptr RequestStorage()=0
Request an proxy handle to the storage.
IPersistentStoragePlugin::~IPersistentStoragePlugin
virtual ~IPersistentStoragePlugin()
Definition: ipersistentstorageplugin.h:81
IPersistentStorage::~IPersistentStorage
virtual ~IPersistentStorage()
Closes this storage handle.
Definition: ipersistentstorageplugin.h:26
IPersistentStoragePlugin
Interface for plugins providing persistent (and possibly secure) storage.
Definition: ipersistentstorageplugin.h:78
IPersistentStorage::HasKey
virtual bool HasKey(const QByteArray &key)=0
Checks if the given key exists in the storage.
IPersistentStorage::Set
virtual void Set(const QByteArray &key, const QVariant &value)=0
Stores the value under the given key.
IPersistentStorage_ptr
std::shared_ptr< IPersistentStorage > IPersistentStorage_ptr
Definition: ipersistentstorageplugin.h:64
IPersistentStorage
Provides access to a storage in an IPersistentStoragePlugin.
Definition: ipersistentstorageplugin.h:21
IPersistentStorage::Get
virtual QVariant Get(const QByteArray &key)=0
Returns the value associated with the given key.