| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // Error during decoding. | 114 // Error during decoding. |
| 115 throw error; | 115 throw error; |
| 116 } | 116 } |
| 117 } | 117 } |
| 118 | 118 |
| 119 if (empty) return null; | 119 if (empty) return null; |
| 120 return line.toString(); | 120 return line.toString(); |
| 121 } | 121 } |
| 122 | 122 |
| 123 /** | 123 /** |
| 124 * Enable or disable echo mode on the [Stdin]. | 124 * Check if echo mode is enabled on [stdin]. |
| 125 */ |
| 126 external bool get echoMode; |
| 127 |
| 128 /** |
| 129 * Enable or disable echo mode on [stdin]. |
| 125 * | 130 * |
| 126 * If disabled, input from to console will not be echoed. | 131 * If disabled, input from to console will not be echoed. |
| 127 * | 132 * |
| 128 * Default depends on the parent process, but usually enabled. | 133 * Default depends on the parent process, but usually enabled. |
| 129 */ | 134 */ |
| 130 external void set echoMode(bool enabled); | 135 external void set echoMode(bool enabled); |
| 131 | 136 |
| 132 /** | 137 /** |
| 133 * Enable or disable line mode on the [Stdin]. | 138 * Check if line mode is enabled on [stdin]. |
| 139 */ |
| 140 external bool get lineMode; |
| 141 |
| 142 /** |
| 143 * Enable or disable line mode on [stdin]. |
| 134 * | 144 * |
| 135 * If enabled, characters are delayed until a new-line character is entered. | 145 * If enabled, characters are delayed until a new-line character is entered. |
| 136 * If disabled, characters will be available as typed. | 146 * If disabled, characters will be available as typed. |
| 137 * | 147 * |
| 138 * Default depends on the parent process, but usually enabled. | 148 * Default depends on the parent process, but usually enabled. |
| 139 */ | 149 */ |
| 140 external void set lineMode(bool enabled); | 150 external void set lineMode(bool enabled); |
| 141 | 151 |
| 142 /** | 152 /** |
| 143 * Synchronously read a byte from stdin. This call will block until a byte is | 153 * Synchronously read a byte from stdin. This call will block until a byte is |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 } | 254 } |
| 245 return StdioType.OTHER; | 255 return StdioType.OTHER; |
| 246 } | 256 } |
| 247 | 257 |
| 248 | 258 |
| 249 class _StdIOUtils { | 259 class _StdIOUtils { |
| 250 external static IOSink _getStdioOutputStream(int fd); | 260 external static IOSink _getStdioOutputStream(int fd); |
| 251 external static Stdin _getStdioInputStream(); | 261 external static Stdin _getStdioInputStream(); |
| 252 external static int _socketType(nativeSocket); | 262 external static int _socketType(nativeSocket); |
| 253 } | 263 } |
| OLD | NEW |