Files can be written from command line interface

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1054 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-08-04 21:01:40 +00:00
parent ef598f2d8c
commit 6a71b20d26
8 changed files with 78 additions and 18 deletions
+9 -1
View File
@@ -54,6 +54,8 @@ bool TextIOHandler::haveConsole() const {
}
// ----------------------------------------------------------------------------- : Output
void TextIOHandler::flush() {
if (have_console) {
fflush(stdout);
@@ -86,10 +88,12 @@ TextIOHandler& TextIOHandler::operator << (const String& str) {
return *this;
}
// ----------------------------------------------------------------------------- : Input
String TextIOHandler::getLine() {
String result;
Char buffer[2048];
while (true) {
while (!feof(stdin)) {
if (!IF_UNICODE(fgetws,fgets)(buffer, 2048, stdin)) {
return result; // error
}
@@ -100,4 +104,8 @@ String TextIOHandler::getLine() {
return result;
}
}
return result;
}
bool TextIOHandler::canGetLine() {
return !feof(stdin);
}