senf::console::ParsedArgumentAttributor< Overload, index, flag > Class Template Reference

Argument dependent ParsedCommandBase attributes. More...

#include <senf/Utils/Console/ParsedCommand.hh>

Inheritance diagram for senf::console::ParsedArgumentAttributor< Overload, index, flag >:

Public Types

typedef senf::function_traits_arg_type< typename Overload::traits, int(index) >::type arg_type
 
typedef senf::remove_cvref< arg_type >::type value_type
 
typedef ParsedArgumentAttributor< Overload, index+1 > next_type
 
- Public Types inherited from senf::console::ParsedCommandAttributorBase
typedef OverloadedCommandNode node_type
 
typedef OverloadedCommandNoderesult_type
 

Public Member Functions

next_type arg () const
 Set argument attributes. More...
 
- Public Member Functions inherited from senf::console::ParsedArgumentAttributorBase< Overload, ParsedArgumentAttributor< Overload, index, flag > >
ParsedArgumentAttributor< Overload, index, flag > doc (std::string const &doc)
 Set documentation for all overloads. More...
 
ParsedArgumentAttributor< Overload, index, flag > shortdoc (std::string const &doc)
 Set short documentation for all overloads. More...
 
ParsedArgumentAttributor< Overload, index, flag > overloadDoc (std::string const &doc)
 Set overload specific documentation. More...
 
ParsedArgumentAttributor< Overload, index, flag > formatter (typename Overload::Formatter formatter)
 Set return value formatter. More...
 
- Public Member Functions inherited from senf::console::ParsedCommandAttributor< Overload >
Overload & overload () const
 Get the command overload. More...
 

Additional Inherited Members

- Protected Member Functions inherited from senf::console::ParsedArgumentAttributorBase< Overload, ParsedArgumentAttributor< Overload, index, flag > >
 ParsedArgumentAttributorBase (typename Overload::ptr overload, unsigned index)
 
 ParsedArgumentAttributorBase (ParsedCommandAttributorBase const &other, unsigned index)
 
- Protected Member Functions inherited from senf::console::ParsedCommandAttributor< Overload >
 ParsedCommandAttributor (typename Overload::ptr overload, unsigned index)
 
 ParsedCommandAttributor (ParsedCommandAttributorBase const &other, unsigned index)
 
- Protected Member Functions inherited from senf::console::ParsedCommandAttributorBase
 ParsedCommandAttributorBase (ParsedCommandOverloadBase::ptr overload, unsigned index)
 
 ParsedCommandAttributorBase (ParsedCommandAttributorBase const &other, unsigned index)
 
void argName (std::string const &name)
 
void argDoc (std::string const &doc)
 
void typeName (std::string const &doc)
 
void defaultDoc (std::string const &doc)
 
ParsedCommandOverloadBaseoverload () const
 
void overloadDoc (std::string const &doc)
 
void nodeDoc (std::string const &doc)
 
void shortDoc (std::string const &doc)
 

Detailed Description

template<class Overload, unsigned index, bool flag>
class senf::console::ParsedArgumentAttributor< Overload, index, flag >

Argument dependent ParsedCommandBase attributes.

Attributes for parsed commands are not set directly on the node. They are set via a special attributor temporary returned when adding a parsed command to the tree.

This class adds all those members, which depend on a specific argument. Each call to arg will advance to the next argument.

See also
Automatic argument parsing

Definition at line 458 of file ParsedCommand.hh.

Member Typedef Documentation

◆ arg_type

template<class Overload , unsigned index, bool flag>
typedef senf::function_traits_arg_type< typename Overload::traits, int(index) >::type senf::console::ParsedArgumentAttributor< Overload, index, flag >::arg_type

Definition at line 472 of file ParsedCommand.hh.

◆ next_type

template<class Overload , unsigned index, bool flag>
typedef ParsedArgumentAttributor<Overload, index+1> senf::console::ParsedArgumentAttributor< Overload, index, flag >::next_type

Definition at line 474 of file ParsedCommand.hh.

◆ value_type

template<class Overload , unsigned index, bool flag>
typedef senf::remove_cvref< arg_type >::type senf::console::ParsedArgumentAttributor< Overload, index, flag >::value_type

Definition at line 473 of file ParsedCommand.hh.

Member Function Documentation

◆ arg()

template<class Overload , unsigned index, bool flag>
next_type senf::console::ParsedArgumentAttributor< Overload, index, flag >::arg ( ) const

Set argument attributes.

This member changes the attributes for the current argument. The attributes are passed to arg() as keyword arguments using the Boost.Parameter library.

...
.arg( kw::name = "name",
...

The valid keywords are defined in the senf::console::kw namespace.

Each call to arg() will increment the argument index and advance to the next argument. This member is only present, if there is an argument at the current index.


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