Mercurial > projects > qtd
annotate qt/core/QString.d @ 33:cf8a415f3f32
gui package is fully wrapped now. lots of fixes in the generator
author | eldar |
---|---|
date | Sat, 16 May 2009 17:12:06 +0000 |
parents | e78566595089 |
children | d5a6b6269f44 |
rev | line source |
---|---|
1 | 1 module qt.core.QString; |
2 | |
3 version (Tango) | |
4 { | |
5 import tango.text.convert.Utf : toString; | |
6 } | |
7 else | |
8 { | |
9 import std.utf : toString = toUTF8; | |
10 } | |
11 | |
33
cf8a415f3f32
gui package is fully wrapped now. lots of fixes in the generator
eldar
parents:
1
diff
changeset
|
12 struct QString |
1 | 13 { |
33
cf8a415f3f32
gui package is fully wrapped now. lots of fixes in the generator
eldar
parents:
1
diff
changeset
|
14 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
|
15 QString str; |
cf8a415f3f32
gui package is fully wrapped now. lots of fixes in the generator
eldar
parents:
1
diff
changeset
|
16 str.native_id = ptr; |
cf8a415f3f32
gui package is fully wrapped now. lots of fixes in the generator
eldar
parents:
1
diff
changeset
|
17 return str; |
cf8a415f3f32
gui package is fully wrapped now. lots of fixes in the generator
eldar
parents:
1
diff
changeset
|
18 } |
cf8a415f3f32
gui package is fully wrapped now. lots of fixes in the generator
eldar
parents:
1
diff
changeset
|
19 |
1 | 20 private void* native_id; |
21 | |
22 public static final char[] toNativeString(void* qstring) { | |
23 wchar* arr = __qtd_QString_utf16(qstring); | |
24 int size = __qtd_QString_size(qstring); | |
25 return .toString(arr[0..size]); | |
26 } | |
27 | |
28 public final char[] toNativeString() { | |
29 return toNativeString(native_id); | |
30 } | |
31 | |
32 public void assign(char[] text) { | |
33 __qtd_QString_operatorAssign(native_id, text.ptr, text.length); | |
34 } | |
35 } | |
36 | |
37 private extern (C) wchar* __qtd_QString_utf16(void* __this_nativeId); | |
38 private extern (C) int __qtd_QString_size(void* __this_nativeId); | |
39 private extern (C) void __qtd_QString_operatorAssign(void* __this_nativeId, char* text, uint text_size); |