move encodeAttribute from Property to Persitence to avoid code duplication
This commit is contained in:
@@ -155,33 +155,6 @@ void Property::Paste(const Property& /*from*/)
|
||||
assert(0);
|
||||
}
|
||||
|
||||
std::string Property::encodeAttribute(const std::string& str)
|
||||
{
|
||||
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 if (*it == '\t')
|
||||
tmp += "	";
|
||||
else
|
||||
tmp += *it;
|
||||
}
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//**************************************************************************
|
||||
// PropertyLists
|
||||
|
||||
Reference in New Issue
Block a user