| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 if (empty) return null; | 96 if (empty) return null; |
| 97 return line.toString(); | 97 return line.toString(); |
| 98 } | 98 } |
| 99 | 99 |
| 100 /** | 100 /** |
| 101 * Synchronously read a byte from stdin. This call will block until a byte is | 101 * Synchronously read a byte from stdin. This call will block until a byte is |
| 102 * available. | 102 * available. |
| 103 * | 103 * |
| 104 * If at end of file, -1 is returned. | 104 * If at end of file, -1 is returned. |
| 105 */ | 105 */ |
| 106 int readByteSync(); | 106 external int readByteSync(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 | 109 |
| 110 class _StdSink implements IOSink { | 110 class _StdSink implements IOSink { |
| 111 final IOSink _sink; | 111 final IOSink _sink; |
| 112 | 112 |
| 113 _StdSink(IOSink this._sink); | 113 _StdSink(IOSink this._sink); |
| 114 | 114 |
| 115 Encoding get encoding => _sink.encoding; | 115 Encoding get encoding => _sink.encoding; |
| 116 void set encoding(Encoding encoding) { | 116 void set encoding(Encoding encoding) { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 } catch (e) { | 191 } catch (e) { |
| 192 // Only the interface implemented, _sink not available. | 192 // Only the interface implemented, _sink not available. |
| 193 } | 193 } |
| 194 } | 194 } |
| 195 return StdioType.OTHER; | 195 return StdioType.OTHER; |
| 196 } | 196 } |
| 197 | 197 |
| 198 | 198 |
| 199 class _StdIOUtils { | 199 class _StdIOUtils { |
| 200 external static IOSink _getStdioOutputStream(int fd); | 200 external static IOSink _getStdioOutputStream(int fd); |
| 201 external static Stdio _getStdioInputStream(); | 201 external static Stdin _getStdioInputStream(); |
| 202 external static int _socketType(nativeSocket); | 202 external static int _socketType(nativeSocket); |
| 203 } | 203 } |
| OLD | NEW |