Changeset 2466 in Sophya for trunk/SophyaLib/SysTools/commander.h
- Timestamp:
- Nov 27, 2003, 11:52:55 AM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SysTools/commander.h
r2446 r2466 73 73 virtual string Name(); 74 74 75 virtual void AddHelpGroup(string& grp, string& desc); 75 76 virtual void RegisterCommand(string& keyw, string& usage, CmdExecutor * ce, 76 string grp="Commands"); 77 string& grp); 78 inline void RegisterCommand(string& keyw, string& usage, CmdExecutor * ce, 79 char* grp) 80 { string sgrp = grp; RegisterCommand(keyw, usage, ce, sgrp); } 81 77 82 virtual void RegisterHelp(string& keyw, string& usage, string& grp); 78 83 … … 104 109 string& toks, bool uq=true); 105 110 protected: 106 virtual int CheckHelpGrp(string& grp); 111 virtual bool CheckHelpGrp(string& grp, int& gid, string& desc); 112 inline bool CheckHelpGrp(string& grp, int& gid) 113 { string desc=""; return CheckHelpGrp(grp, gid, desc); } 114 107 115 int ExecuteCommandLine(string & keyw, vector<string> & args, 108 116 string & toks); … … 135 143 // Pour enregistrer la liste de commandes et leurs executeurs et le help 136 144 struct cmdex {int group; string us; CmdExecutor * cex; } ; 137 typedef map<string, int, less<string> > CmdHGroup; // Liste des groupes de commandes 145 struct hgrpst {int gid; string desc; } ; // Identification+description d'un groupe de help 146 typedef map<string, hgrpst, less<string> > CmdHGroup; // Liste des groupes de commandes 138 147 CmdHGroup cmdhgrp; 139 int cmdgrpid; // Numero de groupe courant140 typedef map<string, cmdex, less<string> > CmdExmap; 141 CmdExmap cmdexmap; 142 CmdExmap helpexmap; // Pour les helps sans commande148 int cmdgrpid; // Numero de groupe courant 149 typedef map<string, cmdex, less<string> > CmdExmap; 150 CmdExmap cmdexmap; // Liste des commandes et leurs executeurs 151 CmdExmap helpexmap; // Pour les helps sans commande 143 152 144 153 // Pour garder la liste des modules
Note:
See TracChangeset
for help on using the changeset viewer.