Mercurial > projects > ddmd
annotate dmd/Utf.d @ 114:e28b18c23469
added a module dmd.common for commonly used stuff
it currently holds code for consistency checking of predefined versions
also added a VisualD project file
author | Trass3r |
---|---|
date | Wed, 01 Sep 2010 18:21:58 +0200 |
parents | 1628b221808d |
children |
rev | line source |
---|---|
0 | 1 module dmd.Utf; |
2 | |
114 | 3 import dmd.common; |
0 | 4 import dmd.Dchar; |
5 | |
6 import std.utf; | |
7 | |
8 string utf_decodeChar(const(char)[] s, size_t* pidx, dchar* presult) | |
9 { | |
10 try { | |
11 *presult = decode(s, *pidx); | |
12 } catch (Exception e) { | |
13 return e.toString(); | |
14 } | |
15 | |
16 return null; | |
17 } | |
18 | |
19 string utf_decodeWchar(const(wchar)[] s, size_t* pidx, dchar* presult) | |
20 { | |
20
1628b221808d
Fleshed out more unimplemented methods.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
21 try { |
1628b221808d
Fleshed out more unimplemented methods.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
22 *presult = decode(s, *pidx); |
1628b221808d
Fleshed out more unimplemented methods.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
23 } catch (Exception e) { |
1628b221808d
Fleshed out more unimplemented methods.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
24 return e.toString(); |
1628b221808d
Fleshed out more unimplemented methods.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
25 } |
1628b221808d
Fleshed out more unimplemented methods.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
26 |
1628b221808d
Fleshed out more unimplemented methods.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
27 return null; |
0 | 28 } |
29 | |
30 bool utf_isValidDchar(uint c) | |
31 { | |
32 return isValidDchar(c); | |
33 } | |
34 | |
20
1628b221808d
Fleshed out more unimplemented methods.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
35 extern (C++) extern int HtmlNamedEntity(ubyte* p, int length); |