Changeset 1268 in Sophya for trunk/SophyaPI/PIext/piacmd.cc


Ignore:
Timestamp:
Nov 1, 2000, 1:01:28 AM (25 years ago)
Author:
ercodmgr
Message:

3ieme argument string& toks pour Execute et ExecuteCommand
preparation gestion TmpDir dans cxxexecutor
suppression de ExecuteCXX ds cxxexecutor et appels
possibilite d'ajouter des userfct.cc ds cxxexecutor

cmv 1/11/00

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/piacmd.cc

    r1265 r1268  
    553553    return(99);
    554554  }
    555   // Sans substitution des variables $
    556   if (s[1] == '@') return(cxxe->ExecuteCxx(s.substr(2)));
    557   else { // Avec substitution de variables $
     555  string localkey = "c++exec", localstr;
     556  vector<string> localtokens;
     557  if (s[1] == '@') { // Sans substitution des variables $
     558    localstr = s.substr(2);
     559    localtokens.push_back(localstr);
     560    return(cxxe->Execute(localkey,localtokens,localstr));
     561  } else { // Avec substitution de variables $
    558562    string s2;
    559563    SubstituteVars(s, s2);
    560     return(cxxe->ExecuteCxx(s2.substr(1)));   
     564    localstr = s2.substr(1);
     565    localtokens.push_back(localstr);
     566    return(cxxe->Execute(localkey,localtokens,localstr));   
    561567  }
    562568}
     
    820826//  Execution d'une commande enregistree
    821827// CMV c'est ici qu'il faut passer la string
    822 else rc = ExecuteCommand(kw, tokens);
     828else rc = ExecuteCommand(kw, tokens, toks);
    823829
    824830if (timing)  gltimer->Split();
     
    853859  }
    854860
    855 return(ExecuteCommand(kw, tokens)); 
    856 }
    857 
    858 /* --Methode-- */
    859 int PIACmd::ExecuteCommand(string& keyw, vector<string>& args)
     861return(ExecuteCommand(kw, tokens, toks)); 
     862}
     863
     864/* --Methode-- */
     865int PIACmd::ExecuteCommand(string& keyw, vector<string>& args, string& toks)
    860866{
    861867  int rc = -1;
     
    863869  if (it == cmdexmap.end())  cout << "No such command : " << keyw << " ! " << endl;
    864870  else {
    865     if ((*it).second.cex) rc = (*it).second.cex->Execute(keyw, args);
     871    if ((*it).second.cex) rc = (*it).second.cex->Execute(keyw, args, toks);
    866872    else cout << "Dont know how to execute " << keyw << " ? " << endl;
    867873    }
Note: See TracChangeset for help on using the changeset viewer.