void Console::SetCurrentAction(const char *InAction, FILE *OutDescriptor, const char *Color) { static PkString Current; fputs(CONSOLE_CTL_RESTORESTATE, OutDescriptor); for (size_t Inc = 0; Inc < Current.length(); ++Inc) { putc(' ', OutDescriptor); } char Buf[4096]; snprintf(Buf, sizeof Buf, CONSOLE_CTL_RESTORESTATE CONSOLE_CTL_SAVESTATE CONSOLE_COLOR_CYAN ">>%s" CONSOLE_ENDCOLOR " %s%s%s" , Subject ? +(PkString(CONSOLE_COLOR_GREEN " [") + Subject + "]" CONSOLE_ENDCOLOR): "", Color ? Color : "", InAction, Color ? CONSOLE_ENDCOLOR : ""); Current = Buf; fputs(Buf, OutDescriptor); }
void Console::VomitActionError(const char *ErrMsg, FILE *OutDescriptor) { fputs(PkString() + "\n" CONSOLE_COLOR_RED "ERROR:" CONSOLE_ENDCOLOR " " + ErrMsg + "\n", OutDescriptor); }
// Determines GMS output file name from base file name void getGMSOutputFileName( PkString& outGMSFileName, const PkString& baseFileName ) { outGMSFileName = baseFileName + PkString( ".gms" ); }
// Obtains the file name that is the result of running the write solution script void getWriteSolutionScriptOutputFileName( PkString& outFileName, const PkString& baseFileName ) { outFileName = baseFileName + PkString( ".soln" ); }
// Executes the Gams set cover solver void execGams( const char* gamsInputFileName ) { PkString strGamsCmd = (PkString( "gams " ) + PkString( gamsInputFileName )); system( strGamsCmd.c_str() ); }