1 #include "bbstdExecSystemCommand.h"
2 #include "bbstdPackage.h"
3 #include "bbtkInterpreter.h"
8 BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,ExecSystemCommand);
9 BBTK_BLACK_BOX_IMPLEMENTATION(ExecSystemCommand,bbtk::AtomicBlackBox);
11 void ExecSystemCommand::bbUserConstructor()
16 void ExecSystemCommand::DoProcess()
20 pos2 = bbGetInputIn().find(";",pos1);
27 ccommand=bbGetInputIn().substr(pos1,bbGetInputIn().length()-pos1 );
29 ccommand=bbGetInputIn().substr(pos1,pos2-pos1);
31 for (unsigned int i=0 ; i < ccommand.length() ; i++)
38 std::cout << "*** Executing system command : '"<<ccommand<<"'"<<std::endl;
39 system ( ccommand.c_str() );
41 pos2 = bbGetInputIn().find(";",pos2+1);
44 /* Grrr not works in windows
46 char *str = (char*)bbGetInputIn().c_str();
48 pch = strtok (str,";");
51 std::string ccommand(pch);
52 for ( i=0 ; i < ccommand.length() ; i++)
60 // bbtk::Interpreter::mGlobalInterpreter->InterpretLine( ccommand );
61 system ( ccommand.c_str() );
62 pch = strtok (NULL, ";");
64 // bbSetOutputOut( bbGetInputIn() );
67 } // EO namespace bbstd