|
hydrogen 1.2.6
|
Reusable parser for provided command line arguments. More...
#include <Parser.h>
Public Member Functions | |
| Parser () | |
| ~Parser () | |
| const QString & | getAudioDriver () const |
| const QString & | getConfigFilePath () const |
| const QString & | getDrumkitToLoad () const |
| const QString & | getInstallDrumkitPath () const |
| bool | getLogColors () const |
| const QString & | getLogFile () const |
| unsigned | getLogLevel () const |
| bool | getLogTimestamps () const |
| bool | getNoReporter () const |
| bool | getNoSplashScreen () const |
| int | getOscPort () const |
| const QString & | getPlaylistFilename () const |
| const QString & | getShotList () const |
| const QString & | getSongFilename () const |
| const QString & | getSysDataPath () const |
| const QString & | getUiLayout () const |
| const QString & | getUsrDataPath () const |
| bool | parse (int argc, char *argv[]) |
Private Attributes | |
| bool | m_bLogColors |
| bool | m_bLogTimestamps |
| bool | m_bNoReporter |
| bool | m_bNoSplashScreen |
| unsigned | m_logLevel |
| int | m_nOscPort |
| QString | m_sAudioDriver |
| QString | m_sConfigFilePath |
| QString | m_sDrumkitToLoad |
| QString | m_sInstallDrumkitPath |
| QString | m_sLogFile |
| QString | m_sPlaylistFilename |
| QString | m_sShotList |
| QString | m_sSongFilename |
| QString | m_sSysDataPath |
| QString | m_sUiLayout |
| QString | m_sUsrDataPath |
Reusable parser for provided command line arguments.
In our current design we have to access the CLI arguments of the hydrogen program at two different points (h2cli and h2player have other CLI options and are not covered in here): 1. In Reporter and 2. in the main routine it spawns.
Some CLI args, like the path to a custom log file, are important for the Reporter as well. But it can not access them through the child process but has to retrieve it from the CLI args itself. Here it is crucial to a) perform the parsing in the same way in order to avoid inconsistencies and b) keep the parsing with the one in the main routine in sync as QCommandLineParser will complain about arguments unknown to it. That's why we abstract it in a separate class.
Note that this is not a H2_OBJECT. It get's invoked way ahead of H2Core::Logger::bootstrap() and H2Core::Base::bootstrap() and could not be used with our usual logging macros etc.
| Parser | ( | ) |
Definition at line 34 of file Parser.cpp.
| ~Parser | ( | ) |
Definition at line 37 of file Parser.cpp.
| bool parse | ( | int | argc, |
| char * | argv[] ) |
Definition at line 40 of file Parser.cpp.