[tracker/ontology-cache: 5/5] libtracker-data: Add functions to retrieve values from gvdb file
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/ontology-cache: 5/5] libtracker-data: Add functions to retrieve values from gvdb file
- Date: Wed, 1 Dec 2010 15:55:53 +0000 (UTC)
commit ffdc3367425689b2386b07daeffae43c9f117dff
Author: Jürg Billeter <j bitron ch>
Date: Wed Dec 1 16:42:13 2010 +0100
libtracker-data: Add functions to retrieve values from gvdb file
src/libtracker-data/tracker-ontologies.c | 48 ++++++++++++++++++++++++++++++
1 files changed, 48 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-ontologies.c b/src/libtracker-data/tracker-ontologies.c
index bd5c29d..007056a 100644
--- a/src/libtracker-data/tracker-ontologies.c
+++ b/src/libtracker-data/tracker-ontologies.c
@@ -421,3 +421,51 @@ tracker_ontologies_load_gvdb (const gchar *filename,
gvdb_classes_table = gvdb_table_get_table (gvdb_table, "classes");
gvdb_properties_table = gvdb_table_get_table (gvdb_table, "properties");
}
+
+static GVariant *
+get_namespace_value (const gchar *namespace,
+ const gchar *key)
+{
+ GvdbTable *nstable;
+ GVariant *result;
+
+ nstable = gvdb_table_get_table (gvdb_namespaces_table, namespace);
+
+ result = gvdb_table_get_value (nstable, key);
+
+ gvdb_table_unref (nstable);
+
+ return result;
+}
+
+static GVariant *
+get_class_value (const gchar *class,
+ const gchar *key)
+{
+ GvdbTable *classtable;
+ GVariant *result;
+
+ classtable = gvdb_table_get_table (gvdb_classes_table, class);
+
+ result = gvdb_table_get_value (classtable, key);
+
+ gvdb_table_unref (classtable);
+
+ return result;
+}
+
+static GVariant *
+get_property_value (const gchar *property,
+ const gchar *key)
+{
+ GvdbTable *proptable;
+ GVariant *result;
+
+ proptable = gvdb_table_get_table (gvdb_properties_table, property);
+
+ result = gvdb_table_get_value (proptable, key);
+
+ gvdb_table_unref (proptable);
+
+ return result;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]