Changeset 2840
- Timestamp:
- 11/10/07 00:48:18 (1 year ago)
- Files:
-
- branches/experimental/D2.0/tango/io/FilePath.d (modified) (1 diff)
- branches/experimental/D2.0/tango/io/compress/BzipStream.d (modified) (2 diffs)
- branches/experimental/D2.0/tango/io/compress/ZlibStream.d (modified) (2 diffs)
- branches/experimental/D2.0/tango/io/compress/c/bzlib.d (modified) (1 diff)
- branches/experimental/D2.0/tango/io/compress/c/zlib.d (modified) (2 diffs)
- branches/experimental/D2.0/tango/io/protocol/EndianProtocol.d (modified) (1 diff)
- branches/experimental/D2.0/tango/io/stream/EndianStream.d (modified) (1 diff)
- branches/experimental/D2.0/tango/io/stream/MapStream.d (modified) (6 diffs)
- branches/experimental/D2.0/tango/io/stream/TypedStream.d (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/experimental/D2.0/tango/io/FilePath.d
r2810 r2840 340 340 ***********************************************************************/ 341 341 342 final override int opEquals (c har[] s)342 final override int opEquals (const(char)[] s) 343 343 { 344 344 return toUtf8() == s; branches/experimental/D2.0/tango/io/compress/BzipStream.d
r2810 r2840 120 120 ***************************************************************************/ 121 121 122 uint write(void[] src)122 override uint write(const(void)[] src) 123 123 { 124 124 check_valid(); … … 126 126 127 127 bzs.avail_in = src.length; 128 bzs.next_in = cast( ubyte*)src.ptr;128 bzs.next_in = cast(const(ubyte)*)src.ptr; 129 129 130 130 do branches/experimental/D2.0/tango/io/compress/ZlibStream.d
r2810 r2840 279 279 ***************************************************************************/ 280 280 281 uint write(void[] src)281 override uint write(const(void)[] src) 282 282 { 283 283 check_valid(); … … 285 285 286 286 zs.avail_in = src.length; 287 zs.next_in = cast( ubyte*)src.ptr;287 zs.next_in = cast(const(ubyte)*)src.ptr; 288 288 289 289 do branches/experimental/D2.0/tango/io/compress/c/bzlib.d
r2810 r2840 45 45 struct bz_stream 46 46 { 47 ubyte*next_in;47 const(ubyte) *next_in; 48 48 uint avail_in; 49 49 uint total_in_lo32; branches/experimental/D2.0/tango/io/compress/c/zlib.d
r2810 r2840 93 93 alias uLong uLongf; 94 94 95 alias void* voidpc; // TODO: normally const95 alias const(void)* voidpc; // TODO: normally const 96 96 alias void* voidpf; 97 97 alias void* voidp; … … 105 105 struct z_stream 106 106 { 107 Bytef* next_in; /* next input byte */ 107 const(Bytef)* next_in; /* next input byte 108 NOTE: this isn't really const in the real 109 C zlib, but it should not be written to.*/ 108 110 uInt avail_in; /* number of bytes available at next_in */ 109 111 uLong total_in; /* total nb of input bytes read so far */ branches/experimental/D2.0/tango/io/protocol/EndianProtocol.d
r2810 r2840 153 153 154 154 char[] mule; 155 c har[] test = "testing testing 123";155 const(char)[] test = "testing testing 123"; 156 156 157 157 auto protocol = new EndianProtocol (new Buffer(32)); branches/experimental/D2.0/tango/io/stream/EndianStream.d
r2810 r2840 169 169 unittest 170 170 { 171 auto inp = new EndianInput!(dchar)(new Buffer("hello world"d ));171 auto inp = new EndianInput!(dchar)(new Buffer("hello world"d.dup)); 172 172 auto oot = new EndianOutput!(dchar)(new Buffer(64)); 173 173 oot.copy (inp); branches/experimental/D2.0/tango/io/stream/MapStream.d
r2810 r2840 93 93 ***********************************************************************/ 94 94 95 final MapInput load (ref T[][T[]] properties)95 final MapInput load (ref const(T)[][const(T)[]] properties) 96 96 { 97 97 foreach (name, value; this) 98 properties[name ] = value;98 properties[name.dup] = value.dup; 99 99 return this; 100 100 } … … 116 116 private const T[] equals = " = "; 117 117 version (Win32) 118 private const T[] NL = "\r\n";118 private const const(T)[] NL = "\r\n"; 119 119 version (Posix) 120 private const T[] NL = "\n";120 private const const(T)[] NL = "\n"; 121 121 122 122 /*********************************************************************** … … 126 126 ***********************************************************************/ 127 127 128 this (OutputStream stream, T[] newline = NL)128 this (OutputStream stream, const(T)[] newline = NL) 129 129 { 130 130 super (output = Buffer.share (stream)); … … 148 148 ***********************************************************************/ 149 149 150 final MapOutput append ( T[] name, T[] value)150 final MapOutput append (const(T)[] name, const(T)[] value) 151 151 { 152 152 output (name) (equals) (value) (NL); … … 160 160 ***********************************************************************/ 161 161 162 final MapOutput append ( T[][T[]] properties)162 final MapOutput append (const(T)[][const(T)[]] properties) 163 163 { 164 164 foreach (key, value; properties) … … 185 185 auto output = new MapOutput!(char)(buf); 186 186 187 char[][char[]] map;187 Cutf8[Cutf8] map; 188 188 map["foo"] = "bar"; 189 189 map["foo2"] = "bar2"; branches/experimental/D2.0/tango/io/stream/TypedStream.d
r2810 r2840 147 147 unittest 148 148 { 149 auto inp = new TypedInput!(char)(new Buffer("hello world" ));149 auto inp = new TypedInput!(char)(new Buffer("hello world".dup)); 150 150 auto oot = new TypedOutput!(char)(new Buffer(20)); 151 151 … … 154 154 assert (oot.buffer.slice == "hello world"); 155 155 156 auto xx = new TypedInput!(char)(new UtfInput!(char, dchar)(new Buffer("hello world"d )));156 auto xx = new TypedInput!(char)(new UtfInput!(char, dchar)(new Buffer("hello world"d.dup))); 157 157 char[] yy; 158 158 foreach (x; xx)












