Commit 9e64e617 authored by Sebastian Holtermann's avatar Sebastian Holtermann

cmPropertyMap: Rename GetPropertyList method to GetKeys

parent f4bbeb78
......@@ -620,7 +620,7 @@ bool cmCacheManager::CacheIterator::GetValueAsBool() const
std::vector<std::string> cmCacheManager::CacheEntry::GetPropertyList() const
{
return this->Properties.GetPropertyList();
return this->Properties.GetKeys();
}
const char* cmCacheManager::CacheEntry::GetProperty(
......
......@@ -5032,13 +5032,7 @@ void cmGeneratorTarget::ComputeVersionedName(std::string& vName,
std::vector<std::string> cmGeneratorTarget::GetPropertyKeys() const
{
cmPropertyMap const& propsObject = this->Target->GetProperties();
std::vector<std::string> props;
props.reserve(propsObject.size());
for (auto const& it : propsObject) {
props.push_back(it.first);
}
return props;
return this->Target->GetProperties().GetKeys();
}
void cmGeneratorTarget::ReportPropertyOrigin(
......
......@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmPropertyMap.h"
#include <algorithm>
#include <assert.h>
#include <utility>
......@@ -18,16 +17,6 @@ cmProperty* cmPropertyMap::GetOrCreateProperty(const std::string& name)
return prop;
}
std::vector<std::string> cmPropertyMap::GetPropertyList() const
{
std::vector<std::string> keyList;
for (auto const& i : *this) {
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) {
......@@ -61,3 +50,13 @@ const char* cmPropertyMap::GetPropertyValue(const std::string& name) const
}
return it->second.GetValue();
}
std::vector<std::string> cmPropertyMap::GetKeys() const
{
std::vector<std::string> keyList;
keyList.reserve(this->size());
for (auto const& item : *this) {
keyList.push_back(item.first);
}
return keyList;
}
......@@ -14,16 +14,19 @@
class cmPropertyMap : public std::map<std::string, cmProperty>
{
public:
// -- Properties
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,
bool asString = false);
const char* GetPropertyValue(const std::string& name) const;
// -- Lists
//! Get a sorted list of property keys
std::vector<std::string> GetKeys() const;
};
#endif
......@@ -6,7 +6,6 @@
#include <algorithm>
#include <assert.h>
#include <iterator>
#include <utility>
#include "cmAlgorithms.h"
#include "cmProperty.h"
......@@ -667,12 +666,7 @@ bool cmStateDirectory::GetPropertyAsBool(const std::string& prop) const
std::vector<std::string> cmStateDirectory::GetPropertyKeys() const
{
std::vector<std::string> keys;
keys.reserve(this->DirectoryState->Properties.size());
for (auto const& it : this->DirectoryState->Properties) {
keys.push_back(it.first);
}
return keys;
return this->DirectoryState->Properties.GetKeys();
}
void cmStateDirectory::AddNormalTargetName(std::string const& name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment