创建GVariant *字典并将其嵌入另一个GVariant *字典中

时间:2019-05-06 09:27:48

标签: dbus gdbus gvariant

我是GDBus的新手,所以请原谅我。我想出了如何使用在线示例创建字典GVariant *对象:

GVariantBuilder *b;
GVariant *dict;

b = g_variant_builder_new (G_VARIANT_TYPE ("a{sv}"));
g_variant_builder_add (b, "{sv}", "name", g_variant_new_string ("foo"));
g_variant_builder_add (b, "{sv}", "timeout", g_variant_new_int32 (10));
dict = g_variant_builder_end (b);

这很简单。但是现在我想接受这个字典并将其以key:value格式嵌入到另一个GVariant *包装器对象中。这可能吗?

0 个答案:

没有答案