All Classes Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
gears::optparse::append< Container > Struct Template Reference

An action used to store a list. More...

Public Member Functions

template<typename Action >
 append (Action action)
 
Container operator() (const std::string &key, const std::string &value)
 The operator doing the heavy lifting. More...
 

Detailed Description

template<typename Container>
struct gears::optparse::append< Container >

An action used to store a list. Every time the argument is called, it is parsed to the specific type using the action provided. This should not be used directly, instead it is used in conjunction with optparse::compose factory function.

Template Parameters
ContainerThe internal container to hold the list on.

Definition at line 190 of file actions.hpp.

Member Function Documentation

template<typename Container >
Container gears::optparse::append< Container >::operator() ( const std::string &  key,
const std::string &  value 
)
inline

The operator doing the heavy lifting. The arguments are delegated to the action provided. The result of the parsing is added to a list keeping track of the elements. The result is inserted to the container by calling c.insert(c.end(), action(key, value)). The container is returned and move semantics take over from then.

Parameters
keyThe key of the command line argument.
valueThe value of the command line option.
Returns
The container in its current state.

Definition at line 212 of file actions.hpp.