30 friend class ::ap::argument_parser;
42 [[nodiscard]]
const std::optional<std::string>&
help() const noexcept {
77 virtual bool is_used() const noexcept = 0;
80 virtual std::
size_t count() const noexcept = 0;
99 virtual const std::any&
value() const = 0;
102 virtual const std::vector<std::any>&
values() const = 0;
121 return choices.empty() or std::ranges::find(choices,
value) != choices.end();
Defines structures for formatting argument descriptions.
Argument class interface.
virtual bool has_value() const noexcept=0
virtual std::weak_ordering nvalues_ordering() const noexcept=0
const ap::detail::argument_name _name
bool is_required() const noexcept
virtual std::size_t count() const noexcept=0
virtual bool is_used() const noexcept=0
virtual bool set_value(const std::string &value)=0
Set the value for the argument.
bool is_hidden() const noexcept
virtual const std::any & value() const =0
const ap::detail::argument_name & name() const noexcept
virtual ~argument_base()=default
bool bypass_required_enabled() const noexcept
virtual const std::vector< std::any > & values() const =0
const std::optional< std::string > & help() const noexcept
virtual detail::argument_descriptor desc(const bool verbose) const noexcept=0
std::optional< std::string > _help_msg
virtual bool has_parsed_values() const noexcept=0
virtual bool mark_used()=0
Mark the argument as used.
argument_base(const argument_name &name, const bool required=false)
A structure used to represent an argument's description.
The concept is used to verify the validity of the arguments' value types.
bool is_valid_choice(const T &value, const std::vector< T > &choices) noexcept
Checks if the provided choice is valid for the given set of choices.
Structure holding the argument's name.