koutil
Loading...
Searching...
No Matches
koutil::argparser::Commands< Cmd > Class Template Reference

Specialization of Commands for a single subcommand. More...

#include <subcommand.h>

Inheritance diagram for koutil::argparser::Commands< Cmd >:
koutil::argparser::CommandsBase

Public Member Functions

constexpr Commands (const Cmd &cmd)
 
constexpr const SubcommandBasefind (std::string_view name) const override
 Finds a subcommand by name.
 
constexpr std::size_t size () const override
 Gets the number of subcommands.
 
- Public Member Functions inherited from koutil::argparser::CommandsBase
virtual constexpr ~CommandsBase ()=default
 

Private Attributes

Cmd m_cmd
 

Detailed Description

template<is_subcommand Cmd>
class koutil::argparser::Commands< Cmd >

Specialization of Commands for a single subcommand.

Template Parameters
CmdThe type of the subcommand.

Constructor & Destructor Documentation

◆ Commands()

template<is_subcommand Cmd>
koutil::argparser::Commands< Cmd >::Commands ( const Cmd & cmd)
inlineconstexpr

Member Function Documentation

◆ find()

template<is_subcommand Cmd>
const SubcommandBase * koutil::argparser::Commands< Cmd >::find ( std::string_view name) const
inlinenodiscardconstexproverridevirtual

Finds a subcommand by name.

Parameters
nameThe name of the subcommand to find.
Returns
A pointer to the found subcommand, or nullptr if not found.

Implements koutil::argparser::CommandsBase.

◆ size()

template<is_subcommand Cmd>
std::size_t koutil::argparser::Commands< Cmd >::size ( ) const
inlinenodiscardconstexproverridevirtual

Gets the number of subcommands.

Returns
The number of subcommands.

Implements koutil::argparser::CommandsBase.

Member Data Documentation

◆ m_cmd

template<is_subcommand Cmd>
Cmd koutil::argparser::Commands< Cmd >::m_cmd
private

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