bbstd::ExecSystemCommand Class Reference

#include <bbstdExecSystemCommand.h>

List of all members.

Public Member Functions

 BBTK_BLACK_BOX_INTERFACE (ExecSystemCommand, bbtk::AtomicBlackBox)
 BBTK_PROCESS (DoProcess)
void DoProcess ()

Protected Member Functions

virtual void bbUserConstructor ()


Detailed Description

Definition at line 40 of file bbstdExecSystemCommand.h.


Member Function Documentation

bbstd::ExecSystemCommand::BBTK_BLACK_BOX_INTERFACE ( ExecSystemCommand  ,
bbtk::AtomicBlackBox   
)

bbstd::ExecSystemCommand::BBTK_PROCESS ( DoProcess   ) 

void bbstd::ExecSystemCommand::DoProcess (  ) 

Definition at line 47 of file bbstdExecSystemCommand.cxx.

00048   {
00049     bool ok=true;
00050     int pos1=0,pos2;
00051     pos2 = bbGetInputIn().find(";",pos1);
00052     std::string ccommand;
00053     while (ok)
00054       {
00055         if (pos2==-1) 
00056           {
00057             ok=false;
00058             ccommand=bbGetInputIn().substr(pos1,bbGetInputIn().length()-pos1 );
00059            } else {
00060             ccommand=bbGetInputIn().substr(pos1,pos2-pos1);
00061           }
00062           for (unsigned int i=0 ; i < ccommand.length() ; i++)
00063           {
00064             if (ccommand[i]==39)
00065             {
00066                   ccommand[i]=34;
00067         }
00068      }
00069         std::cout << "*** Executing system command : '"<<ccommand<<"'"<<std::endl;
00070         system ( ccommand.c_str() );
00071         pos1=pos2+1;
00072         pos2 = bbGetInputIn().find(";",pos2+1);
00073       }
00074 
00075     /* Grrr  not works in windows
00076       int i;
00077       char *str = (char*)bbGetInputIn().c_str();
00078       char * pch;
00079       pch = strtok (str,";");
00080       while (pch != NULL)
00081       {
00082       std::string ccommand(pch);
00083       for ( i=0 ; i < ccommand.length() ; i++)
00084       {
00085       if (ccommand[i]==39)
00086       {
00087       ccommand[i]=34;
00088       }
00089       }
00090       
00091       // bbtk::Interpreter::mGlobalInterpreter->InterpretLine( ccommand );
00092       system ( ccommand.c_str() );
00093       pch = strtok (NULL, ";");
00094       }
00095       //      bbSetOutputOut( bbGetInputIn() );
00096   */
00097   }

void bbstd::ExecSystemCommand::bbUserConstructor (  )  [protected, virtual]

Definition at line 42 of file bbstdExecSystemCommand.cxx.

00043   { 
00044     bbSetInputIn("help");
00045   }


The documentation for this class was generated from the following files:

Generated on Tue Oct 21 16:06:50 2008 for std by  doxygen 1.5.6