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()
18 void ExecBbiCommand::DoProcess()
21 // Look for the interpreter
22 bbtk::Interpreter::Pointer I;
23 bool delete_inter = false;
24 if (bbGetParent() != 0)
26 bbtk::Factory::Pointer f
27 = ((bbtk::ComplexBlackBoxDescriptor*)bbGetParent()
28 ->bbGetDescriptor().get())->GetFactory();
32 I = f->GetExecuter()->GetInterpreter();
37 // bbtkError("ExecBbiCommand::DoProcess() : could not find interpreter");
38 I = bbtk::Interpreter::New();
46 pos2 = bbGetInputIn().find(";",pos1);
53 ccommand=bbGetInputIn().substr(pos1,bbGetInputIn().length()-pos1 );
55 ccommand=bbGetInputIn().substr(pos1,pos2-pos1);
57 for ( i=0 ; i < ccommand.length() ; i++)
65 I->InterpretLine( ccommand );
67 pos2 = bbGetInputIn().find(";",pos2+1);
71 // if (delete_inter) delete I;
73 /* Grrr not works in windows
75 pch = strtok (bbGetInputIn(),";");
78 std::string ccommand(pch);
79 printf("EED ExecBbiCommand::DoProcess 1.1 %s\n",ccommand.c_str());
80 for ( i=0 ; i < ccommand.length() ; i++)
88 printf("EED ExecBbiCommand::DoProcess 2 %s\n",ccommand.c_str());
89 bbtk::Interpreter::mGlobalInterpreter->InterpretLine( ccommand );
90 pch = strtok (NULL, ";");
96 } // EO namespace bbstd