Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(600)

Side by Side Diff: runtime/bin/stdio.dart

Issue 10872033: Change getters syntax in dart:io library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/socket_stream_impl.dart ('k') | runtime/bin/stream_util.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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";
OLDNEW
« no previous file with comments | « runtime/bin/socket_stream_impl.dart ('k') | runtime/bin/stream_util.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698