| 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 patch class _StdIOUtils { | 5 patch class _StdIOUtils { |
| 6 static Stdin _getStdioInputStream() { | 6 static Stdin _getStdioInputStream() { |
| 7 switch (_getStdioHandleType(0)) { | 7 switch (_getStdioHandleType(0)) { |
| 8 case _STDIO_HANDLE_TYPE_TERMINAL: | 8 case _STDIO_HANDLE_TYPE_TERMINAL: |
| 9 case _STDIO_HANDLE_TYPE_PIPE: | 9 case _STDIO_HANDLE_TYPE_PIPE: |
| 10 case _STDIO_HANDLE_TYPE_SOCKET: | 10 case _STDIO_HANDLE_TYPE_SOCKET: |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 var result = _getSocketType(nativeSocket); | 34 var result = _getSocketType(nativeSocket); |
| 35 if (result is OSError) { | 35 if (result is OSError) { |
| 36 throw new FileSystemException("Error retreiving socket type", result); | 36 throw new FileSystemException("Error retreiving socket type", result); |
| 37 } | 37 } |
| 38 return result; | 38 return result; |
| 39 } | 39 } |
| 40 } | 40 } |
| 41 | 41 |
| 42 patch class Stdin { | 42 patch class Stdin { |
| 43 /* patch */ int readByteSync() native "Stdin_ReadByte"; | 43 /* patch */ int readByteSync() native "Stdin_ReadByte"; |
| 44 /* patch */ void set echoMode(bool enabled) native "Stdin_SetEchoMode"; | 44 |
| 45 /* patch */ void set lineMode(bool enabled) native "Stdin_SetLineMode"; | 45 /* patch */ bool get echoMode => _echoMode; |
| 46 /* patch */ void set echoMode(bool enabled) { _echoMode = enabled; } |
| 47 |
| 48 /* patch */ bool get lineMode => _lineMode; |
| 49 /* patch */ void set lineMode(bool enabled) { _lineMode = enabled; } |
| 50 |
| 51 static bool get _echoMode native "Stdin_GetEchoMode"; |
| 52 static void set _echoMode(bool enabled) native "Stdin_SetEchoMode"; |
| 53 static bool get _lineMode native "Stdin_GetLineMode"; |
| 54 static void set _lineMode(bool enabled) native "Stdin_SetLineMode"; |
| 46 } | 55 } |
| 47 | 56 |
| 48 | 57 |
| 49 _getStdioHandle(_NativeSocket socket, int num) native "Socket_GetStdioHandle"; | 58 _getStdioHandle(_NativeSocket socket, int num) native "Socket_GetStdioHandle"; |
| 50 _getStdioHandleType(int num) native "File_GetStdioHandleType"; | 59 _getStdioHandleType(int num) native "File_GetStdioHandleType"; |
| 51 _getSocketType(_NativeSocket nativeSocket) native "Socket_GetType"; | 60 _getSocketType(_NativeSocket nativeSocket) native "Socket_GetType"; |
| OLD | NEW |