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

Unified Diff: sdk/lib/io/stdio.dart

Issue 11553020: Fix unresolved classes issues in dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/io/io.dart ('k') | sdk/lib/io/websocket_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/stdio.dart
diff --git a/sdk/lib/io/stdio.dart b/sdk/lib/io/stdio.dart
index e080526104de819bd1eac4e6238210e8e61e2df2..246fe31dddd59dc63a24aea67d05d229fed628f8 100644
--- a/sdk/lib/io/stdio.dart
+++ b/sdk/lib/io/stdio.dart
@@ -14,44 +14,9 @@ OutputStream _stdout;
OutputStream _stderr;
-InputStream _getStdioInputStream() {
- switch (_StdIOUtils._getStdioHandleType(0)) {
- case _STDIO_HANDLE_TYPE_TERMINAL:
- case _STDIO_HANDLE_TYPE_PIPE:
- case _STDIO_HANDLE_TYPE_SOCKET:
- Socket s = new _Socket._internalReadOnly();
- _StdIOUtils._getStdioHandle(s, 0);
- s._closed = false;
- return s.inputStream;
- case _STDIO_HANDLE_TYPE_FILE:
- return new _FileInputStream.fromStdio(0);
- default:
- throw new FileIOException("Unsupported stdin type");
- }
-}
-
-
-OutputStream _getStdioOutputStream(int fd) {
- assert(fd == 1 || fd == 2);
- switch (_StdIOUtils._getStdioHandleType(fd)) {
- case _STDIO_HANDLE_TYPE_TERMINAL:
- case _STDIO_HANDLE_TYPE_PIPE:
- case _STDIO_HANDLE_TYPE_SOCKET:
- Socket s = new _Socket._internalWriteOnly();
- _StdIOUtils._getStdioHandle(s, fd);
- s._closed = false;
- return s.outputStream;
- case _STDIO_HANDLE_TYPE_FILE:
- return new _FileOutputStream.fromStdio(fd);
- default:
- throw new FileIOException("Unsupported stdin type");
- }
-}
-
-
InputStream get stdin {
if (_stdin == null) {
- _stdin = _getStdioInputStream();
+ _stdin = _StdIOUtils._getStdioInputStream();
}
return _stdin;
}
@@ -59,7 +24,7 @@ InputStream get stdin {
OutputStream get stdout {
if (_stdout == null) {
- _stdout = _getStdioOutputStream(1);
+ _stdout = _StdIOUtils._getStdioOutputStream(1);
}
return _stdout;
}
@@ -67,13 +32,13 @@ OutputStream get stdout {
OutputStream get stderr {
if (_stderr == null) {
- _stderr = _getStdioOutputStream(2);
+ _stderr = _StdIOUtils._getStdioOutputStream(2);
}
return _stderr;
}
class _StdIOUtils {
- external static _getStdioHandle(Socket socket, int num);
- external static _getStdioHandleType(int num);
+ external static OutputStream _getStdioOutputStream(int fd);
+ external static InputStream _getStdioInputStream();
}
« no previous file with comments | « sdk/lib/io/io.dart ('k') | sdk/lib/io/websocket_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698