1 #include "bbstdExecBbiCommand.h"
2 #include "bbstdPackage.h"
3 #include "bbtkInterpreter.h"
4 #include "bbtkExecuter.h"
9 BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,ExecBbiCommand);
10 BBTK_BLACK_BOX_IMPLEMENTATION(ExecBbiCommand,bbtk::AtomicBlackBox);
12 void ExecBbiCommand::bbUserConstructor()
17 void ExecBbiCommand::DoProcess()
20 // Look for the interpreter
21 bbtk::Interpreter::Pointer I;
22 bool delete_inter = false;
23 if (bbGetParent() != 0)
25 bbtk::Factory::Pointer f
26 = ((bbtk::ComplexBlackBoxDescriptor*)bbGetParent()
27 ->bbGetDescriptor().get())->GetFactory();
31 I = f->GetExecuter()->GetInterpreter();
36 // bbtkError("ExecBbiCommand::DoProcess() : could not find interpreter");
37 I = bbtk::Interpreter::New();
45 pos2 = bbGetInputIn().find(";",pos1);
52 ccommand=bbGetInputIn().substr(pos1,bbGetInputIn().length()-pos1 );
54 ccommand=bbGetInputIn().substr(pos1,pos2-pos1);
56 for ( i=0 ; i < ccommand.length() ; i++)
64 I->InterpretLine( ccommand );
66 pos2 = bbGetInputIn().find(";",pos2+1);
70 // if (delete_inter) delete I;
72 /* Grrr not works in windows
74 pch = strtok (bbGetInputIn(),";");
77 std::string ccommand(pch);
78 printf("EED ExecBbiCommand::DoProcess 1.1 %s\n",ccommand.c_str());
79 for ( i=0 ; i < ccommand.length() ; i++)
87 printf("EED ExecBbiCommand::DoProcess 2 %s\n",ccommand.c_str());
88 bbtk::Interpreter::mGlobalInterpreter->InterpretLine( ccommand );
89 pch = strtok (NULL, ";");
93 } // EO namespace bbstd