diff options
-rw-r--r-- | Source/cmPropertyMap.cxx | 12 | ||||
-rw-r--r-- | Source/cmPropertyMap.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmPropertyMap.cxx b/Source/cmPropertyMap.cxx index 74e04da..de1281e 100644 --- a/Source/cmPropertyMap.cxx +++ b/Source/cmPropertyMap.cxx @@ -15,6 +15,7 @@ #include "cmSystemTools.h" #include "cmake.h" +#include <algorithm> #include <assert.h> cmProperty* cmPropertyMap::GetOrCreateProperty(const std::string& name) @@ -29,6 +30,17 @@ cmProperty* cmPropertyMap::GetOrCreateProperty(const std::string& name) return prop; } +std::vector<std::string> cmPropertyMap::GetPropertyList() const +{ + std::vector<std::string> keyList; + for (cmPropertyMap::const_iterator i = this->begin(), e = this->end(); + i != e; ++i) { + keyList.push_back(i->first); + } + std::sort(keyList.begin(), keyList.end()); + return keyList; +} + void cmPropertyMap::SetProperty(const std::string& name, const char* value) { if (!value) { diff --git a/Source/cmPropertyMap.h b/Source/cmPropertyMap.h index 4e98750..6dc7bfb 100644 --- a/Source/cmPropertyMap.h +++ b/Source/cmPropertyMap.h @@ -19,6 +19,8 @@ class cmPropertyMap : public std::map<std::string, cmProperty> public: cmProperty* GetOrCreateProperty(const std::string& name); + std::vector<std::string> GetPropertyList() const; + void SetProperty(const std::string& name, const char* value); void AppendProperty(const std::string& name, const char* value, |