23.11
|
Go to the documentation of this file.
24 #ifndef ARM_COMPUTE_UTILS_OPTIONBASE
25 #define ARM_COMPUTE_UTILS_OPTIONBASE
60 virtual bool parse(std::string value) = 0;
66 virtual std::string
help()
const = 0;
72 std::string
name()
const;
100 bool _is_required{
false};
109 inline Option::Option(std::string
name,
bool is_required,
bool is_set)
110 : _name{std::move(
name)}, _is_required{is_required}, _is_set{is_set}
119 inline void Option::set_required(
bool is_required)
121 _is_required = is_required;
124 inline void Option::set_help(std::string
help)
126 _help = std::move(
help);
129 inline bool Option::is_required()
const
134 inline bool Option::is_set()
const
virtual ~Option()=default
Default destructor.
virtual std::string help() const =0
Help message for the option.
void set_required(bool is_required)
Set whether the option is required.
Option(std::string name)
Constructor.
virtual bool parse(std::string value)=0
Parses the given string.
bool is_set() const
Has a value been assigned to the option?
std::string name() const
Name of the option.
void set_help(std::string help)
Set the help message for the option.
Copyright (c) 2017-2023 Arm Limited.
Abstract base class for a command line option.
bool is_required() const
Is the option required?