Mercurial > projects > qtd
comparison d2/qtd/String.d @ 357:9784459f0750
An attempt (failed due to optlink) to improve locality of declarations exported from QtD executables
Q_CLASSINFO implementation
Now Qtd can be built on Windows
author | Max Samukha <maxter@spambox.com> |
---|---|
date | Wed, 02 Jun 2010 19:38:05 +0300 |
parents | 12cec2d14e1c |
children | da4235301224 |
comparison
equal
deleted
inserted
replaced
356:12cec2d14e1c | 357:9784459f0750 |
---|---|
9 * | 9 * |
10 */ | 10 */ |
11 | 11 |
12 module qtd.String; | 12 module qtd.String; |
13 | 13 |
14 import core.stdc.string; | 14 import |
15 core.stdc.string, | |
16 qtd.Core; | |
15 import std.utf : toUTF8; | 17 import std.utf : toUTF8; |
16 | 18 |
17 alias immutable(char)* stringz; | 19 alias immutable(char)* stringz; |
18 alias const(char)* cstringz; | 20 alias const(char)* cstringz; |
19 | 21 |
65 string fromStringz(const (char) *s) | 67 string fromStringz(const (char) *s) |
66 { | 68 { |
67 return s ? s[0 .. strlen(s)].idup : cast(string)null; | 69 return s ? s[0 .. strlen(s)].idup : cast(string)null; |
68 } | 70 } |
69 | 71 |
70 extern(C) void qtd_toUtf8(wchar* arr, uint size, string* str) | 72 mixin(qtdExport("void", "toUtf8", "wchar* arr, uint size, string* str", |
71 { | 73 q{ |
72 *str = toUTF8(arr[0..size]); | 74 *str = toUTF8(arr[0..size]); |
73 } | 75 })); |
74 | 76 |
75 | 77 |
76 | 78 |
79 |