App: modernize C++: use range-based for loop
This commit is contained in:
@@ -179,19 +179,19 @@ void PropertyPythonObject::loadPickle(const std::string& str)
|
||||
std::string PropertyPythonObject::encodeValue(const std::string& str) const
|
||||
{
|
||||
std::string tmp;
|
||||
for (std::string::const_iterator it = str.begin(); it != str.end(); ++it) {
|
||||
if (*it == '<')
|
||||
for (char it : str) {
|
||||
if (it == '<')
|
||||
tmp += "<";
|
||||
else if (*it == '"')
|
||||
else if (it == '"')
|
||||
tmp += """;
|
||||
else if (*it == '&')
|
||||
else if (it == '&')
|
||||
tmp += "&";
|
||||
else if (*it == '>')
|
||||
else if (it == '>')
|
||||
tmp += ">";
|
||||
else if (*it == '\n')
|
||||
else if (it == '\n')
|
||||
tmp += "\\n";
|
||||
else
|
||||
tmp += *it;
|
||||
tmp += it;
|
||||
}
|
||||
|
||||
return tmp;
|
||||
@@ -384,8 +384,8 @@ void PropertyPythonObject::Restore(Base::XMLReader &reader)
|
||||
void PropertyPythonObject::SaveDocFile (Base::Writer &writer) const
|
||||
{
|
||||
std::string buffer = this->toString();
|
||||
for (std::string::iterator it = buffer.begin(); it != buffer.end(); ++it)
|
||||
writer.Stream().put(*it);
|
||||
for (char it : buffer)
|
||||
writer.Stream().put(it);
|
||||
}
|
||||
|
||||
void PropertyPythonObject::RestoreDocFile(Base::Reader &reader)
|
||||
|
||||
Reference in New Issue
Block a user