annotate qt/core/QString.d @ 188:7dd099050621

initial commit for D2 support
author eldar
date Sun, 12 Jul 2009 18:58:03 +0000
parents d5a6b6269f44
children 5173835bb372
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
e78566595089 initial import
mandel
parents:
diff changeset
1 module qt.core.QString;
e78566595089 initial import
mandel
parents:
diff changeset
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
e78566595089 initial import
mandel
parents:
diff changeset
5 version (Tango)
e78566595089 initial import
mandel
parents:
diff changeset
6 {
188
7dd099050621 initial commit for D2 support
eldar
parents: 56
diff changeset
7 public import tango.text.convert.Utf : toUTF8 = toString;
1
e78566595089 initial import
mandel
parents:
diff changeset
8 }
e78566595089 initial import
mandel
parents:
diff changeset
9 else
e78566595089 initial import
mandel
parents:
diff changeset
10 {
188
7dd099050621 initial commit for D2 support
eldar
parents: 56
diff changeset
11 public import std.utf : toUTF8;
1
e78566595089 initial import
mandel
parents:
diff changeset
12 }
e78566595089 initial import
mandel
parents:
diff changeset
13
33
cf8a415f3f32 gui package is fully wrapped now. lots of fixes in the generator
eldar
parents: 1
diff changeset
14 struct QString
1
e78566595089 initial import
mandel
parents:
diff changeset
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;
cf8a415f3f32 gui package is fully wrapped now. lots of fixes in the generator
eldar
parents: 1
diff changeset
18 str.native_id = ptr;
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
1
e78566595089 initial import
mandel
parents:
diff changeset
22 private void* native_id;
e78566595089 initial import
mandel
parents:
diff changeset
23
188
7dd099050621 initial commit for D2 support
eldar
parents: 56
diff changeset
24 public static final string toNativeString(void* qstring) {
1
e78566595089 initial import
mandel
parents:
diff changeset
25 wchar* arr = __qtd_QString_utf16(qstring);
e78566595089 initial import
mandel
parents:
diff changeset
26 int size = __qtd_QString_size(qstring);
188
7dd099050621 initial commit for D2 support
eldar
parents: 56
diff changeset
27 return .toUTF8(arr[0..size]);
1
e78566595089 initial import
mandel
parents:
diff changeset
28 }
e78566595089 initial import
mandel
parents:
diff changeset
29
188
7dd099050621 initial commit for D2 support
eldar
parents: 56
diff changeset
30 public final string toNativeString() {
1
e78566595089 initial import
mandel
parents:
diff changeset
31 return toNativeString(native_id);
e78566595089 initial import
mandel
parents:
diff changeset
32 }
e78566595089 initial import
mandel
parents:
diff changeset
33
188
7dd099050621 initial commit for D2 support
eldar
parents: 56
diff changeset
34 public void assign(string text) {
7dd099050621 initial commit for D2 support
eldar
parents: 56
diff changeset
35 __qtd_QString_operatorAssign(native_id, text);
1
e78566595089 initial import
mandel
parents:
diff changeset
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 }
188
7dd099050621 initial commit for D2 support
eldar
parents: 56
diff changeset
41 /*
7dd099050621 initial commit for D2 support
eldar
parents: 56
diff changeset
42 public static string fromUtf16(wstring src) {
7dd099050621 initial commit for D2 support
eldar
parents: 56
diff changeset
43 version(Tango)
7dd099050621 initial commit for D2 support
eldar
parents: 56
diff changeset
44 }*/
1
e78566595089 initial import
mandel
parents:
diff changeset
45 }
e78566595089 initial import
mandel
parents:
diff changeset
46
e78566595089 initial import
mandel
parents:
diff changeset
47 private extern (C) wchar* __qtd_QString_utf16(void* __this_nativeId);
e78566595089 initial import
mandel
parents:
diff changeset
48 private extern (C) int __qtd_QString_size(void* __this_nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents: 56
diff changeset
49 private extern (C) void __qtd_QString_operatorAssign(void* __this_nativeId, string text);