[vala/staging] vala: Add SymbolAccessibility.to_string()



commit 4b3654d854a4d8c5fb4c93c612a13de2a6e8eb7c
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Nov 14 14:35:52 2018 +0100

    vala: Add SymbolAccessibility.to_string()

 vala/valasymbol.vala | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/vala/valasymbol.vala b/vala/valasymbol.vala
index 59e75a577..3801c83c8 100644
--- a/vala/valasymbol.vala
+++ b/vala/valasymbol.vala
@@ -482,7 +482,17 @@ public enum Vala.SymbolAccessibility {
        PRIVATE,
        INTERNAL,
        PROTECTED,
-       PUBLIC
+       PUBLIC;
+
+       public unowned string to_string () {
+               switch (this) {
+               case PROTECTED: return "protected";
+               case INTERNAL: return "internal";
+               case PRIVATE: return "private";
+               case PUBLIC: return "public";
+               default: assert_not_reached ();
+               }
+       }
 }
 
 public enum Vala.MemberBinding {


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