summaryrefslogtreecommitdiffstats
path: root/Source/cmState.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-06-06 07:46:38 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-06-07 07:29:30 (GMT)
commit9058e27a431b01319b18cc4099780fa017ada113 (patch)
treeb79fc44b5223b45d94f4fe98b6344341812aef43 /Source/cmState.cxx
parent1c48edf8fc8cec71c780cbb1c587f10df0ab7185 (diff)
downloadCMake-9058e27a431b01319b18cc4099780fa017ada113.zip
CMake-9058e27a431b01319b18cc4099780fa017ada113.tar.gz
CMake-9058e27a431b01319b18cc4099780fa017ada113.tar.bz2
Constify property definition API.
Diffstat (limited to 'Source/cmState.cxx')
-rw-r--r--Source/cmState.cxx28
1 files changed, 21 insertions, 7 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index c6fb299..15a4638 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -256,27 +256,41 @@ void cmState::DefineProperty(const std::string& name,
chained);
}
-cmPropertyDefinition *cmState
+cmPropertyDefinition const* cmState
::GetPropertyDefinition(const std::string& name,
- cmProperty::ScopeType scope)
+ cmProperty::ScopeType scope) const
{
if (this->IsPropertyDefined(name,scope))
{
- return &(this->PropertyDefinitions[scope][name]);
+ cmPropertyDefinitionMap const& defs =
+ this->PropertyDefinitions.find(scope)->second;
+ return &defs.find(name)->second;
}
return 0;
}
bool cmState::IsPropertyDefined(const std::string& name,
- cmProperty::ScopeType scope)
+ cmProperty::ScopeType scope) const
{
- return this->PropertyDefinitions[scope].IsPropertyDefined(name);
+ std::map<cmProperty::ScopeType, cmPropertyDefinitionMap>::const_iterator it
+ = this->PropertyDefinitions.find(scope);
+ if (it == this->PropertyDefinitions.end())
+ {
+ return false;
+ }
+ return it->second.IsPropertyDefined(name);
}
bool cmState::IsPropertyChained(const std::string& name,
- cmProperty::ScopeType scope)
+ cmProperty::ScopeType scope) const
{
- return this->PropertyDefinitions[scope].IsPropertyChained(name);
+ std::map<cmProperty::ScopeType, cmPropertyDefinitionMap>::const_iterator it
+ = this->PropertyDefinitions.find(scope);
+ if (it == this->PropertyDefinitions.end())
+ {
+ return false;
+ }
+ return it->second.IsPropertyChained(name);
}
void cmState::SetLanguageEnabled(std::string const& l)