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

Side by Side Diff: sdk/lib/io/stdio.dart

Issue 14028017: Remove .writeStream, .consume and rewrite IOSink to correctly implement a (sane) well-defined behav… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Review comments. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/io/socket.dart ('k') | tests/standalone/io/http_server_response_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart.io; 5 part of dart.io;
6 6
7 const int _STDIO_HANDLE_TYPE_TERMINAL = 0; 7 const int _STDIO_HANDLE_TYPE_TERMINAL = 0;
8 const int _STDIO_HANDLE_TYPE_PIPE = 1; 8 const int _STDIO_HANDLE_TYPE_PIPE = 1;
9 const int _STDIO_HANDLE_TYPE_FILE = 2; 9 const int _STDIO_HANDLE_TYPE_FILE = 2;
10 const int _STDIO_HANDLE_TYPE_SOCKET = 3; 10 const int _STDIO_HANDLE_TYPE_SOCKET = 3;
(...skipping 24 matching lines...) Expand all
35 Encoding get encoding => _sink.encoding; 35 Encoding get encoding => _sink.encoding;
36 void set encoding(Encoding encoding) { 36 void set encoding(Encoding encoding) {
37 _sink.encoding = encoding; 37 _sink.encoding = encoding;
38 } 38 }
39 void write(object) => _sink.write(object); 39 void write(object) => _sink.write(object);
40 void writeln([object = "" ]) => _sink.writeln(object); 40 void writeln([object = "" ]) => _sink.writeln(object);
41 void writeAll(objects, [sep = ""]) => _sink.writeAll(objects, sep); 41 void writeAll(objects, [sep = ""]) => _sink.writeAll(objects, sep);
42 void add(List<int> data) => _sink.add(data); 42 void add(List<int> data) => _sink.add(data);
43 void addError(AsyncError error) => _sink.addError(error); 43 void addError(AsyncError error) => _sink.addError(error);
44 void writeCharCode(int charCode) => _sink.writeCharCode(charCode); 44 void writeCharCode(int charCode) => _sink.writeCharCode(charCode);
45 Future consume(Stream<List<int>> stream) => _sink.consume(stream);
46 Future addStream(Stream<List<int>> stream) => _sink.addStream(stream); 45 Future addStream(Stream<List<int>> stream) => _sink.addStream(stream);
47 Future writeStream(Stream<List<int>> stream) => _sink.writeStream(stream);
48 Future close() => _sink.close(); 46 Future close() => _sink.close();
49 Future get done => _sink.done; 47 Future get done => _sink.done;
50 } 48 }
51 49
52 class StdioType { 50 class StdioType {
53 static const StdioType TERMINAL = const StdioType._("terminal"); 51 static const StdioType TERMINAL = const StdioType._("terminal");
54 static const StdioType PIPE = const StdioType._("pipe"); 52 static const StdioType PIPE = const StdioType._("pipe");
55 static const StdioType FILE = const StdioType._("file"); 53 static const StdioType FILE = const StdioType._("file");
56 static const StdioType OTHER = const StdioType._("other"); 54 static const StdioType OTHER = const StdioType._("other");
57 final String name; 55 final String name;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 } 114 }
117 return StdioType.OTHER; 115 return StdioType.OTHER;
118 } 116 }
119 117
120 118
121 class _StdIOUtils { 119 class _StdIOUtils {
122 external static IOSink _getStdioOutputStream(int fd); 120 external static IOSink _getStdioOutputStream(int fd);
123 external static Stream<List<int>> _getStdioInputStream(); 121 external static Stream<List<int>> _getStdioInputStream();
124 external static int _socketType(nativeSocket); 122 external static int _socketType(nativeSocket);
125 } 123 }
OLDNEW
« no previous file with comments | « sdk/lib/io/socket.dart ('k') | tests/standalone/io/http_server_response_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698