diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-05-03 08:12:28 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-05-04 20:32:21 (GMT) |
commit | be6664c208c65e01dc175ae4d27e7fc18c28c97e (patch) | |
tree | 8fdfd15921c8b7d9036c882a13b80676d5c7d1e0 /Source/cmPolicies.cxx | |
parent | de211686122166e7485a98fd027bd1d32fda40b0 (diff) | |
download | CMake-be6664c208c65e01dc175ae4d27e7fc18c28c97e.zip CMake-be6664c208c65e01dc175ae4d27e7fc18c28c97e.tar.gz CMake-be6664c208c65e01dc175ae4d27e7fc18c28c97e.tar.bz2 |
cmPolicies: Implement abstraction for PolicyMap.
Hide the detail that it is a std::map.
Diffstat (limited to 'Source/cmPolicies.cxx')
-rw-r--r-- | Source/cmPolicies.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index c95520f..8996943 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -342,3 +342,25 @@ cmPolicies::GetRequiredAlwaysPolicyError(cmPolicies::PolicyID id) << "Run cmake --help-policy " << pid << " for more information."; return e.str(); } + +cmPolicies::PolicyStatus +cmPolicies::PolicyMap::Get(cmPolicies::PolicyID id) const +{ + return this->find(id)->second; +} + +void cmPolicies::PolicyMap::Set(cmPolicies::PolicyID id, + cmPolicies::PolicyStatus status) +{ + (*this)[id] = status; +} + +bool cmPolicies::PolicyMap::IsDefined(cmPolicies::PolicyID id) const +{ + return this->find(id) != this->end(); +} + +bool cmPolicies::PolicyMap::IsEmpty() const +{ + return this->empty(); +} |