[gnome-maps/wip/mlundblad/reduce-dup-place-init: 1/4] WIP: osm-object: Add method to get tags
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/mlundblad/reduce-dup-place-init: 1/4] WIP: osm-object: Add method to get tags
- Date: Sun, 26 Sep 2021 20:44:54 +0000 (UTC)
commit 3babb277e1e5e821b6fe0e938af372f883c9701d
Author: Marcus Lundblad <ml update uu se>
Date: Tue Sep 21 22:59:14 2021 +0200
WIP: 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]