Skip to content

Commit

Permalink
Merge pull request #3319 from burner/stream_deprecate
Browse files Browse the repository at this point in the history
deprecate std.stream and friends
  • Loading branch information
ibuclaw committed May 28, 2015
2 parents a26c6c6 + 787637d commit 61abc17
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion std/cstream.d
Expand Up @@ -21,7 +21,7 @@
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
module std.cstream;
deprecated module std.cstream;

public import core.stdc.stdio;
public import std.stream;
Expand Down
16 changes: 8 additions & 8 deletions std/net/curl.d
Expand Up @@ -167,7 +167,6 @@ import std.encoding;
import std.exception;
import std.regex;
import std.socket : InternetAddress;
import std.stream;
import std.string;
import std.traits;
import std.typecons;
Expand Down Expand Up @@ -291,9 +290,8 @@ void download(Conn = AutoProtocol)(const(char)[] url, string saveToPath, Conn co
static if (is(Conn : HTTP) || is(Conn : FTP))
{
conn.url = url;
auto f = new std.stream.BufferedFile(saveToPath, FileMode.OutNew);
scope (exit) f.close();
conn.onReceive = (ubyte[] data) { return f.write(data); };
auto f = File(saveToPath, "w");
conn.onReceive = (ubyte[] data) { f.write(data); return data.length; };
conn.perform();
}
else
Expand Down Expand Up @@ -351,13 +349,15 @@ void upload(Conn = AutoProtocol)(string loadFromPath, const(char)[] url, Conn co

static if (is(Conn : HTTP) || is(Conn : FTP))
{
auto f = new std.stream.BufferedFile(loadFromPath, FileMode.In);
scope (exit) f.close();
static import std.file;
void[] f;

conn.onSend = (void[] data)
{
return f.read(cast(ubyte[])data);
f = std.file.read(loadFromPath);
return f.length;
};
conn.contentLength = cast(size_t)f.size;
conn.contentLength = f.length;
conn.perform();
}
}
Expand Down
2 changes: 1 addition & 1 deletion std/socketstream.d
Expand Up @@ -37,7 +37,7 @@
* Macros: WIKI=Phobos/StdSocketstream
*/

module std.socketstream;
deprecated module std.socketstream;

private import std.stream;
private import std.socket;
Expand Down
2 changes: 1 addition & 1 deletion std/stream.d
Expand Up @@ -27,7 +27,7 @@
* "as is" without express or implied warranty.
*/

module std.stream;
deprecated module std.stream;


import std.internal.cstring;
Expand Down
5 changes: 0 additions & 5 deletions std/typecons.d
Expand Up @@ -3011,11 +3011,6 @@ unittest
inout(Object) foo() inout;
}
BlackHole!Foo o;

// Bugzilla 12464
import std.stream;
import std.typecons;
BlackHole!OutputStream dout;
}


Expand Down

0 comments on commit 61abc17

Please sign in to comment.