cmPropertyList: Add a way to retrieve all properties
This commit is contained in:
parent
7066218e79
commit
120899c698
|
@ -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) {
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue