[vala] glib-2.0: Add string.to_bool()



commit 66d126e6bebca5cb6ea286979764b3ce15da24a7
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Mon Mar 9 16:52:07 2009 +0200

    glib-2.0: Add string.to_bool()
---
 vapi/glib-2.0.vapi |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi
index 34da3ee..66493fa 100644
--- a/vapi/glib-2.0.vapi
+++ b/vapi/glib-2.0.vapi
@@ -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 ();
 



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