[gnome-maps/wip/mlundblad/reduce-dup-place-init: 4/7] osm-object: Add method to get tags




commit 241fcf7942539d5342af473be25b7946e3d3dbe8
Author: Marcus Lundblad <ml update uu se>
Date:   Tue Sep 21 22:59:14 2021 +0200

    osm-object: Add method to get tags
    
    Add method to get a reference to all OSM
    tags as a hash table.

 lib/maps-osm-object.c | 14 ++++++++++++++
 lib/maps-osm-object.h |  2 ++
 2 files changed, 16 insertions(+)
---
diff --git a/lib/maps-osm-object.c b/lib/maps-osm-object.c
index 5a00f0c1..165477f6 100644
--- a/lib/maps-osm-object.c
+++ b/lib/maps-osm-object.c
@@ -329,3 +329,17 @@ maps_osm_object_serialize (const MapsOSMObject *object)
   
   return (char *) result;
 }
+
+/**
+ * maps_osm_object_get_tags:
+ *
+ * Returns: (element-type utf8 utf8): a hash table with key/values
+ */
+const GHashTable *
+maps_osm_object_get_tags (const MapsOSMObject *object)
+{
+  const MapsOSMObjectPrivate *priv =
+    maps_osm_object_get_instance_private ((MapsOSMObject *) object);
+
+  return priv->tags;
+}
diff --git a/lib/maps-osm-object.h b/lib/maps-osm-object.h
index 6e8f2e3b..941ecbd2 100644
--- a/lib/maps-osm-object.h
+++ b/lib/maps-osm-object.h
@@ -53,4 +53,6 @@ void maps_osm_object_delete_tag (MapsOSMObject *object, const char *key);
 
 char *maps_osm_object_serialize (const MapsOSMObject *object);
 
+const GHashTable *maps_osm_object_get_tags (const MapsOSMObject *object);
+
 #endif //__MAPS_OSM_OBJECT_H__


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