IS it feasible

Simon McVittie simon.mcvittie at collabora.co.uk
Mon Apr 11 03:13:40 PDT 2011


On Mon, 11 Apr 2011 at 12:26:20 +0530, aji.kumar at accenture.com wrote:
> 1. "(a(ay)q)" -> What my understanding is this is a outer structure(GValueArray) containing an array(GPtrArray) of structures(GValueArray) containing array of Bytes and a unsigned short.

I recommend using GDBus instead of dbus-glib for any new GLib-based,
D-Bus-using code. If you really need to do dbus-glib, the
corresponding structure (in C++-like pseudocode) is indeed a

    GValueArray<GPtrArray<GValueArray<GArray<guchar>>>, guint>

But don't do that: you're adding extra layers of GValueArray that you don't
need. (aayq) would come out as a GValueArray<GPtrArray<GArray<guchar>>, guint>
which contains the same information and is easier to deal with.

dbus-glib doesn't really support 16-bit types, so the 16-bit types are
represented the same as the 32-bit types; stricter bindings like QtDBus will
tend to have trouble with this. Either use GDBus, or don't use 16-bit integers
in your API.

Also note that GArray<guchar> is not the same thing as GByteArray.

> 2. "(a((ay)s(i))q)" - this should be achievable once above is achieved.

Similarly, that's not a useful type: (a(aysi)q) contains the same information
and is much easier to construct. That'd be a

    GValueArray<GPtrArray<GValueArray<GArray<guchar>, gchar *, gint>>>, guint>

Regards,
    S


More information about the dbus mailing list