mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-07-09 10:35:21 +02:00
Switched to new cleaner argument system
This commit is contained in:
@ -86,6 +86,31 @@ public:
|
||||
return sval;
|
||||
}
|
||||
|
||||
bool b() {
|
||||
if (type != CLI_ARG_TYPE_BOOL && type != CLI_ARG_TYPE_VOID) { throw std::runtime_error("Not a bool"); }
|
||||
return bval;
|
||||
}
|
||||
|
||||
int i() {
|
||||
if (type != CLI_ARG_TYPE_INT) { throw std::runtime_error("Not an int"); }
|
||||
return ival;
|
||||
}
|
||||
|
||||
float f() {
|
||||
if (type != CLI_ARG_TYPE_FLOAT) { throw std::runtime_error("Not a float"); }
|
||||
return (float)fval;
|
||||
}
|
||||
|
||||
double d() {
|
||||
if (type != CLI_ARG_TYPE_FLOAT) { throw std::runtime_error("Not a float"); }
|
||||
return fval;
|
||||
}
|
||||
|
||||
const std::string& s() {
|
||||
if (type != CLI_ARG_TYPE_STRING) { throw std::runtime_error("Not a string"); }
|
||||
return sval;
|
||||
}
|
||||
|
||||
friend CommandArgsParser;
|
||||
|
||||
CLIArgType type;
|
||||
|
Reference in New Issue
Block a user