Changeset 2466 in Sophya for trunk/SophyaLib/SysTools/commander.h


Ignore:
Timestamp:
Nov 27, 2003, 11:52:55 AM (22 years ago)
Author:
ansari
Message:

Amelioration classe SOPHYA::Commander, en particulier Ajout description d'un HelpGroup - Reza 27 Nov 2003

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/SysTools/commander.h

    r2446 r2466  
    7373  virtual string        Name();
    7474
     75  virtual void          AddHelpGroup(string& grp, string& desc);
    7576  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
    7782  virtual void          RegisterHelp(string& keyw, string& usage, string& grp);
    7883
     
    104109                            string& toks, bool uq=true);
    105110protected:
    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
    107115  int           ExecuteCommandLine(string & keyw, vector<string> & args,
    108116                                   string & toks);
     
    135143// Pour enregistrer la liste de commandes et leurs executeurs et le help
    136144  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
    138147  CmdHGroup cmdhgrp;
    139   int cmdgrpid;                                     // Numero de groupe courant
    140   typedef map<string, cmdex, less<string> > CmdExmap;
    141   CmdExmap cmdexmap;
    142   CmdExmap helpexmap;                               // Pour les helps sans commande
     148  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
    143152
    144153// Pour garder la liste des modules
Note: See TracChangeset for help on using the changeset viewer.