]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
glib-2.0: Add string.to_bool()
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Mon, 9 Mar 2009 14:52:07 +0000 (16:52 +0200)
committerJürg Billeter <j@bitron.ch>
Mon, 9 Mar 2009 22:05:24 +0000 (23:05 +0100)
vapi/glib-2.0.vapi

index 34da3ee6be21295fb8a75bbf2044c2b8306df078..66493fa53ef183d6b1ac453a17878fdbf808f798 100644 (file)
@@ -888,6 +888,14 @@ public class string {
        public ulong to_ulong (out weak string endptr = null, int _base = 0);
        [CCode (cname = "g_ascii_strtoll")]
        public int64 to_int64 (out weak string endptr = null, int _base = 0);
+       public bool to_bool () {
+               if (this == "true") {
+                       return true;
+               } else {
+                       return false;
+               }
+       }
+
        [CCode (cname = "strlen")]
        public long size ();