cmProperty: Remove needless Name member.
Size goes from 72 to 40 bytes with GNU libstdc++-5.1.
This commit is contained in:
parent
93cc2eef38
commit
1c48edf8fc
|
@ -12,17 +12,14 @@
|
||||||
#include "cmProperty.h"
|
#include "cmProperty.h"
|
||||||
#include "cmSystemTools.h"
|
#include "cmSystemTools.h"
|
||||||
|
|
||||||
void cmProperty::Set(const std::string& name, const char *value)
|
void cmProperty::Set(const char *value)
|
||||||
{
|
{
|
||||||
this->Name = name;
|
|
||||||
this->Value = value;
|
this->Value = value;
|
||||||
this->ValueHasBeenSet = true;
|
this->ValueHasBeenSet = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmProperty::Append(const std::string& name, const char *value,
|
void cmProperty::Append(const char *value, bool asString)
|
||||||
bool asString)
|
|
||||||
{
|
{
|
||||||
this->Name = name;
|
|
||||||
if(!this->Value.empty() && *value && !asString)
|
if(!this->Value.empty() && *value && !asString)
|
||||||
{
|
{
|
||||||
this->Value += ";";
|
this->Value += ";";
|
||||||
|
|
|
@ -21,11 +21,10 @@ public:
|
||||||
TEST, VARIABLE, CACHED_VARIABLE, INSTALL };
|
TEST, VARIABLE, CACHED_VARIABLE, INSTALL };
|
||||||
|
|
||||||
// set this property
|
// set this property
|
||||||
void Set(const std::string& name, const char *value);
|
void Set(const char *value);
|
||||||
|
|
||||||
// append to this property
|
// append to this property
|
||||||
void Append(const std::string& name, const char *value,
|
void Append(const char *value, bool asString = false);
|
||||||
bool asString = false);
|
|
||||||
|
|
||||||
// get the value
|
// get the value
|
||||||
const char *GetValue() const;
|
const char *GetValue() const;
|
||||||
|
@ -34,7 +33,6 @@ public:
|
||||||
cmProperty() { this->ValueHasBeenSet = false; }
|
cmProperty() { this->ValueHasBeenSet = false; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::string Name;
|
|
||||||
std::string Value;
|
std::string Value;
|
||||||
bool ValueHasBeenSet;
|
bool ValueHasBeenSet;
|
||||||
};
|
};
|
||||||
|
|
|
@ -40,7 +40,7 @@ void cmPropertyMap::SetProperty(const std::string& name, const char *value,
|
||||||
(void)scope;
|
(void)scope;
|
||||||
|
|
||||||
cmProperty *prop = this->GetOrCreateProperty(name);
|
cmProperty *prop = this->GetOrCreateProperty(name);
|
||||||
prop->Set(name,value);
|
prop->Set(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmPropertyMap::AppendProperty(const std::string& name, const char* value,
|
void cmPropertyMap::AppendProperty(const std::string& name, const char* value,
|
||||||
|
@ -54,7 +54,7 @@ void cmPropertyMap::AppendProperty(const std::string& name, const char* value,
|
||||||
(void)scope;
|
(void)scope;
|
||||||
|
|
||||||
cmProperty *prop = this->GetOrCreateProperty(name);
|
cmProperty *prop = this->GetOrCreateProperty(name);
|
||||||
prop->Append(name,value,asString);
|
prop->Append(value,asString);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *cmPropertyMap
|
const char *cmPropertyMap
|
||||||
|
|
Loading…
Reference in New Issue