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

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

Issue 19627004: Add echo and line modes to Stdin. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add macos and android version. Created 7 years, 5 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/stdio_patch.dart ('k') | tests/standalone/io/stdin_sync_test.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 31a5c003bb9e82d88ac9cc19585583c35e1d7196..737b8f12f107b97718f7c94fa97186741bc92e90 100644
--- a/sdk/lib/io/stdio.dart
+++ b/sdk/lib/io/stdio.dart
@@ -42,7 +42,7 @@ class _StdinEventSink {
*
* Mixing synchronous and asynchronous reads is undefined.
*/
-class Stdin extends _StdStream {
+class Stdin extends _StdStream implements Stream<List<int>> {
Stdin._(Stream<List<int>> stream) : super(stream);
/**
@@ -98,6 +98,25 @@ class Stdin extends _StdStream {
}
/**
+ * Enable or disable echo mode on the [Stdin].
+ *
+ * If disabled, input from to console will not be echoed.
+ *
+ * Default depends on the parent process, but usually enabled.
+ */
+ external void set echoMode(bool enabled);
+
+ /**
+ * Enable or disable line mode on the [Stdin].
+ *
+ * If enabled, characters are delayed until a new-line character is entered.
+ * If disabled, characters will be available as typed.
+ *
+ * Default depends on the parent process, but usually enabled.
+ */
+ external void set lineMOde(bool enabled);
+
+ /**
* Synchronously read a byte from stdin. This call will block until a byte is
* available.
*
« no previous file with comments | « runtime/bin/stdio_patch.dart ('k') | tests/standalone/io/stdin_sync_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698