It would be nice to add a special event in SAX mode that allows to interleave pre-generated JSON with JSON generated dynamically. This could prove very useful in caching common sub-parts of JSON output. The interface could be as following, since in JSON null bytes have to be escaped:
bool Writer::RawValue(const char *null_terminated_json)
It could also be possible to add a "raw" type of value in the DOM representation, although I myself wouldn't care much about it, and it would pose interesting questions w.r.t. things like its lifecycle and whether the usual move semantics should apply or rather some copy-on-write mechanism or what not... I'm not a fan of caching subtrees of the DOM, but I'd really love to be able to cache work in when emitting JSON via SAX events.
It would be nice to add a special event in SAX mode that allows to interleave pre-generated JSON with JSON generated dynamically. This could prove very useful in caching common sub-parts of JSON output. The interface could be as following, since in JSON null bytes have to be escaped:
bool Writer::RawValue(const char *null_terminated_json)
It could also be possible to add a "raw" type of value in the DOM representation, although I myself wouldn't care much about it, and it would pose interesting questions w.r.t. things like its lifecycle and whether the usual move semantics should apply or rather some copy-on-write mechanism or what not... I'm not a fan of caching subtrees of the DOM, but I'd really love to be able to cache work in when emitting JSON via SAX events.