GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
CacheManager.h
1 
29 #pragma once
30 
31 #include "core/function/basic/GpgFunctionObject.h"
32 
33 namespace GpgFrontend {
34 
35 class GPGFRONTEND_CORE_EXPORT CacheManager
36  : public SingletonFunctionObject<CacheManager> {
37  public:
43  explicit CacheManager(
45 
50  ~CacheManager() override;
51 
58  void SaveCache(const QString& key, QString value);
59 
67  void SaveDurableCache(const QString& key, const QJsonDocument& value,
68  bool flush = false);
69 
76  auto LoadCache(const QString& key) -> QString;
77 
84  auto LoadDurableCache(const QString& key) -> QJsonDocument;
85 
93  auto LoadDurableCache(const QString& key, QJsonDocument default_value)
94  -> QJsonDocument;
95 
102  void ResetCache(const QString& key);
103 
111  auto ResetDurableCache(const QString& key) -> bool;
112 
113  private:
114  class Impl;
115  SecureUniquePtr<Impl> p_;
116 };
117 
118 } // namespace GpgFrontend
Definition: CacheManager.cpp:93
Definition: CacheManager.h:36
Definition: GpgFunctionObject.h:57
static auto GetDefaultChannel() -> int
Get the Default Channel object.
Definition: GpgFunctionObject.h:130
Definition: app.cpp:39