Radium Engine
1.5.20
|
#include <Headless/CLIBaseApplication.hpp>
Public Member Functions | |
CLIBaseApplication ()=default | |
Base constructor. | |
virtual | ~CLIBaseApplication ()=default |
Base destructor. | |
template<typename... Args> | |
CLI::Option * | addOption (Args &&... args) |
template<typename... Args> | |
CLI::Option * | addFlag (Args &&... args) |
virtual int | init (int argc, const char *argv[]) |
Protected Attributes | |
CLI::App | m_cmdLineParser |
Base class for command line interface Radium application. This class is just a command-line parser (simple wrapper to a CLI::App object). Derived application should populate the parser using the addOptions() or addFlags methods. Derived applications can also use the CLI11 API to populate the protected member m_cmdLineParser.
Once the parser is populated, derived application should call the inherited init() method which only parse the command line and return the result of this parsing.
Definition at line 18 of file CLIBaseApplication.hpp.
CLI::Option * Ra::Headless::CLIBaseApplication::addFlag | ( | Args &&... | args | ) |
adapter allowing to add a command line flag on an application the same way than using CLI11 directly.
Definition at line 67 of file CLIBaseApplication.hpp.
CLI::Option * Ra::Headless::CLIBaseApplication::addOption | ( | Args &&... | args | ) |
adapter allowing to add a command line option on an application the same way than using CLI11 directly.
Definition at line 62 of file CLIBaseApplication.hpp.
|
virtual |
Application initialization method.
This method should be called by the derived application to parse the command line. Overriden method should use the command line parsing result to initialize their internal state and return 0 if initialization succeeded or an application dependant error code if not.
argc | number of parameter |
argv | array of string representing the parameters |
Reimplemented in Ra::Headless::CLIRadiumEngineApp.
Definition at line 6 of file CLIBaseApplication.cpp.
|
protected |
Command-line parameters parser. Derived classes should extend this parser to add their own parameters
Definition at line 25 of file CLIBaseApplication.hpp.