summaryrefslogtreecommitdiff
path: root/glib/src/variant.hg
diff options
context:
space:
mode:
authorJosé Alburquerque <jaalburqu@svn.gnome.org>2012-11-06 15:20:20 -0500
committerJosé Alburquerque <jaalburqu@svn.gnome.org>2012-11-06 15:29:24 -0500
commit5222ee56a371eabe123afe208641ae76355d3588 (patch)
tree4273c36db442dbf2478f844a2d73f10446f61f11 /glib/src/variant.hg
parent8544ed1d4665521c7eb25e3e851f333fec91e2e1 (diff)
downloadglibmm-5222ee56a371eabe123afe208641ae76355d3588.tar.gz
Variant< std::vector<std::string> >: Add create_from_object_paths().
* glib/src/variant.hg: Add the new method that creates a variant of vector of strings out of object paths. This is so the type of the variant is rightly set to G_VARIANT_TYPE_OBJECT_PATH_ARRAY and not G_VARIANT_TYPE_BYTESTRING in case some application needs to make a distinction. Also _IGNORE the g_variant_get_objv() and g_variant_dup_objv() functions because it's possible to get object paths from a variant of vector of strings if it contains them with the existing getter methods because object paths are merely strings. * glib/src/variantiter.hg: Add an _IGNORE. * glib/src/checksum.ccg: * glib/src/convert.ccg: Whitespace.
Diffstat (limited to 'glib/src/variant.hg')
-rw-r--r--glib/src/variant.hg12
1 files changed, 12 insertions, 0 deletions
diff --git a/glib/src/variant.hg b/glib/src/variant.hg
index 110bbe5c..2caa689c 100644
--- a/glib/src/variant.hg
+++ b/glib/src/variant.hg
@@ -718,6 +718,14 @@ public:
static Variant< std::vector<std::string> >
create(const std::vector<std::string>& data);
+ /** Creates a new Variant from an array of D-Bus object paths.
+ * @param data The array to use for creation.
+ * @return The new Variant.
+ * @newin{2,36}
+ */
+ static Variant< std::vector<std::string> >
+ create_from_object_paths(const std::vector<std::string>& paths);
+
/** Gets a specific element of the string array. It is an error if @a index
* is greater than the number of child items in the container. See
* VariantContainerBase::get_n_children().
@@ -738,6 +746,10 @@ public:
std::vector<std::string> get() const;
_IGNORE(g_variant_get_bytestring_array, g_variant_dup_bytestring_array)
+ // Object paths are merely strings so it is possible to get them already with
+ // the existing get() methods in this class.
+ _IGNORE(g_variant_get_objv, g_variant_dup_objv)
+
/** Gets a VariantIter of the Variant.
* @return the VaraintIter.
* @newin{2,28}