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

Unified Diff: runtime/bin/stdin.h

Issue 19627004: Add echo and line modes to Stdin. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add missing files. 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
Index: runtime/bin/stdin.h
diff --git a/runtime/bin/stdin.cc b/runtime/bin/stdin.h
similarity index 51%
copy from runtime/bin/stdin.cc
copy to runtime/bin/stdin.h
index 6dba2130ad8e9526c2fe8b4092ebf565038e828c..6fb67fe0091f77655848862377257cf18b9511ce 100644
--- a/runtime/bin/stdin.cc
+++ b/runtime/bin/stdin.h
@@ -2,30 +2,31 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+#ifndef BIN_STDIN_H_
+#define BIN_STDIN_H_
+
#include "bin/builtin.h"
-#include "bin/dartutils.h"
-#include "bin/thread.h"
#include "bin/utils.h"
#include "platform/globals.h"
-#include "platform/thread.h"
-#include "platform/utils.h"
-
-#include "include/dart_api.h"
namespace dart {
namespace bin {
-void FUNCTION_NAME(Stdin_ReadByte)(Dart_NativeArguments args) {
- Dart_EnterScope();
- int c = getchar();
- if (c == EOF) {
- c = -1;
- }
- Dart_SetReturnValue(args, Dart_NewInteger(c));
- Dart_ExitScope();
-}
+class Stdin {
+ public:
+ static int ReadByte();
+ static void setEchoMode(bool enabled);
Søren Gjesse 2013/07/24 12:18:49 Uppercase S
Anders Johnsen 2013/07/24 12:57:49 Done.
+ static void setLineMode(bool enabled);
Søren Gjesse 2013/07/24 12:18:49 Ditto.
Anders Johnsen 2013/07/24 12:57:49 Done.
+
+ private:
+ DISALLOW_ALLOCATION();
+ DISALLOW_IMPLICIT_CONSTRUCTORS(Stdin);
+};
} // namespace bin
} // namespace dart
+
+#endif // BIN_STDIN_H_
+
« no previous file with comments | « runtime/bin/io_natives.cc ('k') | runtime/bin/stdin.cc » ('j') | runtime/bin/stdin_linux.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698