[aravis] Add arv_gc_enum_entry_get_string.



commit 2a139e47fc7b435a9367f7b2232cba4ddef64297
Author: Jure Varlec <jure varlec ad-vega si>
Date:   Sun Jul 1 18:17:24 2012 +0200

    Add arv_gc_enum_entry_get_string.

 src/arvgcenumentry.c |   22 ++++++++++++++++++++++
 src/arvgcenumentry.h |    1 +
 2 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/src/arvgcenumentry.c b/src/arvgcenumentry.c
index b75a834..c1077a8 100644
--- a/src/arvgcenumentry.c
+++ b/src/arvgcenumentry.c
@@ -91,6 +91,28 @@ arv_gc_enum_entry_get_value (ArvGcEnumEntry *entry, GError **error)
 	return value;
 }
 
+const char *
+arv_gc_enum_entry_get_string (ArvGcEnumEntry *entry, GError **error)
+{
+	const char * string;
+	GError *local_error = NULL;
+
+	g_return_val_if_fail (ARV_IS_GC_ENUM_ENTRY (entry), 0);
+	g_return_val_if_fail (error == NULL || *error == NULL, 0);
+
+	if (entry->value == NULL)
+		return 0;
+
+	string = arv_gc_feature_node_get_name (ARV_GC_FEATURE_NODE (entry));
+
+	if (local_error != NULL) {
+		g_propagate_error (error, local_error);
+		return 0;
+	}
+
+	return string;
+}
+
 ArvGcNode *
 arv_gc_enum_entry_new (void)
 {
diff --git a/src/arvgcenumentry.h b/src/arvgcenumentry.h
index 25529ac..d05682e 100644
--- a/src/arvgcenumentry.h
+++ b/src/arvgcenumentry.h
@@ -52,6 +52,7 @@ GType 		arv_gc_enum_entry_get_type 	(void);
 ArvGcNode * 	arv_gc_enum_entry_new 		(void);
 
 gint64		arv_gc_enum_entry_get_value	(ArvGcEnumEntry *entry, GError **error);
+const char *	arv_gc_enum_entry_get_string	(ArvGcEnumEntry *entry, GError **error);
 
 G_END_DECLS
 



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