cmPropertyMap.h 973 B

123456789101112131415161718192021222324252627282930313233343536
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmPropertyMap_h
  4. #define cmPropertyMap_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include "cmProperty.h"
  7. #include <map>
  8. #include <string>
  9. #include <utility>
  10. #include <vector>
  11. class cmPropertyMap : public std::map<std::string, cmProperty>
  12. {
  13. public:
  14. // -- Properties
  15. cmProperty* GetOrCreateProperty(const std::string& name);
  16. void SetProperty(const std::string& name, const char* value);
  17. void AppendProperty(const std::string& name, const char* value,
  18. bool asString = false);
  19. const char* GetPropertyValue(const std::string& name) const;
  20. // -- Lists
  21. //! Get a sorted list of property keys
  22. std::vector<std::string> GetKeys() const;
  23. //! Get a sorted by key list of property key,value pairs
  24. std::vector<std::pair<std::string, std::string>> GetList() const;
  25. };
  26. #endif