From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axFZ2-0000UD-LC for qemu-devel@nongnu.org; Mon, 02 May 2016 11:15:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1axFYo-0003pR-FC for qemu-devel@nongnu.org; Mon, 02 May 2016 11:15:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39738) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axFYo-0003k8-99 for qemu-devel@nongnu.org; Mon, 02 May 2016 11:14:58 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F10B47F080 for ; Mon, 2 May 2016 15:14:46 +0000 (UTC) References: <1461903820-3092-1-git-send-email-eblake@redhat.com> <1461903820-3092-13-git-send-email-eblake@redhat.com> <87h9egk1gb.fsf@dusky.pond.sub.org> From: Eric Blake Message-ID: <57276EE6.7010507@redhat.com> Date: Mon, 2 May 2016 09:14:46 -0600 MIME-Version: 1.0 In-Reply-To: <87h9egk1gb.fsf@dusky.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="PHlDfD3h9qwrE2fFRQfcTANdSDTH0nABt" Subject: Re: [Qemu-devel] [PATCH v3 12/18] qapi: Add qobject_to_json_pretty_prefix() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, famz@redhat.com, Luiz Capitulino This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --PHlDfD3h9qwrE2fFRQfcTANdSDTH0nABt Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/02/2016 07:56 AM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> 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); >=20 > 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)'? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --PHlDfD3h9qwrE2fFRQfcTANdSDTH0nABt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXJ27mAAoJEKeha0olJ0NqVPsH/R9ElVyE4kBrVGcw2u3FEChG +FJKTUeABVcBlIu88EPV1l+hpNqbSOFlKi4g0oy/cbJ8VdNxGUukjwkfdw5dhIzl HZgrBtIXBAbuNbdzx6xuClp7a1Mv6VSy+ZwR2iiSKaEXo7243f+wS+teUnkxYSVh aAu4hJVmwfB2hHj6ZNU/drUvawED2/alMTQIiHlTHI9o1IARWWunqEo4QiFt9SIf nX0tOCAQjOK+Iaido3lmo3wJMbvBaYLCcb+kUYHojmbYbBBMyAuolt5iC76dEr9+ y40SUaA51NeeWMPEw+TIKAiEhg4avJMQF4qDXnSMH2KVqrGbJ2hPjUqpI6klgtY= =nfU6 -----END PGP SIGNATURE----- --PHlDfD3h9qwrE2fFRQfcTANdSDTH0nABt--