senf::console::ParsedArgumentAttributorBase< Overload, Self, ReturnType > Class Template Reference

Derived class dependent ParsedCommandBase attributes. More...

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

Inheritance diagram for senf::console::ParsedArgumentAttributorBase< Overload, Self, ReturnType >:

Public Member Functions

Self doc (std::string const &doc)
 Set documentation for all overloads. More...
 
Self shortdoc (std::string const &doc)
 Set short documentation for all overloads. More...
 
Self overloadDoc (std::string const &doc)
 Set overload specific documentation. More...
 
Self 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...
 

Protected Member Functions

 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)
 

Additional Inherited Members

- Public Types inherited from senf::console::ParsedCommandAttributorBase
typedef OverloadedCommandNode node_type
 
typedef OverloadedCommandNoderesult_type
 

Detailed Description

template<class Overload, class Self, class ReturnType = typename Overload::traits::result_type>
class senf::console::ParsedArgumentAttributorBase< Overload, Self, ReturnType >

Derived class 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 do not depend on any specific argument but which need to return the correct attributor type.

See also
Automatic argument parsing

Definition at line 400 of file ParsedCommand.hh.

Constructor & Destructor Documentation

◆ ParsedArgumentAttributorBase() [1/2]

template<class Overload, class Self, class ReturnType = typename Overload::traits::result_type>
senf::console::ParsedArgumentAttributorBase< Overload, Self, ReturnType >::ParsedArgumentAttributorBase ( typename Overload::ptr  overload,
unsigned  index 
)
protected

◆ ParsedArgumentAttributorBase() [2/2]

template<class Overload, class Self, class ReturnType = typename Overload::traits::result_type>
senf::console::ParsedArgumentAttributorBase< Overload, Self, ReturnType >::ParsedArgumentAttributorBase ( ParsedCommandAttributorBase const &  other,
unsigned  index 
)
protected

Member Function Documentation

◆ doc()

template<class Overload, class Self, class ReturnType = typename Overload::traits::result_type>
Self senf::console::ParsedArgumentAttributorBase< Overload, Self, ReturnType >::doc ( std::string const &  doc)

Set documentation for all overloads.

◆ formatter()

template<class Overload, class Self, class ReturnType = typename Overload::traits::result_type>
Self senf::console::ParsedArgumentAttributorBase< Overload, Self, ReturnType >::formatter ( typename Overload::Formatter  formatter)

Set return value formatter.

This member is only available, if the ReturnType of the installed callback is not void.

If ReturnType is not void, the formatter must be a callable with a signature compatible with

void formatter(ReturnType const & value, std::ostream & os);

The formatter takes the return value of the call value and writes it properly formatted to os.

◆ overloadDoc()

template<class Overload, class Self, class ReturnType = typename Overload::traits::result_type>
Self senf::console::ParsedArgumentAttributorBase< Overload, Self, ReturnType >::overloadDoc ( std::string const &  doc)

Set overload specific documentation.

◆ shortdoc()

template<class Overload, class Self, class ReturnType = typename Overload::traits::result_type>
Self senf::console::ParsedArgumentAttributorBase< Overload, Self, ReturnType >::shortdoc ( std::string const &  doc)

Set short documentation for all overloads.


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