Mercurial > projects > dynamin
diff dynamin/core/console.d @ 106:acdbb30fee7e
Port to D2.
Most of the effort was dealing with immutable and const.
author | Jordan Miner <jminer7@gmail.com> |
---|---|
date | Mon, 17 Dec 2012 23:41:50 -0600 |
parents | 73060bc3f004 |
children |
line wrap: on
line diff
--- a/dynamin/core/console.d Sat Nov 24 10:21:50 2012 -0600 +++ b/dynamin/core/console.d Mon Dec 17 23:41:50 2012 -0600 @@ -49,9 +49,9 @@ * The only functions that will work corectly when output or input have been * redirected are the following: * $(UL - $(LI Write()) - $(LI WriteLine()) - $(LI ReadLine()) + $(LI write()) + $(LI writeLine()) + $(LI readLine()) * ) * On Windows, when writing to a console window, all functionality is * available except Bold, Italic, Underline, Strikethrough. Windows does @@ -76,7 +76,7 @@ //- Turning off echoing the key press that the user types when returning // input without ENTER //- Writing a string, such as "23%", and then changing it to like "24%". -// Console.WriteBuffer(40) writes 40 spaces and returns a ConsoleBuffer object +// Console.writeBuffer(40) writes 40 spaces and returns a ConsoleBuffer object /** * Sets whether or not writing to the standard output will be * buffered. By default, this is false, meaning that no buffering will @@ -91,7 +91,7 @@ /** * Writes the specified text string to the console. */ - void write(string s, ...) { + void write(cstring s, ...) { Stdout.layout.convert(&Stdout.emit, _arguments, _argptr, s); } /** @@ -99,7 +99,7 @@ */ void writeLine() { Stdout.newline; } /// ditto - void writeLine(string s, ...) { + void writeLine(cstring s, ...) { Stdout.layout.convert(&Stdout.emit, _arguments, _argptr, s); Stdout.newline; } @@ -108,14 +108,14 @@ * will end in a newline, unless it was read from the last line in a text * file. */ - string readLineRaw() { return Cin.copyln(true); } + mstring readLineRaw() { return Cin.copyln(true); } /** * Reads a line of text from the console. The returned string does not * contain a newline. */ - string readLine() { return Cin.copyln(false); } + mstring readLine() { return Cin.copyln(false); } /// ditto - string readLine(string prompt, ...) { + mstring readLine(cstring prompt, ...) { Stdout.layout.convert(&Stdout.emit, _arguments, _argptr, prompt); return readLine(); } @@ -123,9 +123,9 @@ * reads a character, echoing it to the screen * TODO: not implemented */ - string read() { return backend_read(); } + mstring read() { return backend_read(); } /// ditto - string read(string prompt) { + mstring read(cstring prompt) { write(prompt); return backend_read(); } @@ -133,9 +133,9 @@ * reads a line without showing that line * TODO: not implemented */ - string readLineHidden() { return backend_readLineHidden(); } + mstring readLineHidden() { return backend_readLineHidden(); } /// ditto - string readLineHidden(string prompt) { + mstring readLineHidden(cstring prompt) { write(prompt); return backend_readLineHidden(); } @@ -143,9 +143,9 @@ * reads a character without showing it * TODO: not implemented */ - string readHidden() { return backend_readHidden(); } + mstring readHidden() { return backend_readHidden(); } /// ditto - string readHidden(string prompt) { + mstring readHidden(cstring prompt) { write(prompt); return backend_readHidden(); }