mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-03 15:17:29 +00:00
Refactor JSON::writeClose
This commit is contained in:
parent
cb4debe75f
commit
dfa7d414f5
@ -32,11 +32,13 @@ JSON::JSON(std::shared_ptr<JSON_value> value) :
|
|||||||
void
|
void
|
||||||
JSON::writeClose(Pipeline* p, bool first, size_t depth, char const* delimiter)
|
JSON::writeClose(Pipeline* p, bool first, size_t depth, char const* delimiter)
|
||||||
{
|
{
|
||||||
if (!first) {
|
if (first) {
|
||||||
*p << "\n";
|
*p << delimiter;
|
||||||
writeIndent(p, depth);
|
} else {
|
||||||
|
std::string s{"\n"};
|
||||||
|
s.append(2 * depth, ' ');
|
||||||
|
*p << s + delimiter;
|
||||||
}
|
}
|
||||||
*p << delimiter;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user