Radium Engine  1.5.20
Loading...
Searching...
No Matches
Ra::Headless::CLIBaseApplication Class Reference

#include <Headless/CLIBaseApplication.hpp>

+ Inheritance diagram for Ra::Headless::CLIBaseApplication:
+ Collaboration diagram for Ra::Headless::CLIBaseApplication:

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
 

Detailed Description

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.

See also
https://cliutils.github.io/CLI11/book/ for a description of the wrapped commandline parser.

Definition at line 18 of file CLIBaseApplication.hpp.

Member Function Documentation

◆ addFlag()

template<typename... Args>
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.

See also
https://cliutils.github.io/CLI11/book/chapters/flags.html

Definition at line 67 of file CLIBaseApplication.hpp.

◆ addOption()

template<typename... Args>
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.

See also
https://cliutils.github.io/CLI11/book/chapters/options.html

Definition at line 62 of file CLIBaseApplication.hpp.

◆ init()

int Ra::Headless::CLIBaseApplication::init ( int argc,
const char * argv[] )
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.

Parameters
argcnumber of parameter
argvarray of string representing the parameters
Returns
0 if the command line parsing success or the parsing error code if something went wrong (see https://cliutils.github.io/CLI11/class_c_l_i_1_1_app.html#aac000657ef11647125ba91af38fd7d9c).

Reimplemented in Ra::Headless::CLIRadiumEngineApp.

Definition at line 6 of file CLIBaseApplication.cpp.

Member Data Documentation

◆ m_cmdLineParser

CLI::App Ra::Headless::CLIBaseApplication::m_cmdLineParser
protected

Command-line parameters parser. Derived classes should extend this parser to add their own parameters

Definition at line 25 of file CLIBaseApplication.hpp.


The documentation for this class was generated from the following files: