#include <bbstdExecBbiCommand.h>
Public Member Functions | |
| BBTK_BLACK_BOX_INTERFACE (ExecBbiCommand, bbtk::AtomicBlackBox) | |
| BBTK_DECLARE_INPUT (In, std::string) | |
| BBTK_PROCESS (DoProcess) | |
| void | DoProcess () |
Protected Member Functions | |
| virtual void | bbUserConstructor () |
Definition at line 40 of file bbstdExecBbiCommand.h.
| bbstd::ExecBbiCommand::BBTK_BLACK_BOX_INTERFACE | ( | ExecBbiCommand | , | |
| bbtk::AtomicBlackBox | ||||
| ) |
| bbstd::ExecBbiCommand::BBTK_DECLARE_INPUT | ( | In | , | |
| std::string | ||||
| ) |
| bbstd::ExecBbiCommand::BBTK_PROCESS | ( | DoProcess | ) |
| void bbstd::ExecBbiCommand::DoProcess | ( | ) |
Definition at line 48 of file bbstdExecBbiCommand.cxx.
00049 { 00050 00051 // Look for the interpreter 00052 bbtk::Interpreter::Pointer I; 00053 bool delete_inter = false; 00054 if (bbGetParent() != 0) 00055 { 00056 bbtk::Factory::Pointer f 00057 = ((bbtk::ComplexBlackBoxDescriptor*)bbGetParent() 00058 ->bbGetDescriptor().get())->GetFactory(); 00059 if ((f != 0)&& 00060 (f->GetExecuter())) 00061 { 00062 I = f->GetExecuter()->GetInterpreter(); 00063 } 00064 } 00065 if (I==0) 00066 { 00067 // bbtkError("ExecBbiCommand::DoProcess() : could not find interpreter"); 00068 I = bbtk::Interpreter::New(); 00069 delete_inter = true; 00070 } 00071 00072 unsigned int i; 00073 00074 bool ok=true; 00075 int pos1=0,pos2; 00076 pos2 = bbGetInputIn().find(";",pos1); 00077 std::string ccommand; 00078 while (ok==true) 00079 { 00080 if (pos2==-1) 00081 { 00082 ok=false; 00083 ccommand=bbGetInputIn().substr(pos1,bbGetInputIn().length()-pos1 ); 00084 } else { 00085 ccommand=bbGetInputIn().substr(pos1,pos2-pos1); 00086 } 00087 for ( i=0 ; i < ccommand.length() ; i++) 00088 { 00089 if (ccommand[i]==39) 00090 { 00091 ccommand[i]=34; 00092 } 00093 } 00094 00095 I->InterpretLine( ccommand ); 00096 pos1=pos2+1; 00097 pos2 = bbGetInputIn().find(";",pos2+1); 00098 00099 } 00100 00101 // if (delete_inter) delete I; 00102 00103 /* Grrr not works in windows 00104 char * pch; 00105 pch = strtok (bbGetInputIn(),";"); 00106 while (pch != NULL) 00107 { 00108 std::string ccommand(pch); 00109 printf("EED ExecBbiCommand::DoProcess 1.1 %s\n",ccommand.c_str()); 00110 for ( i=0 ; i < ccommand.length() ; i++) 00111 { 00112 if (ccommand[i]==39) 00113 { 00114 ccommand[i]=34; 00115 } 00116 } 00117 00118 printf("EED ExecBbiCommand::DoProcess 2 %s\n",ccommand.c_str()); 00119 bbtk::Interpreter::mGlobalInterpreter->InterpretLine( ccommand ); 00120 pch = strtok (NULL, ";"); 00121 } 00122 */ 00123 }
| void bbstd::ExecBbiCommand::bbUserConstructor | ( | ) | [protected, virtual] |
1.5.6