Commit 1615d7feafe37dac5ce325f794605b9a59b51a20
1 parent
dc9b7287
Make JSON::writeNext public
Showing
1 changed file
with
7 additions
and
1 deletions
include/qpdf/JSON.hh
| @@ -95,6 +95,13 @@ class JSON | @@ -95,6 +95,13 @@ class JSON | ||
| 95 | QPDF_DLL | 95 | QPDF_DLL |
| 96 | static void writeArrayItem( | 96 | static void writeArrayItem( |
| 97 | Pipeline*, bool& first, JSON const& element, size_t depth = 0); | 97 | Pipeline*, bool& first, JSON const& element, size_t depth = 0); |
| 98 | + // If writing nested structures incrementally, call writeNext | ||
| 99 | + // before opening a new array or container in the midst of an | ||
| 100 | + // existing one. The first you pass to writeNext should be the one | ||
| 101 | + // for the parent object. Then start a new first for the nested | ||
| 102 | + // item. | ||
| 103 | + QPDF_DLL | ||
| 104 | + static void writeNext(Pipeline* p, bool& first, size_t depth); | ||
| 98 | 105 | ||
| 99 | // The JSON spec calls dictionaries "objects", but that creates | 106 | // The JSON spec calls dictionaries "objects", but that creates |
| 100 | // too much confusion when referring to instances of the JSON | 107 | // too much confusion when referring to instances of the JSON |
| @@ -282,7 +289,6 @@ class JSON | @@ -282,7 +289,6 @@ class JSON | ||
| 282 | static void | 289 | static void |
| 283 | writeClose(Pipeline* p, bool first, size_t depth, char const* delimeter); | 290 | writeClose(Pipeline* p, bool first, size_t depth, char const* delimeter); |
| 284 | static void writeIndent(Pipeline* p, size_t depth); | 291 | static void writeIndent(Pipeline* p, size_t depth); |
| 285 | - static void writeNext(Pipeline* p, bool& first, size_t depth); | ||
| 286 | 292 | ||
| 287 | struct JSON_value | 293 | struct JSON_value |
| 288 | { | 294 | { |