OptionParser
#include <icy/application.h>
struct OptionParserDefined in src/base/include/icy/application.h:103
Public Attributes
exepath
std::string exepathDefined in src/base/include/icy/application.h:105
args
OptionMap argsType: OptionMap
Defined in src/base/include/icy/application.h:106
Public Methods
| Return | Name | Description |
|---|---|---|
OptionParser | Parses command-line arguments from argc/argv. | |
bool | has inline | Returns true if the given option key was present on the command line. |
std::string | get inline | Returns the string value associated with the given option key. Returns an empty string if the key was not found. |
NumericType | get inline | Returns the value associated with the given option key, converted to a numeric type. |
OptionParser
OptionParser(int argc, char * argv, const char * delim)Defined in src/base/include/icy/application.h:112
Parses command-line arguments from argc/argv.
Parameters
| Parameter | Type | Description |
|---|---|---|
argc | int | Argument count from main(). |
argv | char * | Argument vector from main(). |
delim | const char * | Prefix string that identifies an option key (e.g. "--"). |
has
inline
inline bool has(const char * key)Defined in src/base/include/icy/application.h:117
Returns true if the given option key was present on the command line.
Returns
True if the key exists in the parsed argument map.
Parameters
| Parameter | Type | Description |
|---|---|---|
key | const char * | Option key to look up (without delimiter prefix). |
get
inline
inline std::string get(const char * key)Defined in src/base/include/icy/application.h:123
Returns the string value associated with the given option key. Returns an empty string if the key was not found.
Returns
Value string, or empty string if not present.
Parameters
| Parameter | Type | Description |
|---|---|---|
key | const char * | Option key to look up. |
get
inline
template<typename NumericType> inline NumericType get(const char * key)Defined in src/base/include/icy/application.h:136
Returns the value associated with the given option key, converted to a numeric type.
Returns
Converted numeric value.
Parameters
| Parameter | Type | Description |
|---|---|---|
key | const char * | Option key to look up. |
