| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 /* patch */ int get terminalLines => _terminalSize[1]; | 75 /* patch */ int get terminalLines => _terminalSize[1]; |
| 76 | 76 |
| 77 static List get _terminalSize { | 77 static List get _terminalSize { |
| 78 var size = _getTerminalSize(); | 78 var size = _getTerminalSize(); |
| 79 if (size is! List) { | 79 if (size is! List) { |
| 80 throw new StdoutException("Could not get terminal size", size); | 80 throw new StdoutException("Could not get terminal size", size); |
| 81 } | 81 } |
| 82 return size; | 82 return size; |
| 83 } | 83 } |
| 84 | 84 |
| 85 static List _getTerminalSize() native "Stdout_GetTerminalSize"; | 85 static _getTerminalSize() native "Stdout_GetTerminalSize"; |
| 86 } | 86 } |
| 87 | 87 |
| 88 | 88 |
| 89 _getStdioHandle(_NativeSocket socket, int num) native "Socket_GetStdioHandle"; | 89 _getStdioHandle(_NativeSocket socket, int num) native "Socket_GetStdioHandle"; |
| 90 _getStdioHandleType(int num) native "File_GetStdioHandleType"; | 90 _getStdioHandleType(int num) native "File_GetStdioHandleType"; |
| 91 _getSocketType(_NativeSocket nativeSocket) native "Socket_GetType"; | 91 _getSocketType(_NativeSocket nativeSocket) native "Socket_GetType"; |
| OLD | NEW |