#include "bbstdExecSystemCommand.h" #include "bbstdPackage.h" #include "bbtkInterpreter.h" namespace bbstd { BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,ExecSystemCommand); BBTK_BLACK_BOX_IMPLEMENTATION(ExecSystemCommand,bbtk::AtomicBlackBox); void ExecSystemCommand::bbUserConstructor() { bbSetInputIn("help"); } void ExecSystemCommand::DoProcess() { bool ok=true; int pos1=0,pos2; pos2 = bbGetInputIn().find(";",pos1); std::string ccommand; while (ok) { if (pos2==-1) { ok=false; ccommand=bbGetInputIn().substr(pos1,bbGetInputIn().length()-pos1 ); } else { ccommand=bbGetInputIn().substr(pos1,pos2-pos1); } for (unsigned int i=0 ; i < ccommand.length() ; i++) { if (ccommand[i]==39) { ccommand[i]=34; } } std::cout << "*** Executing system command : '"<InterpretLine( ccommand ); system ( ccommand.c_str() ); pch = strtok (NULL, ";"); } // bbSetOutputOut( bbGetInputIn() ); */ } } // EO namespace bbstd