Mercurial > projects > dwt2
comparison java/src/java/mangoicu/UText.d @ 21:9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 19 Mar 2009 20:38:55 +0100 |
parents | dbfb303e8fb0 |
children |
comparison
equal
deleted
inserted
replaced
20:dccb717aa902 | 21:9b96950f2c3c |
---|---|
117 | 117 |
118 private enum { | 118 private enum { |
119 UTEXT_MAGIC = 0x345ad82c | 119 UTEXT_MAGIC = 0x345ad82c |
120 } | 120 } |
121 void close(){ | 121 void close(){ |
122 utext_close(this); | 122 version(D_Version2){ |
123 utext_close(&this); | |
124 } else { | |
125 utext_close(this); | |
126 } | |
123 } | 127 } |
124 private void ensureStatusOk( ICU.UErrorCode status ){ | 128 private void ensureStatusOk( ICU.UErrorCode status ){ |
125 if( status !is ICU.UErrorCode.OK ){ | 129 if( status !is ICU.UErrorCode.OK ){ |
126 throw new Exception( "ICU Exception" ); | 130 throw new Exception( "ICU Exception" ); |
127 } | 131 } |
128 } | 132 } |
129 void openUTF8( char[] str ){ | 133 void openUTF8( char[] str ){ |
130 auto status = ICU.UErrorCode.OK; | 134 auto status = ICU.UErrorCode.OK; |
131 utext_openUTF8(this, str.ptr, str.length, status ); | 135 version(D_Version2){ |
136 utext_openUTF8(&this, str.ptr, str.length, status ); | |
137 } else { | |
138 utext_openUTF8(this, str.ptr, str.length, status ); | |
139 } | |
132 ensureStatusOk( status ); | 140 ensureStatusOk( status ); |
133 } | 141 } |
134 | 142 |
135 | 143 |
136 /*********************************************************************** | 144 /*********************************************************************** |