Changeset 262:e10de397beb1
- Timestamp:
- 07/06/08 09:33:12
(3 months ago)
- Author:
- Frank Benoit <benoit@tionex.de>
- branch:
- default
- Message:
ADD version TANGOSVN
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r257 |
r262 |
|
| 6 | 6 | public import dwt.dwthelper.OutputStream; |
|---|
| 7 | 7 | import dwt.dwthelper.utils; |
|---|
| 8 | | import tango.io.GrowBuffer; |
|---|
| | 8 | import tango.io.Buffer; |
|---|
| | 9 | version(TANGOSVN) |
|---|
| | 10 | import tango.io.Buffer; |
|---|
| | 11 | } |
|---|
| | 12 | else{ |
|---|
| | 13 | import tango.io.GrowBuffer; |
|---|
| | 14 | } |
|---|
| 9 | 15 | |
|---|
| 10 | 16 | public class ByteArrayOutputStream : dwt.dwthelper.OutputStream.OutputStream { |
|---|
| r238 |
r262 |
|
| 6 | 6 | import dwt.dwthelper.utils; |
|---|
| 7 | 7 | |
|---|
| 8 | | static import tango.io.FileConst; |
|---|
| | 8 | version(TANGOSVN) |
|---|
| | 9 | static import tango.io.model.IFile; |
|---|
| | 10 | } |
|---|
| | 11 | else{ |
|---|
| | 12 | static import tango.io.FileConst; |
|---|
| | 13 | } |
|---|
| 9 | 14 | static import tango.io.FilePath; |
|---|
| 10 | 15 | static import tango.io.FileSystem; |
|---|
| … | … | |
| 20 | 25 | |
|---|
| 21 | 26 | static this(){ |
|---|
| | 27 | version(TANGOSVN) |
|---|
| | 28 | separator = tango.io.model.IFile.FileConst.PathSeparatorString; |
|---|
| | 29 | separatorChar = tango.io.model.IFile.FileConst.PathSeparatorChar; |
|---|
| | 30 | pathSeparator = tango.io.model.IFile.FileConst.SystemPathString; |
|---|
| | 31 | pathSeparatorChar = tango.io.model.IFile.FileConst.SystemPathChar; |
|---|
| | 32 | } |
|---|
| | 33 | else{ |
|---|
| 22 | 34 | separator = tango.io.FileConst.FileConst.PathSeparatorString; |
|---|
| 23 | 35 | separatorChar = tango.io.FileConst.FileConst.PathSeparatorChar; |
|---|
| 24 | 36 | pathSeparator = tango.io.FileConst.FileConst.SystemPathString; |
|---|
| 25 | 37 | pathSeparatorChar = tango.io.FileConst.FileConst.SystemPathChar; |
|---|
| | 38 | } |
|---|
| 26 | 39 | } |
|---|
| 27 | 40 | |
|---|
| r134 |
r262 |
|
| 8 | 8 | import tango.io.Stdout; |
|---|
| 9 | 9 | import tango.io.compress.ZlibStream; |
|---|
| 10 | | |
|---|
| | 10 | version(TANGOSVN) |
|---|
| | 11 | import tango.io.Conduit; |
|---|
| | 12 | } |
|---|
| 11 | 13 | class InputStreamWrapper : tango.io.model.IConduit.InputStream { |
|---|
| 12 | 14 | |
|---|
| … | … | |
| 21 | 23 | return res; |
|---|
| 22 | 24 | } |
|---|
| | 25 | version(TANGOSVN) |
|---|
| | 26 | void[] load (void[] dst = null) { |
|---|
| | 27 | return Conduit.load (this, dst); |
|---|
| | 28 | } |
|---|
| | 29 | } |
|---|
| | 30 | |
|---|
| 23 | 31 | |
|---|
| 24 | 32 | tango.io.model.IConduit.InputStream clear (){ |
|---|
| r255 |
r262 |
|
| 150 | 150 | |
|---|
| 151 | 151 | public static String toHexString( int i ){ |
|---|
| | 152 | version(TANGOSVN) |
|---|
| | 153 | return tango.text.convert.Integer.toString(i, "x" ); |
|---|
| | 154 | } |
|---|
| | 155 | else{ |
|---|
| 152 | 156 | return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Hex ); |
|---|
| | 157 | } |
|---|
| 153 | 158 | } |
|---|
| 154 | 159 | |
|---|
| 155 | 160 | public static String toOctalString( int i ){ |
|---|
| | 161 | version(TANGOSVN) |
|---|
| | 162 | return tango.text.convert.Integer.toString(i, "o" ); |
|---|
| | 163 | } |
|---|
| | 164 | else{ |
|---|
| 156 | 165 | return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Octal ); |
|---|
| | 166 | } |
|---|
| 157 | 167 | } |
|---|
| 158 | 168 | |
|---|
| 159 | 169 | public static String toBinaryString( int i ){ |
|---|
| | 170 | version(TANGOSVN) |
|---|
| | 171 | return tango.text.convert.Integer.toString(i, "b" ); |
|---|
| | 172 | } |
|---|
| | 173 | else{ |
|---|
| 160 | 174 | return tango.text.convert.Integer.toString(i, tango.text.convert.Integer.Style.Binary ); |
|---|
| | 175 | } |
|---|
| 161 | 176 | } |
|---|
| 162 | 177 | |
|---|
| … | … | |
| 636 | 651 | |
|---|
| 637 | 652 | static String toHex(uint value, bool prefix = true, int radix = 8){ |
|---|
| | 653 | version(TANGOSVN) |
|---|
| | 654 | return tango.text.convert.Integer.toString( |
|---|
| | 655 | value, |
|---|
| | 656 | radix is 10 ? "d" : |
|---|
| | 657 | radix is 8 ? "o" : |
|---|
| | 658 | radix is 16 ? "x" : |
|---|
| | 659 | "d" ); |
|---|
| | 660 | } |
|---|
| | 661 | else{ |
|---|
| 638 | 662 | return tango.text.convert.Integer.toString( |
|---|
| 639 | 663 | value, |
|---|
| … | … | |
| 645 | 669 | ); |
|---|
| 646 | 670 | } |
|---|
| | 671 | } |
|---|
| 647 | 672 | |
|---|
| 648 | 673 | class RuntimeException : Exception { |
|---|