diff options
-rw-r--r-- | Source/cmDefinitions.cxx | 24 | ||||
-rw-r--r-- | Source/cmDefinitions.h | 1 |
2 files changed, 9 insertions, 16 deletions
diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx index d5f6ebc..abb46b3 100644 --- a/Source/cmDefinitions.cxx +++ b/Source/cmDefinitions.cxx @@ -39,9 +39,16 @@ cmDefinitions::GetInternal(const std::string& key) } //---------------------------------------------------------------------------- -cmDefinitions::Def const& -cmDefinitions::SetInternal(const std::string& key, Def const& def) +const char* cmDefinitions::Get(const std::string& key) { + Def const& def = this->GetInternal(key); + return def.Exists? def.c_str() : 0; +} + +//---------------------------------------------------------------------------- +void cmDefinitions::Set(const std::string& key, const char* value) +{ + Def def(value); if(this->Up || def.Exists) { // In lower scopes we store keys, defined or not. @@ -55,19 +62,6 @@ cmDefinitions::SetInternal(const std::string& key, Def const& def) } //---------------------------------------------------------------------------- -const char* cmDefinitions::Get(const std::string& key) -{ - Def const& def = this->GetInternal(key); - return def.Exists? def.c_str() : 0; -} - -//---------------------------------------------------------------------------- -void cmDefinitions::Set(const std::string& key, const char* value) -{ - this->SetInternal(key, Def(value)); -} - -//---------------------------------------------------------------------------- std::set<std::string> cmDefinitions::LocalKeys() const { std::set<std::string> keys; diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h index 690df1f..83cd0d9 100644 --- a/Source/cmDefinitions.h +++ b/Source/cmDefinitions.h @@ -78,7 +78,6 @@ private: // Internal query and update methods. Def const& GetInternal(const std::string& key); - Def const& SetInternal(const std::string& key, Def const& def); // Implementation of Closure() method. struct ClosureTag {}; |