]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
markupreader: Add get_attributes() method returning a copy of attributes.
authorLuca Bruno <lucabru@src.gnome.org>
Thu, 6 Jan 2011 11:20:38 +0000 (12:20 +0100)
committerLuca Bruno <lucabru@src.gnome.org>
Mon, 4 Apr 2011 13:14:47 +0000 (15:14 +0200)
vala/valamarkupreader.vala

index 9546faac1d0cf4be998d898f606fc3b0f29b10e9..69170e556ed2b76518b5ea690d41290a94b626cd 100644 (file)
@@ -65,6 +65,19 @@ public class Vala.MarkupReader : Object {
                return attributes[attr];
        }
 
+       /*
+        * Returns a copy of the current attributes.
+        *
+        * @return map of current attributes
+        */
+       public Map<string,string> get_attributes () {
+               var result = new HashMap<string,string> (str_hash, str_equal);
+               foreach (var key in attributes.get_keys ()) {
+                       result.set (key, attributes.get (key));
+               }
+               return result;
+       }
+
        string read_name () {
                char* begin = current;
                while (current < end) {