mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-26 18:42:41 +01:00
GH #119: JSON::Object holds values in ordered map
- fixed GH #119: JSON::Object holds values in ordered map - added PrintHandler - renamed DefaultHandler to ParseHandler - redefined DefaultHandler as typedef to ParseHandler
This commit is contained in:
@@ -120,8 +120,10 @@ bool Array::isObject(unsigned int index) const
|
||||
}
|
||||
|
||||
|
||||
void Array::stringify(std::ostream& out, unsigned int indent) const
|
||||
void Array::stringify(std::ostream& out, unsigned int indent, int step) const
|
||||
{
|
||||
if (step == -1) step = indent;
|
||||
|
||||
out << "[";
|
||||
|
||||
if (indent > 0) out << std::endl;
|
||||
@@ -130,15 +132,22 @@ void Array::stringify(std::ostream& out, unsigned int indent) const
|
||||
{
|
||||
for(int i = 0; i < indent; i++) out << ' ';
|
||||
|
||||
Stringifier::stringify(*it, out, indent);
|
||||
Stringifier::stringify(*it, out, indent + step, step);
|
||||
|
||||
if ( ++it != _values.end() )
|
||||
{
|
||||
out << ",";
|
||||
if ( indent > 0 ) out << std::endl;
|
||||
if (step > 0) out << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
if (step > 0) out << '\n';
|
||||
|
||||
if (indent >= step) indent -= step;
|
||||
|
||||
for (int i = 0; i < indent; i++)
|
||||
out << ' ';
|
||||
|
||||
out << "]";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user