Ignore:
Timestamp:
Aug 11, 2004, 3:10:25 PM (21 years ago)
Author:
ansari
Message:

Documentation (ajoutee ou completee) pour les classes du module SysTools - Reza 11 Aout 2004

File:
1 edited

Legend:

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

    r2532 r2598  
    2525// ------------------------------------------------------------
    2626/*!
     27  \internal
    2728  \class SOPHYA::CommanderBloc
    2829  \ingroup SysTools
    29   Class for internal use by SOPHYA::Commander to handle loops
     30  Class for internal use by class Commander to handle loops
    3031*/
    3132class CommanderBloc {
     
    253254
    254255/*!
     256  \internal
    255257  \class SOPHYA::CommanderScript
    256258  \ingroup SysTools
    257   Class for internal use by SOPHYA::Commander to handle functions
     259  Class for internal use by class Commander to handle functions
    258260  or scripts
    259261*/
     
    334336
    335337/*!
    336   \class SOPHYA::Commander
     338  \class Commander
    337339  \ingroup SysTools
    338   Simple command interpreter with c-shell like syntax and dynamic
    339   load capabilities. Can be used to add scripting capabilities
    340   to applications
     340  \brief Simple command interpreter
     341
     342  This Simple command interpreter with c-shell like syntax
     343  can be used to add scripting capabilities
     344  to applications.
     345
     346  Although the insterpreter has many limitations compared to
     347  c-shell, or Tcl , it provides some interesting possibilities:
     348
     349  - Extended arithmetic operations (c-like and RPN)
     350  - Simple and vector variables
     351  - Script definition
     352  - Dynamic Load
     353
     354  \sa CmdExecutor CExpressionEvaluator RPNExpressionEvaluator
     355
     356  Usage example:
     357  \code
     358  #include "commander.h"
     359  ...
     360  Commander cmd;
     361  char* ss[3] = {"foreach f ( AA bbb CCCC ddddd )", "echo $f" , "end"};
     362  for(int k=0; k<3; k++) {
     363    string line = ss[k];
     364    cmd.Interpret(line);
     365  }
     366  \endcode
    341367*/
    342368
     
    345371static Commander* cur_commander = NULL;
    346372/* --Methode-- */
     373//! Default constructor. Initializes variable list and copies \c history.pic to \c hisold.pic
    347374Commander::Commander()
    348375{
     
    488515
    489516/* --Methode-- */
     517//! Returns the string \c Commander as the interpreter's name.
    490518string Commander::Name()
    491519{
     
    494522
    495523/* --Methode-- */
     524//! Add the \b grp help group with description \b desc.
    496525void Commander::AddHelpGroup(string& grp, string& desc)
    497526{
     
    501530
    502531/* --Methode-- */
     532/*!
     533  \brief Register a command executor associated with a given keyword.
     534  \param keyw : keyword identifying the command
     535  \param usage : the command help and usage information
     536  \param ce : CmdExecutor pointer for this a command. The same object can be registered
     537  multiple time for different commands.
     538  \param grp : The help group corresponding to this command.
     539*/
    503540void Commander::RegisterCommand(string& keyw, string& usage, CmdExecutor * ce, string& grp)
    504541{
     
    517554
    518555/* --Methode-- */
     556/*!
     557  \brief Register a help text.
     558  \param keyw : help keyword
     559  \param usage : help text
     560  \param grp : help group
     561*/
    519562void Commander::RegisterHelp(string& keyw, string& usage, string& grp)
    520563{
     
    548591
    549592/* --Methode-- */
     593/*!
     594  \brief  Dynamic loader for modules
     595
     596  A module is a shared library extending the application functionalities.
     597  Typically, a module adds new commands to the interpreter. Once loaded,
     598  the module is activated (initialized) by calling a function with the
     599  name \b modulename_init . This function should be declared extern C
     600  to avoid C++ name mangling. A cleanup function \b modulename_end
     601  is called by the Commander destructor.
     602
     603  \param fnameso : Shared library name containing the module functions
     604  and classes.
     605  \param name : Module name. This string is used to form module
     606  initializer and cleanup function name \c name_init \c name_end
     607*/
    550608void Commander::LoadModule(string& fnameso, string& name)
    551609{
     
    569627
    570628/* --Methode-- */
     629//! Declare a new interpreter
    571630void Commander::AddInterpreter(CmdInterpreter * cl)
    572631{
     
    575634
    576635/* --Methode-- */
     636//! Select an interpreter by its name. The corresponding Interpret method is then called
    577637void Commander::SelInterpreter(string& name)
    578638{
     
    594654
    595655/* --Methode-- */
     656/*!
     657  \brief Method which has to be invoked to interpret a giev command line or string.
     658*/
    596659int Commander::Interpret(string& s)
    597660{
     
    18941957
    18951958/* --Methode-- */
     1959//! Produces a LaTeX file containing the registered command helps
    18961960void Commander::HelptoLaTeX(string const & fname)
    18971961{
Note: See TracChangeset for help on using the changeset viewer.