koutil
|
Base class for argument collections. More...
#include <arg.h>
Public Member Functions | |
constexpr | Arguments (const Args &... args) |
~Arguments () override=default | |
constexpr std::size_t | size () const override |
Gets the number of arguments. | |
constexpr std::size_t | count_short_args () const override |
Gets the number of short arguments. | |
constexpr std::size_t | count_long_args () const override |
Gets the number of long arguments. | |
constexpr const Arg * | find_short (char name) const override |
Finds an argument by its short name. | |
constexpr const Arg * | find_long (std::string_view name) const override |
Finds an argument by its long name. | |
constexpr std::span< const Arg > | args () const override |
Gets a span of all arguments. | |
Public Member Functions inherited from koutil::argparser::ArgumentsBase | |
virtual constexpr | ~ArgumentsBase ()=default |
Private Types | |
using | args_t = std::array<Arg, sizeof...(Args)> |
using | args_ref_t = std::pair<std::size_t, std::array<std::size_t, sizeof...(Args)>> |
Private Member Functions | |
constexpr void | create_refs () |
template<typename Proj > | |
constexpr bool | contains_duplicates (const args_ref_t &search, Proj member) |
Checks if there are duplicate arguments. | |
Private Attributes | |
args_t | m_args |
args_ref_t | m_short_args |
args_ref_t | m_long_args |
Base class for argument collections.
|
private |
|
private |
|
inlineconstexpr |
|
overridedefault |
|
inlinenodiscardconstexproverridevirtual |
Gets a span of all arguments.
Implements koutil::argparser::ArgumentsBase.
|
inlineconstexprprivate |
Checks if there are duplicate arguments.
Proj | The type of the member projection. |
search | The reference to search in. |
member | The member to project. |
|
inlinenodiscardconstexproverridevirtual |
Gets the number of long arguments.
Implements koutil::argparser::ArgumentsBase.
|
inlinenodiscardconstexproverridevirtual |
Gets the number of short arguments.
Implements koutil::argparser::ArgumentsBase.
|
inlineconstexprprivate |
|
inlinenodiscardconstexproverridevirtual |
Finds an argument by its long name.
name | The long name of the argument to find. |
Implements koutil::argparser::ArgumentsBase.
|
inlinenodiscardconstexproverridevirtual |
Finds an argument by its short name.
name | The short name of the argument to find. |
Implements koutil::argparser::ArgumentsBase.
|
inlinenodiscardconstexproverridevirtual |
Gets the number of arguments.
Implements koutil::argparser::ArgumentsBase.
|
private |
|
private |
|
private |