In the GVariant intro, mention lack of built-in endianness, and rationale

Presumably, the rationale for not storing the endianness is that
GVariant is a recursive type system, and in a sane format, endianness
only needs to be stored once per blob of data (once per D-Bus message,
once per file on disk, etc.).

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=632049
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ryan Lortie <desrt@desrt.ca>
This commit is contained in:
Simon McVittie 2011-10-03 14:27:15 +01:00
parent ebb544f549
commit 7973d9f8ba

View File

@ -72,6 +72,14 @@
* as the serialisation format of a D-Bus message body: use #GDBusMessage,
* in the gio library, for those.)
*
* For space-efficiency, the #GVariant serialisation format does not
* automatically include the variant's type or endianness, which must
* either be implied from context (such as knowledge that a particular
* file format always contains a little-endian %G_VARIANT_TYPE_VARIANT)
* or supplied out-of-band (for instance, a type and/or endianness
* indicator could be placed at the beginning of a file, network message
* or network stream).
*
* For convenience to C programmers, #GVariant features powerful
* varargs-based value construction and destruction. This feature is
* designed to be embedded in other libraries.