chromeos-dbus-bindings: Add support for STRUCT and typed async methods

The async method handlers in libchromeos have been changed to use
strongly typed response objects. This change mainly changes the
adapter generator to produce the correct signatures for the async
adapter methods.

In the attempt to support existing XML files from shill and
modemmanager I implemented some features that are required there:

1. Allow nested <node> elements (which are still ignored but at
   least parsing of XML files doesn't fail.
2. Add support for <tp:docstring> element to extract comments
   from interface/method/signal/property definitions and add
   then to adaptor/proxy code which should help user to make
   sense of method intentions.
3. Added support for STRUCT D-Bus types (...). Now using
   std::tuple<> to represent D-Bus structures.
4. a{sv} are converted to chromeos::VariantDictionary instead of
   std::map<std::string, chromeos::Any> which is shorter and
   being very popular type in D-Bus, makes a few generated
   function signatures neater.
5. Added support for "org.freedesktop.DBus.GLib.Async" annotation
   to be an alias for "org.chromium.DBus.Method.Kind"="async".
6. Fixed chromeos::string_utils::Split() to eliminate empty
   strings if they were created by trimming all-whitespace
   elements of the split array.

BUG=None
TEST=FEATURES=test emerge-link chromeos-dbus-bindings

Change-Id: I73cf13819128ca5fca9e9188d162d120b737cf1f
Reviewed-on: https://chromium-review.googlesource.com/229430
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
14 files changed
tree: d3e3a4840c2b790a2c202719ce2e994219224a5d
  1. chromeos-dbus-bindings/