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

Unified Diff: runtime/bin/stdin_linux.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/stdin_android.cc ('k') | runtime/bin/stdin_macos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/stdin_linux.cc
diff --git a/runtime/bin/stdin_linux.cc b/runtime/bin/stdin_linux.cc
index 4f951987c9819ad3cf4bbd099bd0eb7de59affb4..c64610aed7283c00b59b4f3609b29f14312a20cd 100644
--- a/runtime/bin/stdin_linux.cc
+++ b/runtime/bin/stdin_linux.cc
@@ -25,6 +25,13 @@ int Stdin::ReadByte() {
}
+bool Stdin::GetEchoMode() {
+ struct termios term;
+ tcgetattr(fileno(stdin), &term);
+ return (term.c_lflag & ECHO) != 0;
+}
+
+
void Stdin::SetEchoMode(bool enabled) {
struct termios term;
tcgetattr(fileno(stdin), &term);
@@ -37,6 +44,13 @@ void Stdin::SetEchoMode(bool enabled) {
}
+bool Stdin::GetLineMode() {
+ struct termios term;
+ tcgetattr(fileno(stdin), &term);
+ return (term.c_lflag & ICANON) != 0;
+}
+
+
void Stdin::SetLineMode(bool enabled) {
struct termios term;
tcgetattr(fileno(stdin), &term);
« no previous file with comments | « runtime/bin/stdin_android.cc ('k') | runtime/bin/stdin_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698