On 05/02/2016 07:56 AM, Markus Armbruster wrote: > Eric Blake <ebl...@redhat.com> writes: > >> The next patch will add pretty indentation to the JSON visitor. >> But in order to support pretty output in the type_any() callback, >> we need to prefix every line of the QObject visitor by the current >> indentation in the JSON visitor. Hence, a new function >> qobject_to_json_pretty_indent(), and the old function becomes a >> thin wrapper to the expanded behavior. >>
>> QString *qobject_to_json(const QObject *obj); >> QString *qobject_to_json_pretty(const QObject *obj); >> +QString *qobject_to_json_pretty_prefix(const QObject *obj, const char >> *prefix); > > Why a string prefix, and not indentation? Might be possible. Would it be better as an integer for 'number of spaces' or for 'number of indentation levels (where number of spaces per indentation-level is not configurable)'? -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature