diff options
Diffstat (limited to 'Source/cmCacheManager.h')
-rw-r--r-- | Source/cmCacheManager.h | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 7a9a7dc..bc3fb51 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -11,9 +11,9 @@ #include <utility> #include <vector> -#include "cmProperty.h" #include "cmPropertyMap.h" #include "cmStateTypes.h" +#include "cmValue.h" class cmMessenger; @@ -31,13 +31,13 @@ class cmCacheManager public: const std::string& GetValue() const { return this->Value; } - void SetValue(const char*); + void SetValue(cmValue); cmStateEnums::CacheEntryType GetType() const { return this->Type; } void SetType(cmStateEnums::CacheEntryType ty) { this->Type = ty; } std::vector<std::string> GetPropertyList() const; - cmProp GetProperty(const std::string& property) const; + cmValue GetProperty(const std::string& property) const; bool GetPropertyAsBool(const std::string& property) const; void SetProperty(const std::string& property, const char* value); void SetProperty(const std::string& property, bool value); @@ -70,12 +70,12 @@ public: bool IsCacheLoaded() const { return this->CacheLoaded; } //! Get a value from the cache given a key - cmProp GetInitializedCacheValue(const std::string& key) const; + cmValue GetInitializedCacheValue(const std::string& key) const; - cmProp GetCacheEntryValue(const std::string& key) const + cmValue GetCacheEntryValue(const std::string& key) const { if (const auto* entry = this->GetCacheEntry(key)) { - return &entry->GetValue(); + return cmValue(entry->GetValue()); } return nullptr; } @@ -83,7 +83,7 @@ public: void SetCacheEntryValue(std::string const& key, std::string const& value) { if (auto* entry = this->GetCacheEntry(key)) { - entry->SetValue(value.c_str()); + entry->SetValue(cmValue(value)); } } @@ -104,8 +104,8 @@ public: return {}; } - cmProp GetCacheEntryProperty(std::string const& key, - std::string const& propName) const + cmValue GetCacheEntryProperty(std::string const& key, + std::string const& propName) const { if (const auto* entry = this->GetCacheEntry(key)) { return entry->GetProperty(propName); @@ -173,6 +173,18 @@ public: //! Add an entry into the cache void AddCacheEntry(const std::string& key, const char* value, + const char* helpString, cmStateEnums::CacheEntryType type) + { + this->AddCacheEntry(key, + value ? cmValue(std::string(value)) : cmValue(nullptr), + helpString, type); + } + void AddCacheEntry(const std::string& key, const std::string& value, + const char* helpString, cmStateEnums::CacheEntryType type) + { + this->AddCacheEntry(key, cmValue(value), helpString, type); + } + void AddCacheEntry(const std::string& key, cmValue value, const char* helpString, cmStateEnums::CacheEntryType type); |