| 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 247 |
| 248 class _StdSink implements IOSink { | 248 class _StdSink implements IOSink { |
| 249 final IOSink _sink; | 249 final IOSink _sink; |
| 250 | 250 |
| 251 _StdSink(this._sink); | 251 _StdSink(this._sink); |
| 252 | 252 |
| 253 Encoding get encoding => _sink.encoding; | 253 Encoding get encoding => _sink.encoding; |
| 254 void set encoding(Encoding encoding) { | 254 void set encoding(Encoding encoding) { |
| 255 _sink.encoding = encoding; | 255 _sink.encoding = encoding; |
| 256 } | 256 } |
| 257 void write(object) => _sink.write(object); | 257 void write(object) { _sink.write(object); } |
| 258 void writeln([object = "" ]) => _sink.writeln(object); | 258 void writeln([object = "" ]) { _sink.writeln(object); } |
| 259 void writeAll(objects, [sep = ""]) => _sink.writeAll(objects, sep); | 259 void writeAll(objects, [sep = ""]) { _sink.writeAll(objects, sep); } |
| 260 void add(List<int> data) => _sink.add(data); | 260 void add(List<int> data) { _sink.add(data); } |
| 261 void addError(error, [StackTrace stackTrace]) => | 261 void addError(error, [StackTrace stackTrace]) { |
| 262 _sink.addError(error, stackTrace); | 262 _sink.addError(error, stackTrace); |
| 263 void writeCharCode(int charCode) => _sink.writeCharCode(charCode); | 263 } |
| 264 void writeCharCode(int charCode) { _sink.writeCharCode(charCode); } |
| 264 Future addStream(Stream<List<int>> stream) => _sink.addStream(stream); | 265 Future addStream(Stream<List<int>> stream) => _sink.addStream(stream); |
| 265 Future flush() => _sink.flush(); | 266 Future flush() => _sink.flush(); |
| 266 Future close() => _sink.close(); | 267 Future close() => _sink.close(); |
| 267 Future get done => _sink.done; | 268 Future get done => _sink.done; |
| 268 } | 269 } |
| 269 | 270 |
| 270 /// The type of object a standard IO stream is attached to. | 271 /// The type of object a standard IO stream is attached to. |
| 271 class StdioType { | 272 class StdioType { |
| 272 static const StdioType TERMINAL = const StdioType._("terminal"); | 273 static const StdioType TERMINAL = const StdioType._("terminal"); |
| 273 static const StdioType PIPE = const StdioType._("pipe"); | 274 static const StdioType PIPE = const StdioType._("pipe"); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 return StdioType.OTHER; | 346 return StdioType.OTHER; |
| 346 } | 347 } |
| 347 | 348 |
| 348 | 349 |
| 349 class _StdIOUtils { | 350 class _StdIOUtils { |
| 350 external static _getStdioOutputStream(int fd); | 351 external static _getStdioOutputStream(int fd); |
| 351 external static Stdin _getStdioInputStream(); | 352 external static Stdin _getStdioInputStream(); |
| 352 external static int _socketType(nativeSocket); | 353 external static int _socketType(nativeSocket); |
| 353 external static _getStdioHandleType(int fd); | 354 external static _getStdioHandleType(int fd); |
| 354 } | 355 } |
| OLD | NEW |