| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 final int _STDIO_HANDLE_TYPE_TERMINAL = 0; | 5 final int _STDIO_HANDLE_TYPE_TERMINAL = 0; |
| 6 final int _STDIO_HANDLE_TYPE_PIPE = 1; | 6 final int _STDIO_HANDLE_TYPE_PIPE = 1; |
| 7 final int _STDIO_HANDLE_TYPE_FILE = 2; | 7 final int _STDIO_HANDLE_TYPE_FILE = 2; |
| 8 final int _STDIO_HANDLE_TYPE_SOCKET = 3; | 8 final int _STDIO_HANDLE_TYPE_SOCKET = 3; |
| 9 final int _STDIO_HANDLE_TYPE_OTHER = -1; | 9 final int _STDIO_HANDLE_TYPE_OTHER = -1; |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 _getStdioHandle(s, fd); | 40 _getStdioHandle(s, fd); |
| 41 return s.outputStream; | 41 return s.outputStream; |
| 42 case _STDIO_HANDLE_TYPE_FILE: | 42 case _STDIO_HANDLE_TYPE_FILE: |
| 43 return new _FileOutputStream.fromStdio(fd); | 43 return new _FileOutputStream.fromStdio(fd); |
| 44 default: | 44 default: |
| 45 throw new FileIOException("Unsupported stdin type"); | 45 throw new FileIOException("Unsupported stdin type"); |
| 46 } | 46 } |
| 47 } | 47 } |
| 48 | 48 |
| 49 | 49 |
| 50 InputStream get stdin() { | 50 InputStream get stdin { |
| 51 if (_stdin == null) { | 51 if (_stdin == null) { |
| 52 _stdin = _getStdioInputStream(); | 52 _stdin = _getStdioInputStream(); |
| 53 } | 53 } |
| 54 return _stdin; | 54 return _stdin; |
| 55 } | 55 } |
| 56 | 56 |
| 57 | 57 |
| 58 OutputStream get stdout() { | 58 OutputStream get stdout { |
| 59 if (_stdout == null) { | 59 if (_stdout == null) { |
| 60 _stdout = _getStdioOutputStream(1); | 60 _stdout = _getStdioOutputStream(1); |
| 61 } | 61 } |
| 62 return _stdout; | 62 return _stdout; |
| 63 } | 63 } |
| 64 | 64 |
| 65 | 65 |
| 66 OutputStream get stderr() { | 66 OutputStream get stderr { |
| 67 if (_stderr == null) { | 67 if (_stderr == null) { |
| 68 _stderr = _getStdioOutputStream(2); | 68 _stderr = _getStdioOutputStream(2); |
| 69 } | 69 } |
| 70 return _stderr; | 70 return _stderr; |
| 71 } | 71 } |
| 72 | 72 |
| 73 _getStdioHandle(Socket socket, int num) native "Socket_GetStdioHandle"; | 73 _getStdioHandle(Socket socket, int num) native "Socket_GetStdioHandle"; |
| 74 _getStdioHandleType(int num) native "File_GetStdioHandleType"; | 74 _getStdioHandleType(int num) native "File_GetStdioHandleType"; |
| OLD | NEW |