summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sotoudeh <matthewsot@outlook.com>2014-07-28 21:23:06 -0700
committerMatthew Sotoudeh <matthewsot@outlook.com>2014-07-28 21:23:07 -0700
commit0780c0bbe53d2531e1656c67cf2201806e2307ad (patch)
tree33354af8e82295028fe9d20e717e4e8c52c1c901
parent0060d654c1f66ec839717fc305f158686b89145b (diff)
ignore this
-rw-r--r--DNSwift/DNSwift/System/Console.swift25
1 files changed, 25 insertions, 0 deletions
diff --git a/DNSwift/DNSwift/System/Console.swift b/DNSwift/DNSwift/System/Console.swift
new file mode 100644
index 0000000..a261595
--- /dev/null
+++ b/DNSwift/DNSwift/System/Console.swift
@@ -0,0 +1,25 @@
+import Foundation
+
+public class Console {
+ class func Write(str: String) {
+ print(str);
+ }
+
+ class func WriteLine(line: String) {
+ println(line);
+ }
+
+ class func Read() -> String {
+ //TODO
+ return "NOT CORRECT";
+ }
+
+ class func ReadLine() -> String {
+ //http://stackoverflow.com/questions/24004776/input-from-the-keyboard-in-command-line-application
+ var keyboard = NSFileHandle.fileHandleWithStandardInput()
+ var inputData = keyboard.availableData
+ return NSString(data: inputData, encoding:NSUTF8StringEncoding).stringByTrimmingCharactersInSet(NSCharacterSet.newlineCharacterSet());
+ }
+
+ //TODO: Swift doesn't seem to have great support for a lot of console stuff, add more later
+} \ No newline at end of file
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback