ROSE
0.11.96.11
|
Functor to configure diagnostics.
This functor uses the string(s) from the specified switch key to configure the specified message facilities object. If a string is the word "list" then the message facility configuration is shown on standard output. If the string is the word "help" then some documentation is emitted on std::cout
and the program optionally exits with success (depending on exitOnHelp
).
Here's an example usage. In particular, be sure to specify SAVE_ALL so that more than one –log
switch can appear on the command line, like: a.out –log ">=info" –log list
Definition at line 1726 of file util/Sawyer/CommandLine.h.
#include <CommandLine.h>
Public Types | |
typedef SharedPointer< ConfigureDiagnostics > | Ptr |
Reference counting pointer for this class. | |
Public Types inherited from Sawyer::CommandLine::SwitchAction | |
typedef SharedPointer< SwitchAction > | Ptr |
Reference counting pointer for this class. | |
Public Member Functions | |
bool | exitOnHelp () const |
Property: program exit after help is displayed. More... | |
void | exitOnHelp (bool b) |
Property: program exit after help is displayed. More... | |
Public Member Functions inherited from Sawyer::CommandLine::SwitchAction | |
void | run (const ParserResult &parserResult) |
Runs the action. More... | |
Public Member Functions inherited from Sawyer::SharedObject | |
SharedObject () | |
Default constructor. More... | |
SharedObject (const SharedObject &) | |
Copy constructor. More... | |
virtual | ~SharedObject () |
Virtual destructor. More... | |
SharedObject & | operator= (const SharedObject &) |
Assignment. More... | |
Static Public Member Functions | |
static Ptr | instance (const std::string &switchKey, Message::Facilities &facilities, bool exitOnHelp=true) |
Allocating constructor. More... | |
Protected Member Functions | |
ConfigureDiagnostics (const std::string &switchKey, Message::Facilities &facilities, bool exitOnHelp) | |
Constructor for derived classes. More... | |
virtual void | operator() (const ParserResult &) |
|
inlineprotected |
Constructor for derived classes.
Non-subclass users should use instance instead.
Definition at line 1734 of file util/Sawyer/CommandLine.h.
|
inlinestatic |
Allocating constructor.
Returns a pointer to a new ConfigureDiagnostics object. Users will most likely want to use the configureDiagnostics factory instead, which requires less typing.
Definition at line 1744 of file util/Sawyer/CommandLine.h.
|
inline |
Property: program exit after help is displayed.
If true, then the program exits with success immediately after a "help" command is processed.
Definition at line 1753 of file util/Sawyer/CommandLine.h.
|
inline |
Property: program exit after help is displayed.
If true, then the program exits with success immediately after a "help" command is processed.
Definition at line 1754 of file util/Sawyer/CommandLine.h.