qobject: Use GString instead of QString to accumulate JSON
commitf1cc129df8341ebb6176363d24b57035bb5dabe4
authorMarkus Armbruster <armbru@redhat.com>
Fri, 11 Dec 2020 17:11:36 +0000 (11 18:11 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Sat, 19 Dec 2020 09:38:43 +0000 (19 10:38 +0100)
tree2caf54bd9a2894a4c78223f8a9a4e57c209da023
parent6589f4599151201a61d6b1be8450adb63ae81017
qobject: Use GString instead of QString to accumulate JSON

QString supports modifying its string, but it's quite limited: you can
only append.  The remaining callers use it for building an initial
string, never for modifying it later.

Use of GString for building the initial string is actually more
convenient here.  Change qobject_to_json() & friends to do that.

Once all such uses are replaced this way, QString can become immutable.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201211171152.146877-5-armbru@redhat.com>
include/qapi/qmp/qstring.h
qobject/qjson.c
qobject/qstring.c