diff options
author | Saturn&Eric <[email protected]> | 2023-02-25 11:49:54 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2023-02-25 11:49:54 +0000 |
commit | af1cd680f2496629026ba27707cef2afd860f5f9 (patch) | |
tree | 78e78450893e98b8828cc41010e377c1561e5f34 /src/core/common/CoreCommonUtil.cpp | |
parent | fix: improve manual (diff) | |
parent | feat: use aqt to install qt in ci build (diff) | |
download | GpgFrontend-af1cd680f2496629026ba27707cef2afd860f5f9.tar.gz GpgFrontend-af1cd680f2496629026ba27707cef2afd860f5f9.zip |
Merge pull request #91 from saturneric/dev/2.0.10/main
Develop 2.1.0.1
Diffstat (limited to 'src/core/common/CoreCommonUtil.cpp')
-rw-r--r-- | src/core/common/CoreCommonUtil.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/core/common/CoreCommonUtil.cpp b/src/core/common/CoreCommonUtil.cpp index 3b2b4007..93cad60a 100644 --- a/src/core/common/CoreCommonUtil.cpp +++ b/src/core/common/CoreCommonUtil.cpp @@ -26,15 +26,33 @@ #include "CoreCommonUtil.h"
+#include <string>
+
namespace GpgFrontend {
std::unique_ptr<CoreCommonUtil> CoreCommonUtil::instance_ = nullptr; ///<
-CoreCommonUtil *CoreCommonUtil::GetInstance() {
- LOG(INFO) << "called";
+CoreCommonUtil* CoreCommonUtil::GetInstance() {
if (instance_ == nullptr) {
instance_ = std::make_unique<CoreCommonUtil>();
}
return instance_.get();
}
+
+void CoreCommonUtil::SetTempCacheValue(const std::string& key,
+ const std::string& value) {
+ temp_cache_[key] = value;
+}
+
+std::string CoreCommonUtil::GetTempCacheValue(const std::string& key) {
+ std::string temp_cache_value;
+ std::swap(temp_cache_value, temp_cache_[key]);
+ return temp_cache_value;
+}
+
+void CoreCommonUtil::ResetTempCacheValue(const std::string& key) {
+ std::string temp_cache_value;
+ std::swap(temp_cache_value, temp_cache_[key]);
+}
+
} // namespace GpgFrontend
|