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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
1 module dmd.Utf;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
2
114
e28b18c23469 added a module dmd.common for commonly used stuff
Trass3r
parents: 20
diff changeset
3 import dmd.common;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
4 import dmd.Dchar;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
5
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
6 import std.utf;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
7
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
8 string utf_decodeChar(const(char)[] s, size_t* pidx, dchar* presult)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
9 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
10 try {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
11 *presult = decode(s, *pidx);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
12 } catch (Exception e) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
13 return e.toString();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
14 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
15
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
16 return null;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
17 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
18
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
19 string utf_decodeWchar(const(wchar)[] s, size_t* pidx, dchar* presult)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
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
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
28 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
29
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
30 bool utf_isValidDchar(uint c)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
31 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
32 return isValidDchar(c);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
33 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
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);