CPP-AP 3.0.1
Command-line argument parser for C++20
Loading...
Searching...
No Matches
ap::detail::argument_base Class Referenceabstract

Argument class interface. More...

#include <argument_base.hpp>

Inheritance diagram for ap::detail::argument_base:
ap::argument< ArgT, T >

Public Member Functions

virtual ~argument_base ()=default
 
virtual bool is_positional () const noexcept=0
 
virtual bool is_optional () const noexcept=0
 
virtual const argument_namename () const noexcept=0
 
virtual const std::optional< std::string > & help () const noexcept=0
 
virtual bool is_hidden () const noexcept=0
 
virtual bool is_required () const noexcept=0
 
virtual bool suppresses_arg_checks () const noexcept=0
 
virtual bool suppresses_group_checks () const noexcept=0
 
virtual bool is_greedy () const noexcept=0
 

Protected Member Functions

virtual detail::help_builder help_builder (const bool verbose) const noexcept=0
 
virtual bool mark_used ()=0
 Mark the argument as used.
 
virtual bool is_used () const noexcept=0
 
virtual std::size_t count () const noexcept=0
 
virtual bool set_value (const std::string &value)=0
 Set the value for the argument.
 
virtual bool has_value () const noexcept=0
 
virtual bool has_parsed_values () const noexcept=0
 
virtual bool has_predefined_values () const noexcept=0
 
virtual std::weak_ordering nvalues_ordering () const noexcept=0
 
virtual const std::any & value () const =0
 
virtual const std::vector< std::any > & values () const =0
 

Friends

class ::ap::argument_parser
 

Detailed Description

Argument class interface.

Definition at line 26 of file argument_base.hpp.

Constructor & Destructor Documentation

◆ ~argument_base()

virtual ap::detail::argument_base::~argument_base ( )
virtualdefault

Member Function Documentation

◆ count()

virtual std::size_t ap::detail::argument_base::count ( ) const
protectedpure virtualnoexcept
Returns
The number of times an argument has been used.

Implemented in ap::argument< ArgT, T >.

◆ has_parsed_values()

virtual bool ap::detail::argument_base::has_parsed_values ( ) const
protectedpure virtualnoexcept
Returns
true if the argument has parsed values., false otherwise.

Implemented in ap::argument< ArgT, T >.

◆ has_predefined_values()

virtual bool ap::detail::argument_base::has_predefined_values ( ) const
protectedpure virtualnoexcept
Returns
true if the argument has predefined values, false otherwise.

Implemented in ap::argument< ArgT, T >.

◆ has_value()

virtual bool ap::detail::argument_base::has_value ( ) const
protectedpure virtualnoexcept
Returns
true if the argument has a value, false otherwise.

Implemented in ap::argument< ArgT, T >.

◆ help()

virtual const std::optional< std::string > & ap::detail::argument_base::help ( ) const
pure virtualnoexcept
Returns
Returns the argument's help message.

Implemented in ap::argument< ArgT, T >.

◆ help_builder()

virtual detail::help_builder ap::detail::argument_base::help_builder ( const bool  verbose) const
protectedpure virtualnoexcept
Parameters
verboseThe verbosity mode value. If true all non-default parameters will be included in the output.
Returns
A help message builder object for the argument.

Implemented in ap::argument< ArgT, T >.

◆ is_greedy()

virtual bool ap::detail::argument_base::is_greedy ( ) const
pure virtualnoexcept
Returns
true if the argument is greedy, false otherwise.

Implemented in ap::argument< ArgT, T >.

◆ is_hidden()

virtual bool ap::detail::argument_base::is_hidden ( ) const
pure virtualnoexcept
Returns
true if the argument is hidden from help output, false otherwise.

Implemented in ap::argument< ArgT, T >.

◆ is_optional()

virtual bool ap::detail::argument_base::is_optional ( ) const
pure virtualnoexcept
Returns
true if the argument is an optional argument instance, false otherwise.

Implemented in ap::argument< ArgT, T >.

◆ is_positional()

virtual bool ap::detail::argument_base::is_positional ( ) const
pure virtualnoexcept
Returns
true if the argument is a positional argument instance, false otherwise.

Implemented in ap::argument< ArgT, T >.

◆ is_required()

virtual bool ap::detail::argument_base::is_required ( ) const
pure virtualnoexcept
Returns
true if the argument is required, false otherwise.

Implemented in ap::argument< ArgT, T >.

◆ is_used()

virtual bool ap::detail::argument_base::is_used ( ) const
protectedpure virtualnoexcept
Returns
true if the argument has been used, false otherwise.

Implemented in ap::argument< ArgT, T >.

◆ mark_used()

virtual bool ap::detail::argument_base::mark_used ( )
protectedpure virtual

Mark the argument as used.

Returns
true if the argument accepts further values, false otherwise.

Implemented in ap::argument< ArgT, T >.

◆ name()

virtual const argument_name & ap::detail::argument_base::name ( ) const
pure virtualnoexcept
Returns
Returns the argument's name.

Implemented in ap::argument< ArgT, T >.

◆ nvalues_ordering()

virtual std::weak_ordering ap::detail::argument_base::nvalues_ordering ( ) const
protectedpure virtualnoexcept
Returns
The ordering relationship of argument range.

Implemented in ap::argument< ArgT, T >.

◆ set_value()

virtual bool ap::detail::argument_base::set_value ( const std::string &  value)
protectedpure virtual

Set the value for the argument.

Parameters
valueThe string representation of the value.
Returns
true if the argument accepts further values, false otherwise.

Implemented in ap::argument< ArgT, T >.

◆ suppresses_arg_checks()

virtual bool ap::detail::argument_base::suppresses_arg_checks ( ) const
pure virtualnoexcept
Returns
true if argument checks suppressing is enabled for the argument, false otherwise.

Implemented in ap::argument< ArgT, T >.

◆ suppresses_group_checks()

virtual bool ap::detail::argument_base::suppresses_group_checks ( ) const
pure virtualnoexcept
Returns
true if argument group checks suppressing is enabled for the argument, false otherwise.

Implemented in ap::argument< ArgT, T >.

◆ value()

virtual const std::any & ap::detail::argument_base::value ( ) const
protectedpure virtual
Returns
Reference to the stored value of the argument.

Implemented in ap::argument< ArgT, T >.

◆ values()

virtual const std::vector< std::any > & ap::detail::argument_base::values ( ) const
protectedpure virtual
Returns
Reference to the vector of parsed values of the argument.

Implemented in ap::argument< ArgT, T >.

Friends And Related Symbol Documentation

◆ ::ap::argument_parser

friend class ::ap::argument_parser
friend

Definition at line 57 of file argument_base.hpp.


The documentation for this class was generated from the following file: