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

Side by Side Diff: sdk/lib/io/stdio.dart

Issue 102953008: Add getter for lineMode and echoMode for Stdin. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/_internal/lib/io_patch.dart ('k') | tests/standalone/io/stdin_sync_test.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 part of dart.io; 5 part of dart.io;
6 6
7 const int _STDIO_HANDLE_TYPE_TERMINAL = 0; 7 const int _STDIO_HANDLE_TYPE_TERMINAL = 0;
8 const int _STDIO_HANDLE_TYPE_PIPE = 1; 8 const int _STDIO_HANDLE_TYPE_PIPE = 1;
9 const int _STDIO_HANDLE_TYPE_FILE = 2; 9 const int _STDIO_HANDLE_TYPE_FILE = 2;
10 const int _STDIO_HANDLE_TYPE_SOCKET = 3; 10 const int _STDIO_HANDLE_TYPE_SOCKET = 3;
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 // Error during decoding. 114 // Error during decoding.
115 throw error; 115 throw error;
116 } 116 }
117 } 117 }
118 118
119 if (empty) return null; 119 if (empty) return null;
120 return line.toString(); 120 return line.toString();
121 } 121 }
122 122
123 /** 123 /**
124 * Enable or disable echo mode on the [Stdin]. 124 * Check if echo mode is enabled on [stdin].
125 */
126 external bool get echoMode;
127
128 /**
129 * Enable or disable echo mode on [stdin].
125 * 130 *
126 * If disabled, input from to console will not be echoed. 131 * If disabled, input from to console will not be echoed.
127 * 132 *
128 * Default depends on the parent process, but usually enabled. 133 * Default depends on the parent process, but usually enabled.
129 */ 134 */
130 external void set echoMode(bool enabled); 135 external void set echoMode(bool enabled);
131 136
132 /** 137 /**
133 * Enable or disable line mode on the [Stdin]. 138 * Check if line mode is enabled on [stdin].
139 */
140 external bool get lineMode;
141
142 /**
143 * Enable or disable line mode on [stdin].
134 * 144 *
135 * If enabled, characters are delayed until a new-line character is entered. 145 * If enabled, characters are delayed until a new-line character is entered.
136 * If disabled, characters will be available as typed. 146 * If disabled, characters will be available as typed.
137 * 147 *
138 * Default depends on the parent process, but usually enabled. 148 * Default depends on the parent process, but usually enabled.
139 */ 149 */
140 external void set lineMode(bool enabled); 150 external void set lineMode(bool enabled);
141 151
142 /** 152 /**
143 * Synchronously read a byte from stdin. This call will block until a byte is 153 * Synchronously read a byte from stdin. This call will block until a byte is
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 } 254 }
245 return StdioType.OTHER; 255 return StdioType.OTHER;
246 } 256 }
247 257
248 258
249 class _StdIOUtils { 259 class _StdIOUtils {
250 external static IOSink _getStdioOutputStream(int fd); 260 external static IOSink _getStdioOutputStream(int fd);
251 external static Stdin _getStdioInputStream(); 261 external static Stdin _getStdioInputStream();
252 external static int _socketType(nativeSocket); 262 external static int _socketType(nativeSocket);
253 } 263 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/lib/io_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