#include "bbstdExecBbiCommand.h" #include "bbstdPackage.h" #include "bbtkInterpreter.h" namespace bbstd { BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,ExecBbiCommand); BBTK_USER_BLACK_BOX_IMPLEMENTATION(ExecBbiCommand,bbtk::AtomicBlackBox); void ExecBbiCommand::bbUserConstructor() { bbSetInputIn("help"); } void ExecBbiCommand::DoProcess() { int i; bool ok=true; int pos1=0,pos2; pos2 = bbGetInputIn().find(";",pos1); std::string ccommand; while (ok==true) { if (pos2==-1) { ok=false; ccommand=bbGetInputIn().substr(pos1,bbGetInputIn().length()-pos1 ); } else { ccommand=bbGetInputIn().substr(pos1,pos2-pos1); } for ( i=0 ; i < ccommand.length() ; i++) { if (ccommand[i]==39) { ccommand[i]=34; } } bool insideComment = false; // for multiline comment bbtk::Interpreter::mGlobalInterpreter->InterpretLine( ccommand, insideComment); pos1=pos2+1; pos2 = bbGetInputIn().find(";",pos2+1); } /* Grrr not works in windows char * pch; pch = strtok (bbGetInputIn(),";"); while (pch != NULL) { std::string ccommand(pch); printf("EED ExecBbiCommand::DoProcess 1.1 %s\n",ccommand.c_str()); for ( i=0 ; i < ccommand.length() ; i++) { if (ccommand[i]==39) { ccommand[i]=34; } } printf("EED ExecBbiCommand::DoProcess 2 %s\n",ccommand.c_str()); bbtk::Interpreter::mGlobalInterpreter->InterpretLine( ccommand ); pch = strtok (NULL, ";"); } */ } } // EO namespace bbstd