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

An action used to parse a list of values. More...

Public Member Functions

 store_list (Action action)
 Constructs a store_list from an action.
 
Container operator() (const std::string &key, const std::string &value) const
 The operator that does the heavy lifting. More...
 

Detailed Description

template<typename Container, typename Action = store<typename Container::value_type>>
struct gears::optparse::store_list< Container, Action >

An action used to parse a list of values. The parsing is done through continuous concatenation of the values parsed with the action. By default, the action used to parse and retrieve the values is optparse::store.

Template Parameters
ContainerThe internal container to hold the list on.
ActionThe action used to parse the values. Defaults to store.

Definition at line 146 of file actions.hpp.

Member Function Documentation

template<typename Container , typename Action = store<typename Container::value_type>>
Container gears::optparse::store_list< Container, Action >::operator() ( const std::string &  key,
const std::string &  value 
) const
inline

The operator that does the heavy lifting. The values are retrieved as if splitting by the newline character, `'
'`. They are inserted into the container as if using c.insert(c.back(), action(key, split_value))

Parameters
keyThe key of the command line option.
valueThe value of the command line option, delimited by newlines.
Returns
The container with the parsed values.

Definition at line 167 of file actions.hpp.