1 #include "bbstdExecBbiCommand.h"
2 #include "bbstdPackage.h"
3 #include "bbtkInterpreter.h"
8 BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,ExecBbiCommand);
9 BBTK_USER_BLACK_BOX_IMPLEMENTATION(ExecBbiCommand,bbtk::AtomicBlackBox);
11 void ExecBbiCommand::bbUserConstructor()
17 void ExecBbiCommand::DoProcess()
19 // Look for the interpreter
20 bbtk::Interpreter* I = 0;
21 bool delete_inter = false;
22 if (bbGetParent() != 0)
24 bbtk::Factory* f = ((bbtk::ComplexBlackBoxDescriptor*)bbGetParent()
25 ->bbGetDescriptor())->GetFactory();
29 I = f->GetExecuter()->GetInterpreter();
34 // bbtkError("ExecBbiCommand::DoProcess() : could not find interpreter");
35 I = new bbtk::Interpreter();
43 pos2 = bbGetInputIn().find(";",pos1);
50 ccommand=bbGetInputIn().substr(pos1,bbGetInputIn().length()-pos1 );
52 ccommand=bbGetInputIn().substr(pos1,pos2-pos1);
54 for ( i=0 ; i < ccommand.length() ; i++)
62 I->InterpretLine( ccommand );
64 pos2 = bbGetInputIn().find(";",pos2+1);
68 if (delete_inter) delete I;
70 /* Grrr not works in windows
72 pch = strtok (bbGetInputIn(),";");
75 std::string ccommand(pch);
76 printf("EED ExecBbiCommand::DoProcess 1.1 %s\n",ccommand.c_str());
77 for ( i=0 ; i < ccommand.length() ; i++)
85 printf("EED ExecBbiCommand::DoProcess 2 %s\n",ccommand.c_str());
86 bbtk::Interpreter::mGlobalInterpreter->InterpretLine( ccommand );
87 pch = strtok (NULL, ";");
93 } // EO namespace bbstd