diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2021-09-02 15:52:37 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2021-09-10 13:45:51 (GMT) |
commit | 3c2e58eeb884adea8ee12462f7d471ab518a673f (patch) | |
tree | f8adf34b01f5364785d855a296f4f64686ef6cfb /Source/cmCacheManager.h | |
parent | c8991f17cf5bb07fc1b0d7fa68e9613fa8617900 (diff) | |
download | CMake-3c2e58eeb884adea8ee12462f7d471ab518a673f.zip CMake-3c2e58eeb884adea8ee12462f7d471ab518a673f.tar.gz CMake-3c2e58eeb884adea8ee12462f7d471ab518a673f.tar.bz2 |
AddCacheEntry accept cmProp or std::string
Diffstat (limited to 'Source/cmCacheManager.h')
-rw-r--r-- | Source/cmCacheManager.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 0238fb8..eca7150 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -31,7 +31,7 @@ class cmCacheManager public: const std::string& GetValue() const { return this->Value; } - void SetValue(const char*); + void SetValue(cmProp); cmStateEnums::CacheEntryType GetType() const { return this->Type; } void SetType(cmStateEnums::CacheEntryType ty) { this->Type = ty; } @@ -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(cmProp(value)); } } @@ -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 ? cmProp(std::string(value)) : cmProp(nullptr), + helpString, type); + } + void AddCacheEntry(const std::string& key, const std::string& value, + const char* helpString, cmStateEnums::CacheEntryType type) + { + this->AddCacheEntry(key, cmProp(value), helpString, type); + } + void AddCacheEntry(const std::string& key, cmProp value, const char* helpString, cmStateEnums::CacheEntryType type); |