[gxml] Added GomHashMap.has_key() and .get_keys()



commit 3a923e77bf909d6c978e4d376f009d614aa4b5b5
Author: Daniel Espinosa <esodan gmail com>
Date:   Fri Feb 10 12:55:36 2017 -0600

    Added GomHashMap.has_key() and .get_keys()

 gxml/GomCollections.vala |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/gxml/GomCollections.vala b/gxml/GomCollections.vala
index e636295..6beab49 100644
--- a/gxml/GomCollections.vala
+++ b/gxml/GomCollections.vala
@@ -366,6 +366,19 @@ public class GXml.GomHashMap : GXml.BaseCollection, GXml.GomCollection {
     return _element.child_nodes.get (i) as DomElement;
   }
   /**
+   * Returns true if @key is used in collection.
+   */
+  public bool has_key (string key) {
+    if (_hashtable.contains (key)) return true;
+    return false;
+  }
+  /**
+   * Returns list of keys used in collection.
+   */
+  public GLib.List<string> get_keys () {
+    return _hashtable.get_keys ();
+  }
+  /**
    * Validates if given element has a {@link GomHashMap.attribute_key} set,
    * if so adds a new key pointing to given index and returns true.
    *


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