[couchdb-glib] Added missing implementation in couchdb_document_get/set_struct_field



commit cfb5510cf1b6054bcba461b724a2097452d23cb2
Author: Rodrigo Moya <rodrigo gnome-db org>
Date:   Fri Jun 12 14:19:28 2009 +0200

    Added missing implementation in couchdb_document_get/set_struct_field

 couchdb-glib/couchdb-document.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/couchdb-glib/couchdb-document.c b/couchdb-glib/couchdb-document.c
index ade0be1..26c8ac2 100644
--- a/couchdb-glib/couchdb-document.c
+++ b/couchdb-glib/couchdb-document.c
@@ -254,6 +254,22 @@ couchdb_document_get_struct_field (CouchDBDocument *document, const char *field)
 {
 	g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
 	g_return_val_if_fail (field != NULL, NULL);
+
+	return couchdb_struct_field_new_from_json_object (
+		json_object_get_object_member (json_node_get_object (document->root_node),
+					       field));
+}
+
+void
+couchdb_document_set_struct_field (CouchDBDocument *document, const char *field, CouchDBStructField *value)
+{
+	g_return_if_fail (COUCHDB_IS_DOCUMENT (document));
+	g_return_if_fail (field != NULL);
+	g_return_if_fail (value != NULL);
+
+	json_object_set_object_member (json_node_get_object (document->root_node),
+				       field,
+				       json_object_ref (value->json_object));
 }
 
 char *



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