cmPropertyDefinitionMap.cxx 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #include "cmPropertyDefinitionMap.h"
  4. #include <tuple>
  5. #include <utility>
  6. void cmPropertyDefinitionMap::DefineProperty(
  7. const std::string& name, cmProperty::ScopeType scope,
  8. const std::string& ShortDescription, const std::string& FullDescription,
  9. bool chain)
  10. {
  11. auto it = this->find(name);
  12. if (it == this->end()) {
  13. // try_emplace() since C++17
  14. this->emplace(std::piecewise_construct, std::forward_as_tuple(name),
  15. std::forward_as_tuple(name, scope, ShortDescription,
  16. FullDescription, chain));
  17. }
  18. }
  19. bool cmPropertyDefinitionMap::IsPropertyDefined(const std::string& name) const
  20. {
  21. return this->find(name) != this->end();
  22. }
  23. bool cmPropertyDefinitionMap::IsPropertyChained(const std::string& name) const
  24. {
  25. auto it = this->find(name);
  26. if (it == this->end()) {
  27. return false;
  28. }
  29. return it->second.IsChained();
  30. }