|
Revision 84:00a333240696, 1.1 kB
(checked in by Frank Benoit <benoit@tionex.de>, 10 months ago)
|
FileDialog?, sync dwthelper with dwt-linux, some TCHAR issues
|
| Line | |
|---|
| 1 |
/** |
|---|
| 2 |
* Authors: Frank Benoit <keinfarbton@googlemail.com> |
|---|
| 3 |
*/ |
|---|
| 4 |
|
|---|
| 5 |
module dwt.dwthelper.InputStream; |
|---|
| 6 |
|
|---|
| 7 |
import dwt.dwthelper.utils; |
|---|
| 8 |
|
|---|
| 9 |
public abstract class InputStream { |
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
public this (){ |
|---|
| 13 |
} |
|---|
| 14 |
|
|---|
| 15 |
public abstract int read(); |
|---|
| 16 |
|
|---|
| 17 |
public int read( byte[] b ){ |
|---|
| 18 |
foreach( uint idx, inout byte val; b ){ |
|---|
| 19 |
int c = read(); |
|---|
| 20 |
if( c == -1 ){ |
|---|
| 21 |
return ( idx == 0 ) ? -1 : idx; |
|---|
| 22 |
} |
|---|
| 23 |
b[ idx] = cast(byte)( c & 0xFF ); |
|---|
| 24 |
} |
|---|
| 25 |
return b.length; |
|---|
| 26 |
} |
|---|
| 27 |
|
|---|
| 28 |
public int read( byte[] b, int off, int len ){ |
|---|
| 29 |
return read( b[ off .. off+len ] ); |
|---|
| 30 |
} |
|---|
| 31 |
|
|---|
| 32 |
public long skip( long n ){ |
|---|
| 33 |
implMissing( __FILE__, __LINE__ ); |
|---|
| 34 |
return 0L; |
|---|
| 35 |
} |
|---|
| 36 |
|
|---|
| 37 |
public int available(){ |
|---|
| 38 |
return 0; |
|---|
| 39 |
} |
|---|
| 40 |
|
|---|
| 41 |
public void close(){ |
|---|
| 42 |
implMissing( __FILE__, __LINE__ ); |
|---|
| 43 |
} |
|---|
| 44 |
|
|---|
| 45 |
public synchronized void mark( int readlimit ){ |
|---|
| 46 |
implMissing( __FILE__, __LINE__ ); |
|---|
| 47 |
} |
|---|
| 48 |
|
|---|
| 49 |
public synchronized void reset(){ |
|---|
| 50 |
implMissing( __FILE__, __LINE__ ); |
|---|
| 51 |
} |
|---|
| 52 |
|
|---|
| 53 |
public bool markSupported(){ |
|---|
| 54 |
implMissing( __FILE__, __LINE__ ); |
|---|
| 55 |
return false; |
|---|
| 56 |
} |
|---|
| 57 |
|
|---|
| 58 |
|
|---|
| 59 |
} |
|---|