move encodeAttribute from Property to Persitence to avoid code duplication
This commit is contained in:
@@ -304,31 +304,6 @@ std::string DynamicProperty::getUniquePropertyName(const char *Name) const
|
||||
}
|
||||
}
|
||||
|
||||
std::string DynamicProperty::encodeAttribute(const std::string& str) const
|
||||
{
|
||||
std::string tmp;
|
||||
for (std::string::const_iterator it = str.begin(); it != str.end(); ++it) {
|
||||
if (*it == '<')
|
||||
tmp += "<";
|
||||
else if (*it == '"')
|
||||
tmp += """;
|
||||
else if (*it == '\'')
|
||||
tmp += "'";
|
||||
else if (*it == '&')
|
||||
tmp += "&";
|
||||
else if (*it == '>')
|
||||
tmp += ">";
|
||||
else if (*it == '\r')
|
||||
tmp += "
";
|
||||
else if (*it == '\n')
|
||||
tmp += "
";
|
||||
else
|
||||
tmp += *it;
|
||||
}
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
void DynamicProperty::Save (Base::Writer &writer) const
|
||||
{
|
||||
//extenions must be saved first, as they need to be read and initialised before properties (as
|
||||
|
||||
Reference in New Issue
Block a user