diff qt/qtd/MetaMarshall.d @ 319:894d40eb89b6 signals

new signals and slots syntax. have to use prefixes now: signal_fooed and slot_onFooed
author eldar_ins@eldar-laptop
date Fri, 25 Dec 2009 21:48:32 +0500
parents ce07227f00c1
children 7a3c43424dca
line wrap: on
line diff
--- a/qt/qtd/MetaMarshall.d	Thu Dec 24 05:19:40 2009 +0500
+++ b/qt/qtd/MetaMarshall.d	Fri Dec 25 21:48:32 2009 +0500
@@ -2,49 +2,7 @@
 
 import std.traits;
 
-// utilities
-// shouldn't be here
-
-public bool startsWith(T)(T[] source, T[] pattern)
-{
-    return source.length >= pattern.length && source[0 .. pattern.length] == pattern[];
-}
-
-string __toString(long v)
-{
-    if (v == 0)
-        return "0";
-
-    string ret;
-
-    bool neg;
-    if (v < 0)
-    {
-        neg = true;
-        v = -v;
-    }
-
-    while (v != 0)
-    {
-        ret = cast(char)(v % 10 + '0') ~ ret;
-        v = cast(long)(v / 10);
-    }
-
-    if (neg)
-        ret = "-" ~ ret;
-
-    return ret;
-}
-
-template templateParam(U : V!(U), alias V)
-{
-    alias U templateParam;
-}
-
-
-/*
- * actual stuff
- */
+import qt.qtd.Meta;
 
 template isQObjectType(T) // is a QObject type that belongs to the library
 {
@@ -73,7 +31,7 @@
 
 template isQList(T)
 {
-    enum isQList = startsWith(Unqual!(T).stringof, "QList!");
+    enum isQList = ctfeStartsWith(Unqual!(T).stringof, "QList!");
 }
 
 // converts an argumnent from C++ to D in qt_metacall