summaryrefslogtreecommitdiffstats
path: root/Source/cmDefinitions.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2021-08-04 13:08:17 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2021-08-08 14:19:08 (GMT)
commite5cd39ca80c8c234118ded33a1576c1be281aa9e (patch)
tree0494dad04188959dd6cefc9497688718ff88006b /Source/cmDefinitions.cxx
parent350065bb855a26692ed6af04870f144ae1f6a886 (diff)
downloadCMake-e5cd39ca80c8c234118ded33a1576c1be281aa9e.zip
CMake-e5cd39ca80c8c234118ded33a1576c1be281aa9e.tar.gz
CMake-e5cd39ca80c8c234118ded33a1576c1be281aa9e.tar.bz2
cmProp: refactoring: transform alias in class
To handle safely the values used by CMake variables and properties, introduce the class cmProp as a replacement from the simple pointer to std::string instance.
Diffstat (limited to 'Source/cmDefinitions.cxx')
-rw-r--r--Source/cmDefinitions.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index 4a4f87d..9e2d7b9 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -34,11 +34,11 @@ cmDefinitions::Def const& cmDefinitions::GetInternal(const std::string& key,
return begin->Map.emplace(key, def).first->second;
}
-const std::string* cmDefinitions::Get(const std::string& key, StackIter begin,
- StackIter end)
+cmProp cmDefinitions::Get(const std::string& key, StackIter begin,
+ StackIter end)
{
Def const& def = cmDefinitions::GetInternal(key, begin, end, false);
- return def.Value ? def.Value.str_if_stable() : nullptr;
+ return def.Value ? cmProp(def.Value.str_if_stable()) : nullptr;
}
void cmDefinitions::Raise(const std::string& key, StackIter begin,