Changeset 2518 in Sophya for trunk/SophyaLib/SysTools/commander.h
- Timestamp:
- Mar 18, 2004, 7:15:19 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SysTools/commander.h
r2483 r2518 91 91 inline CmdInterpreter* CurrentInterpreter() { return(curcmdi); } 92 92 93 // Utilitaire pour decoupage en mot94 static int LineToWords(string& line, string& kw, vector<string>& tokens,95 string& toks, bool uq=true);96 protected:97 virtual int ParseLineExecute(string& line, bool qw=true);98 99 virtual int ExecuteCommandLine(string & keyw, vector<string> & args,100 string & toks);101 102 virtual bool CheckHelpGrp(string& grp, int& gid, string& desc);103 inline bool CheckHelpGrp(string& grp, int& gid)104 { string desc=""; return CheckHelpGrp(grp, gid, desc); }105 106 virtual int SubstituteVars(string & s, string & s2);107 int EvaluateTest(vector<string> & args,108 string & line, bool & res);109 int EvalRPNExpr(vector<string> & args, string & line);110 111 // Acces aux variables112 virtual bool Var2Str(string const & vn, string & vv);113 inline bool Var2Str(string const & vn, int idx, string & vv)114 { return GetVar(vn, idx, vv); }115 inline bool Var2Str(string const & vn, vector<string> & vv)116 { return GetVar(vn, vv); }117 118 93 // ----- Action / gestion des variables propres de l'interpreteur 119 94 // Verifie l'existence de la variable nomme vn et retourne sa valeur ds vv 120 95 // Retourne false si la variable n'existe pas 121 virtual bool SetVariable(string const & vn, string const & vv);122 96 virtual bool GetVar(string const & vn, string & vv); 123 97 virtual bool GetVar(string const & vn, int idx, string & vv); … … 140 114 virtual void ListVarEnv(); 141 115 116 // Utilitaire pour decoupage en mot 117 static int LineToWords(string& line, string& kw, vector<string>& tokens, 118 vector<bool>& qottoks, string& toks, bool uq=true); 119 protected: 120 virtual int ParseLineExecute(string& line, bool qw=true); 121 122 virtual int ExecuteCommandLine(string & keyw, vector<string> & args, 123 string & toks); 124 125 virtual bool CheckHelpGrp(string& grp, int& gid, string& desc); 126 inline bool CheckHelpGrp(string& grp, int& gid) 127 { string desc=""; return CheckHelpGrp(grp, gid, desc); } 128 129 virtual int SubstituteVars(string & s, string & s2); 130 int EvaluateTest(vector<string> & args, 131 string & line, bool & res); 132 int EvalRPNExpr(vector<string> & args, string & line); 133 134 // variable de l'interpreteur = valeur - accepte la syntaxe de type varname[index] 135 virtual bool SetVariable(string const & vn, string const & vv); 136 // Acces aux variables 137 virtual bool Var2Str(string const & vn, string & vv); 138 inline bool Var2Str(string const & vn, int idx, string & vv) 139 { return GetVar(vn, idx, vv); } 140 inline bool Var2Str(string const & vn, vector<string> & vv) 141 { return GetVar(vn, vv); } 142 142 143 virtual string GetTmpDir(); 143 144 … … 202 203 bool curtestresult; // Resultat courant des tests 203 204 205 // Controle du flot d'execution 206 bool fgexebrk; 207 204 208 // Commande splitees sur plusieurs lignes 205 209 bool mulinefg; // Bloc multi-lignes (ligne suite)
Note:
See TracChangeset
for help on using the changeset viewer.