mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user