[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 12/18] qapi: Add qobject_to_json_pretty_prefi
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v3 12/18] qapi: Add qobject_to_json_pretty_prefix() |
Date: |
Mon, 2 May 2016 09:14:46 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 05/02/2016 07:56 AM, Markus Armbruster wrote:
> Eric Blake <address@hidden> 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