![]() |
appkit
1.5.1
RoadNarrows Robotics Application Kit
|
Add-Ons. More...
Enumerations | |
| enum | HelpSect { HelpSectAll, HelpSectName, HelpSectBrief, HelpSectUsage } |
| Command help section identifiers. More... | |
Functions | |
| int | printCmdHelp (std::ostream &os, const CmdDef &cmddef, const HelpSect section=HelpSectAll) |
| Print help for a command convenience function. More... | |
| int | printCmdHelp (std::ostream &os, const CmdDesc &desc, const HelpSect section=HelpSectAll) |
| Print help for a command convenience function. More... | |
| int | printCmdHelp (std::ostream &os, const std::string &strName, const std::string &strSyntax, const std::string &strSynopsis, const std::string &strLongDesc, const HelpSect section=HelpSectAll) |
| Print help for a command convenience function. More... | |
| int | addHelpCommand (CommandLine &cli, const std::string &strName="help") |
| Add the core 'help' command to the command-line interface. More... | |
| int | addQuitCommand (CommandLine &cli, const std::string &strName="quit") |
| Add the core 'quit' command to the command-line interface. More... | |
| int | addBtEnableCommand (CommandLine &cli, const std::string &strName="bt") |
| Add the core 'bt' command to the command-line interface. More... | |
| static string | atname ("@N@") |
| string to replace by command name | |
| static int | execHelp (CommandLine &cli, const CmdExtArgVec &argv) |
| Execute 'help' command. More... | |
| int | printCmdHelp (ostream &os, const CmdDef &cmddef, const HelpSect section) |
| int | printCmdHelp (ostream &os, const CmdDesc &desc, const HelpSect section) |
| int | printCmdHelp (ostream &os, const string &strName, const string &strSyntax, const string &strSynopsis, const string &strLongDesc, const HelpSect section) |
| int | addHelpCommand (CommandLine &cli, const string &strName) |
| static int | execQuit (CommandLine &cli, const CmdExtArgVec &argv) |
| Execute 'quit' command. More... | |
| int | addQuitCommand (CommandLine &cli, const string &strName) |
| static int | execBtEnable (CommandLine &cli, const CmdExtArgVec &argv) |
| Execute 'backtrace' command. More... | |
| int | addBtEnableCommand (CommandLine &cli, const string &strName) |
Add-Ons.
Command help section identifiers.
| Enumerator | |
|---|---|
| HelpSectAll |
all commond help sections |
| HelpSectName |
command name help section |
| HelpSectBrief |
command brief description help section |
| HelpSectUsage |
command usage (synopsis) help section |
Definition at line 95 of file CmdAddOns.h.
| int rnr::cmd::addons::addBtEnableCommand | ( | CommandLine & | cli, |
| const std::string & | strName = "bt" |
||
| ) |
Add the core 'bt' command to the command-line interface.
Syntax: bt <onoff>
The bt command enables/disables backtracing of input line parsing. The trace is written to cerr.
Any relevant command data is applied to the command line interface "core" data section.
The name of the command may be overridded, but the syntax and semantics cannot.
| cli | Command-line interface. |
| strName | Name of the command. |
Referenced by execBtEnable(), and loadCommands().
| int rnr::cmd::addons::addHelpCommand | ( | CommandLine & | cli, |
| const std::string & | strName = "help" |
||
| ) |
Add the core 'help' command to the command-line interface.
Syntax: help [{–brief | -b | –list | -l | –usage | -u}] [<cmd>]
The help command will print help for the given help sections for the given command names to cout.
Any relevant command data is applied to the command line interface "core" data section.
The name of the command may be overridded, but the syntax and semantics cannot.
| cli | Command-line interface. |
| strName | Name of the command. |
Referenced by loadCommands(), and printCmdHelp().
| int rnr::cmd::addons::addQuitCommand | ( | CommandLine & | cli, |
| const std::string & | strName = "quit" |
||
| ) |
Add the core 'quit' command to the command-line interface.
Syntax: quit
The quit command will disable anymore execution of the command line. It is up to the application to terminate by querying the command line ok() method.
Any relevant command data is applied to the command line interface "core" data section.
The name of the command may be overridded, but the syntax and semantics cannot.
| cli | Command-line interface. |
| strName | Name of the command. |
Referenced by execQuit(), and loadCommands().
|
static |
Execute 'backtrace' command.
| cli | Command line interface. |
| argv | Extended command line arguments. |
Definition at line 474 of file CmdAddOns.cxx.
References addBtEnableCommand(), rnr::cmd::CommandLine::addCommand(), atname(), rnr::cmd::CmdDesc::name, rnr::str::replace(), and rnr::cmd::CommandLine::setBtEnable().
|
static |
Execute 'help' command.
| cli | Command line interface. |
| argv | Extended command line arguments. |
Definition at line 114 of file CmdAddOns.cxx.
References rnr::cmd::CommandLine::at(), rnr::cmd::CommandLine::begin(), rnr::cmd::CommandLine::end(), rnr::cmd::CmdDef::getLongDesc(), rnr::cmd::CmdDef::getName(), rnr::cmd::CmdDef::getSynopsis(), rnr::cmd::CmdDef::getSyntax(), rnr::cmd::CmdDef::getUid(), HelpSectAll, HelpSectBrief, HelpSectName, HelpSectUsage, rnr::cmd::CmdDesc::longdesc, rnr::cmd::CmdDesc::name, rnr::cmd::NoUid, printCmdHelp(), rnr::cmd::CmdDesc::synopsis, and rnr::cmd::CmdDesc::syntax.
Referenced by printCmdHelp().
|
static |
Execute 'quit' command.
| cli | Command line interface. |
| argv | Extended command line arguments. |
Definition at line 428 of file CmdAddOns.cxx.
References rnr::cmd::CommandLine::addCommand(), addQuitCommand(), atname(), rnr::cmd::CmdDesc::name, rnr::cmd::CommandLine::quit(), and rnr::str::replace().
| int rnr::cmd::addons::printCmdHelp | ( | std::ostream & | os, |
| const CmdDef & | cmddef, | ||
| const HelpSect | section = HelpSectAll |
||
| ) |
Print help for a command convenience function.
| os | Output stream. |
| cmddef | Command definition. |
| section | Help section. |
| int rnr::cmd::addons::printCmdHelp | ( | std::ostream & | os, |
| const CmdDesc & | desc, | ||
| const HelpSect | section = HelpSectAll |
||
| ) |
Print help for a command convenience function.
| os | Output stream. |
| desc | Command description. |
| section | Help section. |
| int rnr::cmd::addons::printCmdHelp | ( | std::ostream & | os, |
| const std::string & | strName, | ||
| const std::string & | strSyntax, | ||
| const std::string & | strSynopsis, | ||
| const std::string & | strLongDesc, | ||
| const HelpSect | section = HelpSectAll |
||
| ) |
Print help for a command convenience function.
| os | Output stream. |
| strName | Command name. |
| strSyntax | Command usage syntax. |
| strSynopsis | Command short synopsis. |
| strLongDesc | Command long description. |
| section | Help section. |
| int rnr::cmd::addons::printCmdHelp | ( | ostream & | os, |
| const string & | strName, | ||
| const string & | strSyntax, | ||
| const string & | strSynopsis, | ||
| const string & | strLongDesc, | ||
| const HelpSect | section | ||
| ) |
wrap and indent
Definition at line 226 of file CmdAddOns.cxx.
References rnr::cmd::CommandLine::addCommand(), addHelpCommand(), atname(), execHelp(), HelpSectAll, HelpSectBrief, HelpSectName, HelpSectUsage, rnr::cmd::CmdDesc::name, rnr::str::replace(), and rnr::str::split().
Referenced by execHelp().