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

Unified Diff: runtime/bin/stdio_patch.dart

Issue 18516002: Add Stdio.readByteSync and Stdio.readLineSync. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Handle \r\r\n. Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/stdin.cc ('k') | sdk/lib/_internal/lib/io_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/stdio_patch.dart
diff --git a/runtime/bin/stdio_patch.dart b/runtime/bin/stdio_patch.dart
index 90b3a41fad2b4bfa3fcab92d075771d257634d32..6697987b3b9bcd1a9bc7d9b20660b8ce8b944ca8 100644
--- a/runtime/bin/stdio_patch.dart
+++ b/runtime/bin/stdio_patch.dart
@@ -3,14 +3,14 @@
// BSD-style license that can be found in the LICENSE file.
patch class _StdIOUtils {
- static Stream<List<int>> _getStdioInputStream() {
+ static Stdio _getStdioInputStream() {
switch (_getStdioHandleType(0)) {
case _STDIO_HANDLE_TYPE_TERMINAL:
case _STDIO_HANDLE_TYPE_PIPE:
case _STDIO_HANDLE_TYPE_SOCKET:
- return new _StdStream(new _Socket._readPipe(0));
+ return new Stdin._(new _Socket._readPipe(0));
case _STDIO_HANDLE_TYPE_FILE:
- return new _StdStream(new _FileStream.forStdin());
+ return new Stdin._(new _FileStream.forStdin());
default:
throw new FileException("Unsupported stdin type");
}
@@ -39,6 +39,10 @@ patch class _StdIOUtils {
}
}
+patch class Stdin {
+ /* patch */ int readByteSync() native "Stdin_ReadByte";
+}
+
_getStdioHandle(_NativeSocket socket, int num) native "Socket_GetStdioHandle";
_getStdioHandleType(int num) native "File_GetStdioHandleType";
« no previous file with comments | « runtime/bin/stdin.cc ('k') | sdk/lib/_internal/lib/io_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698