Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(385)

Unified Diff: sdk/lib/io/stdio.dart

Issue 13929002: Also wrap stdin/stdout/stderr on Process. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/stdio_patch.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/stdio.dart
diff --git a/sdk/lib/io/stdio.dart b/sdk/lib/io/stdio.dart
index a5d4012ad2aa323f0990c118f6dfafbb2854e878..216ba381a28534ebd7f27bfba6617656ecd95bd4 100644
--- a/sdk/lib/io/stdio.dart
+++ b/sdk/lib/io/stdio.dart
@@ -10,16 +10,16 @@ const int _STDIO_HANDLE_TYPE_FILE = 2;
const int _STDIO_HANDLE_TYPE_SOCKET = 3;
const int _STDIO_HANDLE_TYPE_OTHER = 4;
-class _Stdin extends Stream<List<int>> {
- final Stream<List<int>> _stdin;
+class _StdStream extends Stream<List<int>> {
+ final Stream<List<int>> _stream;
- _Stdin(Stream<List<int>> this._stdin);
+ _StdStream(Stream<List<int>> this._stream);
StreamSubscription<List<int>> listen(void onData(List<int> event),
{void onError(AsyncError error),
void onDone(),
bool unsubscribeOnError}) {
- return _stdin.listen(
+ return _stream.listen(
onData,
onError: onError,
onDone: onDone,
@@ -28,25 +28,24 @@ class _Stdin extends Stream<List<int>> {
}
class _StdSink implements IOSink {
- final IOSink _ioSink;
+ final IOSink _sink;
- _StdSink(IOSink this._ioSink);
+ _StdSink(IOSink this._sink);
- Encoding get encoding => _ioSink.encoding;
+ Encoding get encoding => _sink.encoding;
void set encoding(Encoding encoding) {
- _ioSink.encoding = encoding;
+ _sink.encoding = encoding;
}
- void write(object) => _ioSink.write(object);
- void writeln([object = "" ]) => _ioSink.writeln(object);
- void writeAll(objects, [sep = ""]) => _ioSink.writeAll(objects, sep);
- void writeBytes(List<int> data) => _ioSink.writeBytes(data);
- void writeCharCode(int charCode) => _ioSink.writeCharCode(charCode);
- Future consume(Stream<List<int>> stream) => _ioSink.consume(stream);
- Future addStream(Stream<List<int>> stream) => _ioSink.addStream(stream);
- Future writeStream(Stream<List<int>> stream)
- => _ioSink.writeStream(stream);
- Future close() => _ioSink.close();
- Future get done => _ioSink.done;
+ void write(object) => _sink.write(object);
+ void writeln([object = "" ]) => _sink.writeln(object);
+ void writeAll(objects, [sep = ""]) => _sink.writeAll(objects, sep);
+ void writeBytes(List<int> data) => _sink.writeBytes(data);
+ void writeCharCode(int charCode) => _sink.writeCharCode(charCode);
+ Future consume(Stream<List<int>> stream) => _sink.consume(stream);
+ Future addStream(Stream<List<int>> stream) => _sink.addStream(stream);
+ Future writeStream(Stream<List<int>> stream) => _sink.writeStream(stream);
+ Future close() => _sink.close();
+ Future get done => _sink.done;
}
class StdioType {
@@ -90,10 +89,10 @@ IOSink get stderr {
StdioType stdioType(object) {
- if (object is _Stdin) {
- object = object._stdin;
+ if (object is _StdStream) {
+ object = object._stream;
} else if (object is _StdSink) {
- object = object._ioSink;
+ object = object._sink;
}
if (object is _FileStream) {
return StdioType.FILE;
« no previous file with comments | « runtime/bin/stdio_patch.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698