[glib/gvariantiter] GVariantType: add is_variant()



commit 0d34060d413016429e3a2126a4d163816a332a17
Author: Ryan Lortie <desrt desrt ca>
Date:   Sun Feb 21 15:41:39 2010 -0500

    GVariantType: add is_variant()

 docs/reference/glib/glib-sections.txt |    1 +
 glib/glib.symbols                     |    1 +
 glib/gvarianttype.c                   |   17 +++++++++++++++++
 glib/gvarianttype.h                   |    1 +
 4 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/glib/glib-sections.txt b/docs/reference/glib/glib-sections.txt
index 65a02e0..11bb3c9 100644
--- a/docs/reference/glib/glib-sections.txt
+++ b/docs/reference/glib/glib-sections.txt
@@ -2754,6 +2754,7 @@ g_variant_type_is_maybe
 g_variant_type_is_array
 g_variant_type_is_tuple
 g_variant_type_is_dict_entry
+g_variant_type_is_variant
 
 <SUBSECTION>
 g_variant_type_hash
diff --git a/glib/glib.symbols b/glib/glib.symbols
index 970bf16..b09767e 100644
--- a/glib/glib.symbols
+++ b/glib/glib.symbols
@@ -1671,6 +1671,7 @@ g_variant_type_is_maybe
 g_variant_type_is_array
 g_variant_type_is_tuple
 g_variant_type_is_dict_entry
+g_variant_type_is_variant
 g_variant_type_hash
 g_variant_type_equal
 g_variant_type_is_subtype_of
diff --git a/glib/gvarianttype.c b/glib/gvarianttype.c
index 6581c55..1c1d158 100644
--- a/glib/gvarianttype.c
+++ b/glib/gvarianttype.c
@@ -960,6 +960,23 @@ g_variant_type_is_dict_entry (const GVariantType *type)
 }
 
 /**
+ * g_variant_type_is_variant:
+ * @type: a #GVariantType
+ * @returns: %TRUE if @type is the variant type
+ *
+ * Determines if the given @type is the variant type.
+ *
+ * Since 2.24
+ **/
+gboolean
+g_variant_type_is_variant (const GVariantType *type)
+{
+  g_return_val_if_fail (g_variant_type_check (type), FALSE);
+
+  return g_variant_type_peek_string (type)[0] == 'v';
+}
+
+/**
  * g_variant_type_hash:
  * @type: a #GVariantType
  * @returns: the hash value
diff --git a/glib/gvarianttype.h b/glib/gvarianttype.h
index 1160754..1a477d6 100644
--- a/glib/gvarianttype.h
+++ b/glib/gvarianttype.h
@@ -270,6 +270,7 @@ gboolean                        g_variant_type_is_maybe                 (const G
 gboolean                        g_variant_type_is_array                 (const GVariantType  *type);
 gboolean                        g_variant_type_is_tuple                 (const GVariantType  *type);
 gboolean                        g_variant_type_is_dict_entry            (const GVariantType  *type);
+gboolean                        g_variant_type_is_variant               (const GVariantType  *type);
 
 /* for hash tables */
 guint                           g_variant_type_hash                     (gconstpointer        type);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]