Mercurial > projects > qtd
annotate qt/core/QString.d @ 296:5173835bb372 signals
iteration over QList with opApply
author | eldar |
---|---|
date | Sun, 22 Nov 2009 20:43:10 +0000 |
parents | 7dd099050621 |
children | 55ee4603365d |
rev | line source |
---|---|
1 | 1 module qt.core.QString; |
2 | |
56
d5a6b6269f44
duic is working now on the first testcase, if there are any issues with it please report
eldar
parents:
33
diff
changeset
|
3 import qt.QGlobal; |
d5a6b6269f44
duic is working now on the first testcase, if there are any issues with it please report
eldar
parents:
33
diff
changeset
|
4 |
1 | 5 version (Tango) |
6 { | |
188 | 7 public import tango.text.convert.Utf : toUTF8 = toString; |
1 | 8 } |
9 else | |
10 { | |
188 | 11 public import std.utf : toUTF8; |
1 | 12 } |
13 | |
33
cf8a415f3f32
gui package is fully wrapped now. lots of fixes in the generator
eldar
parents:
1
diff
changeset
|
14 struct QString |
1 | 15 { |
33
cf8a415f3f32
gui package is fully wrapped now. lots of fixes in the generator
eldar
parents:
1
diff
changeset
|
16 public static QString opCall(void* ptr, bool proxy) { |
cf8a415f3f32
gui package is fully wrapped now. lots of fixes in the generator
eldar
parents:
1
diff
changeset
|
17 QString str; |
296 | 18 str.__nativeId = ptr; |
33
cf8a415f3f32
gui package is fully wrapped now. lots of fixes in the generator
eldar
parents:
1
diff
changeset
|
19 return str; |
cf8a415f3f32
gui package is fully wrapped now. lots of fixes in the generator
eldar
parents:
1
diff
changeset
|
20 } |
cf8a415f3f32
gui package is fully wrapped now. lots of fixes in the generator
eldar
parents:
1
diff
changeset
|
21 |
296 | 22 public void* __nativeId; |
1 | 23 |
188 | 24 public static final string toNativeString(void* qstring) { |
296 | 25 wchar* arr = qtd_QString_utf16(qstring); |
26 int size = qtd_QString_size(qstring); | |
188 | 27 return .toUTF8(arr[0..size]); |
1 | 28 } |
29 | |
188 | 30 public final string toNativeString() { |
296 | 31 return toNativeString(__nativeId); |
1 | 32 } |
33 | |
188 | 34 public void assign(string text) { |
296 | 35 qtd_QString_operatorAssign(__nativeId, text); |
1 | 36 } |
56
d5a6b6269f44
duic is working now on the first testcase, if there are any issues with it please report
eldar
parents:
33
diff
changeset
|
37 |
d5a6b6269f44
duic is working now on the first testcase, if there are any issues with it please report
eldar
parents:
33
diff
changeset
|
38 public static string fromUtf8(string source) { |
d5a6b6269f44
duic is working now on the first testcase, if there are any issues with it please report
eldar
parents:
33
diff
changeset
|
39 return source; |
d5a6b6269f44
duic is working now on the first testcase, if there are any issues with it please report
eldar
parents:
33
diff
changeset
|
40 } |
296 | 41 |
42 public static void __constructPlacedQString(void* place, string source) { | |
43 qtd_QString_new_fromUtf8_at(place, source); | |
44 } | |
45 | |
46 // service stuff | |
47 static void* __constructNativeCopy(const void* orig) { | |
48 return qtd_QString_QString_QString(cast(void*)orig); | |
49 } | |
50 | |
51 static void* __constructPlacedNativeCopy(const void* orig, void* place) { | |
52 return qtd_QString_placed_copy(orig, place); | |
53 } | |
54 | |
55 public static void __deleteNativeObject(void* ptr) { | |
56 qtd_QString_destructor(ptr); | |
57 } | |
58 | |
59 public static void __callNativeDestructor(void* ptr) { | |
60 qtd_QString_call_destructor(ptr); | |
61 } | |
62 struct QTypeInfo | |
63 { | |
64 enum bool isComplex = true; | |
65 enum bool isStatic = false; | |
66 enum bool isLarge = false; | |
67 enum bool isPointer = false; | |
68 enum bool isDummy = false; | |
69 } | |
1 | 70 } |
296 | 71 private extern(C) void* qtd_QString_placed_copy(const void* orig, void* place); |
1 | 72 |
296 | 73 private extern (C) void qtd_QString_destructor(void* __this_nativeId); |
74 private extern (C) void qtd_QString_call_destructor(void *ptr); | |
75 | |
76 private extern (C) void* qtd_QString_QString_QString(void* orig); | |
77 | |
78 private extern (C) wchar* qtd_QString_utf16(void* __this_nativeId); | |
79 private extern (C) int qtd_QString_size(void* __this_nativeId); | |
80 private extern (C) void qtd_QString_operatorAssign(void* __this_nativeId, string text); | |
81 private extern (C) void qtd_QString_new_fromUtf8_at(void* place, string text); |