Mercurial > projects > dwt2
annotate base/src/java/lang/Character.d @ 120:536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
===D2===
* added [Try]Immutable/Const/Shared templates to work with differenses in D1/D2 instead of version statements
used these templates to work with strict type storage rules of dmd-2.053
* com.ibm.icu now also compilable with D2, but not tested yet
* small fixes
Snippet288 - shared data is in TLS
===Phobos===
* fixed critical bugs in Phobos implemention
completely incorrect segfault prone fromStringz (Linux's port ruthless killer)
terrible, incorrect StringBuffer realization (StyledText killer)
* fixed small bugs as well
Snippet72 - misprint in the snippet
* implemented missed functionality for Phobos
ByteArrayOutputStream implemented (image loading available)
formatting correctly works for all DWT's cases
As a result, folowing snippets now works with Phobos (Snippet### - what is fixed):
Snippet24, 42, 111, 115, 130, 235, 276 - bad string formatting
Snippet48, 282 - crash on image loading
Snippet163, 189, 211, 213, 217, 218, 222 - crash on copy/cut in StyledText
Snippet244 - hang-up
===Tango===
* few changes for the latest Tango trunc-r5661
* few small performance improvments
===General===
* implMissing-s for only one version changed to implMissingInTango/InPhobos
* incorrect calls to Format in toString-s fixed
* fixed loading \uXXXX characters in ResourceBundle
* added good UTF-8 support for StyledText, TextLayout (Win32) and friends
UTF functions revised and tested. It is now in java.nonstandard.*Utf modules
StyledText and TextLayout (Win32) modules revised for UTF-8 support
* removed small diferences in most identical files in *.swt.* folders
*.swt.internal.image, *.swt.events and *.swt.custom are identical in Win32/Linux32
now 179 of 576 (~31%) files in *.swt.* folders are fully identical
* Win32: snippets now have right subsystem, pretty icons and native system style controls
* small fixes in snippets
Snippet44 - it's not Snippet44
Snippet212 - functions work with different images and offsets arrays
Win32: Snippet282 - crash on close if the button has an image
Snippet293 - setGrayed is commented
and others
Win32: As a result, folowing snippets now works
Snippet68 - color doesn't change
Snippet163, 189, 211, 213, 217, 218, 222 - UTF-8 issues (see above)
Snippet193 - no tabel headers
author | Denis Shelomovskij <verylonglogin.reg@gmail.com> |
---|---|
date | Sat, 09 Jul 2011 15:50:20 +0300 |
parents | fb3aa8075988 |
children | dc6fc593e8d7 |
rev | line source |
---|---|
2
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1 module java.lang.Character; |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2 |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
3 import java.lang.util; |
2
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4 import java.lang.exceptions; |
88
9e0ab372d5d8
Revert from TypeInfo/ClassInfo to java.lang.Class
Frank Benoit <benoit@tionex.de>
parents:
84
diff
changeset
|
5 import java.lang.Class; |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
6 import java.lang.String; |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
7 |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
8 version(Tango){ |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
9 static import tango.text.Unicode; |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
10 static import tango.text.UnicodeData; //for getUnicodeData |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
11 } else { // Phobos |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
12 static import std.utf; |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
13 static import std.conv; |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
14 static import std.uni; |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
15 static import std.ctype; |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
16 static import std.string; |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
17 } |
2
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
18 |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
19 class Character { |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
20 public static const int MIN_RADIX = 2; |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
21 public static const int MAX_RADIX = 36; |
2
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
22 public static bool isUpperCase( dchar c ){ |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
23 version(Tango){ |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
24 implMissingInTango( __FILE__, __LINE__); |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
25 return false; |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
26 } else { // Phobos |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
27 return !!std.uni.isUniUpper(c); |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
28 } |
99
5d5bd660917f
build some databind snippets
Frank Benoit <benoit@tionex.de>
parents:
88
diff
changeset
|
29 } |
2
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
30 public static dchar toUpperCase( dchar c ){ |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
31 version(Tango){ |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
32 dchar[1] src = c; |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
33 dchar[] r = tango.text.Unicode.toUpper( src ); |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
34 return r[0]; |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
35 } else { // Phobos |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
36 return std.uni.toUniUpper( c ); |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
37 } |
2
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
38 } |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
39 public static String toString( char c ){ |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
40 version(Tango){ |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
41 implMissingInTango(__FILE__, __LINE__ ); |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
42 return null; |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
43 } else { // Phobos |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
44 return std.conv.to!(String)( c ); |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
45 } |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
46 } |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
47 public static String toString( wchar c ){ |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
48 version(Tango){ |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
49 implMissingInTango(__FILE__, __LINE__ ); |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
50 return null; |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
51 } else { // Phobos |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
52 return std.conv.to!(String)( c ); |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
53 } |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
54 } |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
55 public static String toString( dchar c ){ |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
56 version(Tango){ |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
57 implMissingInTango(__FILE__, __LINE__ ); |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
58 return null; |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
59 } else { // Phobos |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
60 return std.conv.to!(String)( c ); |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
61 } |
9 | 62 } |
2
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
63 public static dchar toLowerCase( dchar c ){ |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
64 version(Tango){ |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
65 dchar[1] src = c; |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
66 dchar[] r = tango.text.Unicode.toLower( src ); |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
67 return r[0]; |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
68 } else { // Phobos |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
69 return std.uni.toUniLower( c ); |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
70 } |
2
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
71 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
72 public static bool isWhitespace( dchar c ){ |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
73 version(Tango){ |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
74 return tango.text.Unicode.isWhitespace( c ); |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
75 } else { // Phobos |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
76 return std.string.iswhite(c); |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
77 } |
2
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
78 } |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
79 alias isWhitespace isWhiteSpace; |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
80 public static bool isSpace( dchar c ){ |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
81 version(Tango){ |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
82 return tango.text.Unicode.isSpace(c); |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
83 } else { // Phobos |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
84 return !!std.ctype.isspace(c); |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
85 } |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
86 } |
2
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
87 public static bool isDigit( dchar c ){ |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
88 version(Tango){ |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
89 return tango.text.Unicode.isDigit( c ); |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
90 } else { // Phobos |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
91 return !!std.ctype.isdigit(c); |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
92 } |
2
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
93 } |
9 | 94 public static bool isLetter( dchar c ){ |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
95 version(Tango){ |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
96 return tango.text.Unicode.isLetter(c); |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
97 } else { // Phobos |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
98 return !!std.uni.isUniAlpha(c); |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
99 } |
9 | 100 } |
2
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
101 public static bool isLetterOrDigit( dchar c ){ |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
102 return isDigit(c) || isLetter(c); |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
103 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
104 public static bool isUnicodeIdentifierPart(char ch){ |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
105 implMissing( __FILE__, __LINE__); |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
106 return false; |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
107 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
108 public static bool isUnicodeIdentifierStart(char ch){ |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
109 implMissing( __FILE__, __LINE__); |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
110 return false; |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
111 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
112 public static bool isIdentifierIgnorable(char ch){ |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
113 implMissing( __FILE__, __LINE__); |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
114 return false; |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
115 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
116 public static bool isJavaIdentifierPart(char ch){ |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
117 implMissing( __FILE__, __LINE__); |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
118 return false; |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
119 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
120 |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
121 this( char c ){ |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
122 // must be correct for container storage |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
123 implMissing( __FILE__, __LINE__); |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
124 } |
84 | 125 |
88
9e0ab372d5d8
Revert from TypeInfo/ClassInfo to java.lang.Class
Frank Benoit <benoit@tionex.de>
parents:
84
diff
changeset
|
126 private static Class TYPE_; |
9e0ab372d5d8
Revert from TypeInfo/ClassInfo to java.lang.Class
Frank Benoit <benoit@tionex.de>
parents:
84
diff
changeset
|
127 public static Class TYPE(){ |
84 | 128 if( TYPE_ is null ){ |
88
9e0ab372d5d8
Revert from TypeInfo/ClassInfo to java.lang.Class
Frank Benoit <benoit@tionex.de>
parents:
84
diff
changeset
|
129 TYPE_ = Class.fromType!(char); |
84 | 130 } |
131 return TYPE_; | |
132 } | |
133 | |
134 public dchar charValue(){ | |
135 implMissing( __FILE__, __LINE__); | |
136 return ' '; | |
137 } | |
2
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
138 } |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
139 |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
140 bool CharacterIsDefined( dchar ch ){ |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
141 version(Tango){ |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
142 return tango.text.UnicodeData.getUnicodeData(ch) !is null; |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
143 } else { // Phobos |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
144 return std.utf.isValidDchar(ch); |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
145 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
146 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
147 |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
148 dchar CharacterToLower( dchar c ){ |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
149 return Character.toLowerCase(c); |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
150 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
151 dchar CharacterToUpper( dchar c ){ |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
152 return Character.toUpperCase(c); |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
153 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
154 bool CharacterIsWhitespace( dchar c ){ |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
155 return Character.isWhitespace(c); |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
156 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
157 bool CharacterIsDigit( dchar c ){ |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
158 return Character.isDigit(c); |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
159 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
160 bool CharacterIsLetter( dchar c ){ |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
113
diff
changeset
|
161 return Character.isLetter(c); |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
162 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
9
diff
changeset
|
163 |
84 | 164 |