OLD | NEW |
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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 _StdSink(IOSink this._sink); | 155 _StdSink(IOSink this._sink); |
156 | 156 |
157 Encoding get encoding => _sink.encoding; | 157 Encoding get encoding => _sink.encoding; |
158 void set encoding(Encoding encoding) { | 158 void set encoding(Encoding encoding) { |
159 _sink.encoding = encoding; | 159 _sink.encoding = encoding; |
160 } | 160 } |
161 void write(object) => _sink.write(object); | 161 void write(object) => _sink.write(object); |
162 void writeln([object = "" ]) => _sink.writeln(object); | 162 void writeln([object = "" ]) => _sink.writeln(object); |
163 void writeAll(objects, [sep = ""]) => _sink.writeAll(objects, sep); | 163 void writeAll(objects, [sep = ""]) => _sink.writeAll(objects, sep); |
164 void add(List<int> data) => _sink.add(data); | 164 void add(List<int> data) => _sink.add(data); |
165 void addError(error) => _sink.addError(error); | 165 void addError(error, [StackTrace stackTrace]) => |
| 166 _sink.addError(error, stackTrace); |
166 void writeCharCode(int charCode) => _sink.writeCharCode(charCode); | 167 void writeCharCode(int charCode) => _sink.writeCharCode(charCode); |
167 Future addStream(Stream<List<int>> stream) => _sink.addStream(stream); | 168 Future addStream(Stream<List<int>> stream) => _sink.addStream(stream); |
168 Future close() => _sink.close(); | 169 Future close() => _sink.close(); |
169 Future get done => _sink.done; | 170 Future get done => _sink.done; |
170 } | 171 } |
171 | 172 |
172 class StdioType { | 173 class StdioType { |
173 static const StdioType TERMINAL = const StdioType._("terminal"); | 174 static const StdioType TERMINAL = const StdioType._("terminal"); |
174 static const StdioType PIPE = const StdioType._("pipe"); | 175 static const StdioType PIPE = const StdioType._("pipe"); |
175 static const StdioType FILE = const StdioType._("file"); | 176 static const StdioType FILE = const StdioType._("file"); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 } | 237 } |
237 return StdioType.OTHER; | 238 return StdioType.OTHER; |
238 } | 239 } |
239 | 240 |
240 | 241 |
241 class _StdIOUtils { | 242 class _StdIOUtils { |
242 external static IOSink _getStdioOutputStream(int fd); | 243 external static IOSink _getStdioOutputStream(int fd); |
243 external static Stdin _getStdioInputStream(); | 244 external static Stdin _getStdioInputStream(); |
244 external static int _socketType(nativeSocket); | 245 external static int _socketType(nativeSocket); |
245 } | 246 } |
OLD | NEW |