mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-26 02:18:04 +01:00
Make indentation work in toString
This commit is contained in:
@@ -64,28 +64,32 @@ std::string Array::toString(int indent) const
|
||||
{
|
||||
if ( it != _elements.begin() )
|
||||
{
|
||||
if ( indent > 0 )
|
||||
{
|
||||
for(int i = 0; i < indent; ++i)
|
||||
{
|
||||
oss << ' ';
|
||||
}
|
||||
}
|
||||
oss << ",";
|
||||
if ( indent > 0 )
|
||||
{
|
||||
oss << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < indent; ++i)
|
||||
{
|
||||
oss << ' ';
|
||||
}
|
||||
oss << (*it)->toString();
|
||||
}
|
||||
oss << "]";
|
||||
|
||||
if ( indent > 0 )
|
||||
if ( indent > 0 )
|
||||
{
|
||||
oss << std::endl;
|
||||
indent -= 2;
|
||||
for(int i = 0; i < indent; ++i)
|
||||
{
|
||||
oss << ' ';
|
||||
}
|
||||
}
|
||||
|
||||
oss << "]";
|
||||
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user