]> Creatis software - bbtk.git/blobdiff - packages/std/src/bbstdExecSystemCommand.cxx
*** empty log message ***
[bbtk.git] / packages / std / src / bbstdExecSystemCommand.cxx
index 1e8ee9e8c2d8bef4736b8ff4c554e08d5b943751..a2daacbfed87dca4d3324e88697b2f3004599e3c 100755 (executable)
@@ -7,13 +7,12 @@ namespace bbstd
 
   BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,ExecSystemCommand);
   BBTK_BLACK_BOX_IMPLEMENTATION(ExecSystemCommand,bbtk::AtomicBlackBox);
-  
+
   void ExecSystemCommand::bbUserConstructor() 
   { 
     bbSetInputIn("help");
   }
-  
-  
+
   void ExecSystemCommand::DoProcess()
   {
     bool ok=true;
@@ -21,29 +20,28 @@ namespace bbstd
     pos2 = bbGetInputIn().find(";",pos1);
     std::string ccommand;
     while (ok)
-      {                        
+      {
        if (pos2==-1) 
          {
            ok=false;
            ccommand=bbGetInputIn().substr(pos1,bbGetInputIn().length()-pos1 );
-         } 
-       else 
-         {
+          } else {
            ccommand=bbGetInputIn().substr(pos1,pos2-pos1);
          }
-       for (unsigned int i=0 ; i < ccommand.length() ; i++)
+         for (unsigned int i=0 ; i < ccommand.length() ; i++)
          {
            if (ccommand[i]==39)
-             {
-               ccommand[i]=34;
-             }
-         }     
+           {
+                 ccommand[i]=34;
+        }
+     }
        std::cout << "*** Executing system command : '"<<ccommand<<"'"<<std::endl;
        system ( ccommand.c_str() );
        pos1=pos2+1;
        pos2 = bbGetInputIn().find(";",pos2+1);
       }
-    /*
+
+    /* Grrr  not works in windows
       int i;
       char *str = (char*)bbGetInputIn().c_str();
       char * pch;
@@ -57,17 +55,15 @@ namespace bbstd
       {
       ccommand[i]=34;
       }
-      }                
+      }
       
       // bbtk::Interpreter::mGlobalInterpreter->InterpretLine( ccommand );
       system ( ccommand.c_str() );
       pch = strtok (NULL, ";");
       }
-      //      bbSetOutputOut( bbGetInputIn() );          
-      */
+      //      bbSetOutputOut( bbGetInputIn() );
+  */
   }
-  
-  
 } // EO namespace bbstd