Program options.
More...
#include <app.hpp>
|
| ProgramOptions (const std::string &app_name, const std::vector< Option > &options) |
| Constructor.
|
|
virtual | ~ProgramOptions () |
| Destructor.
|
|
bool | LoadFromArgv (int argc, char **argv) |
| Load arguments from argv[].
|
|
virtual void | PrintHelp ()=0 |
| Print the help screen and exit(0)
|
|
virtual bool | HandleOption (const Option &option, const std::string &argument)=0 |
| Handle a command-line flag argument.
|
|
virtual bool | CheckOptions (const std::vector< std::string > &args) |
| Check options, and handle non-flag arguments.
|
|
Program options.
Definition at line 114 of file app.hpp.
◆ LoadFromArgv()
bool fpsdk::common::app::ProgramOptions::LoadFromArgv |
( |
int | argc, |
|
|
char ** | argv ) |
Load arguments from argv[].
- Parameters
-
[in,out] | argc | Number of arguments |
[in,out] | argv | Command-line arguments |
- Returns
◆ PrintHelp()
virtual void fpsdk::common::app::ProgramOptions::PrintHelp |
( |
| ) |
|
|
pure virtual |
◆ HandleOption()
virtual bool fpsdk::common::app::ProgramOptions::HandleOption |
( |
const Option & | option, |
|
|
const std::string & | argument ) |
|
pure virtual |
Handle a command-line flag argument.
- Parameters
-
[in] | option | The option |
[in] | argument | Optional argument |
- Returns
- true if option was accepted, false otherwise
Implemented in fpsdk::apps::fpltool::FplToolOptions.
◆ CheckOptions()
virtual bool fpsdk::common::app::ProgramOptions::CheckOptions |
( |
const std::vector< std::string > & | args | ) |
|
|
inlinevirtual |
Check options, and handle non-flag arguments.
- Parameters
-
[in] | args | The non-flag arguments |
- Returns
- true if options are good, false otherwise
Reimplemented in fpsdk::apps::fpltool::FplToolOptions.
Definition at line 167 of file app.hpp.
◆ COMMON_FLAGS_HELP
const char* fpsdk::common::app::ProgramOptions::COMMON_FLAGS_HELP |
|
staticconstexpr |
◆ app_name_
std::string fpsdk::common::app::ProgramOptions::app_name_ |
◆ logging_
Logging verbosity level.
Definition at line 180 of file app.hpp.
◆ argv_
std::vector<std::string> fpsdk::common::app::ProgramOptions::argv_ |
argv[] of program
Definition at line 181 of file app.hpp.
The documentation for this class was generated from the following file:
- fpsdk_common/include/fpsdk_common/app.hpp