]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Support to_string attribute for enums
authorAli Sabil <ali.sabil@gmail.com>
Thu, 19 Feb 2009 14:12:44 +0000 (14:12 +0000)
committerAli Sabil <asabil@src.gnome.org>
Thu, 19 Feb 2009 14:12:44 +0000 (14:12 +0000)
2009-02-19  Ali Sabil  <ali.sabil@gmail.com>

* vapigen/valagidlparser.vala:

Support to_string attribute for enums

svn path=/trunk/; revision=2456

ChangeLog
vapigen/valagidlparser.vala

index 3f41d8adf6ed05c9cbf0db199ce421a40c0ec75f..68eb80f8cf8e0255ec734567fc7f2139ab581e56 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-02-19  Ali Sabil  <ali.sabil@gmail.com>
+
+       * vapigen/valagidlparser.vala:
+
+       Support to_string attribute for enums
+
 2009-02-19  Ali Sabil  <ali.sabil@gmail.com>
 
        * vapi/packages/gstreamer-rtp-0.10/:
index 8e8136001818fd1ba1f247e9b60adee88873de4b..79dd6b596a1fe2b5d490af4e3cfcc1e46a2ec0c0 100644 (file)
@@ -849,6 +849,14 @@ public class Vala.GIdlParser : CodeVisitor {
                                        if (eval (nv[1]) == "1") {
                                                is_errordomain = true;
                                        }
+                               } else if (nv[0] == "to_string") {
+                                       var return_type = new UnresolvedType ();
+                                       return_type.unresolved_symbol = new UnresolvedSymbol (null, "string");
+                                       return_type.value_owned = false;
+                                       var m = new Method ("to_string", return_type, current_source_reference);
+                                       m.access = SymbolAccessibility.PUBLIC;
+                                       m.set_cname (eval(nv[1]));
+                                       en.add_method (m);
                                }
                        }
                }