CMake Nightly Date Stamp
[kiteware-cmake.git] / Source / cmPropertyMap.h
blob3cd90ec7e049fe60f012e34f9e6ba339935521f2
1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
3 #pragma once
5 #include "cmConfigure.h" // IWYU pragma: keep
7 #include <string>
8 #include <unordered_map>
9 #include <utility>
10 #include <vector>
12 #include "cmValue.h"
14 /** \class cmPropertyMap
15 * \brief String property map.
17 class cmPropertyMap
19 public:
20 // -- General
22 //! Clear property list
23 void Clear();
25 // -- Properties
27 //! Set the property value
28 void SetProperty(const std::string& name, cmValue value);
29 void SetProperty(const std::string& name, const std::string& value)
31 this->SetProperty(name, cmValue(value));
34 //! Append to the property value
35 void AppendProperty(const std::string& name, const std::string& value,
36 bool asString = false);
38 //! Get the property value
39 cmValue GetPropertyValue(const std::string& name) const;
41 //! Remove the property @a name from the map
42 void RemoveProperty(const std::string& name);
44 // -- Lists
46 //! Get a sorted list of property keys
47 std::vector<std::string> GetKeys() const;
49 //! Get a sorted by key list of property key,value pairs
50 std::vector<std::pair<std::string, std::string>> GetList() const;
52 private:
53 std::unordered_map<std::string, std::string> Map_;