Ookii.CommandLine for C++  1.0.0
Public Types | Public Member Functions | Protected Member Functions | List of all members
ookii::basic_parser_builder< CharType, Traits, Alloc >::multi_value_argument_builder< T > Class Template Reference

Base class for argument_builder for multi-value arguments. More...

#include <ookii/command_line_builder.h>

Inheritance diagram for ookii::basic_parser_builder< CharType, Traits, Alloc >::multi_value_argument_builder< T >:
Inheritance graph
[legend]
Collaboration diagram for ookii::basic_parser_builder< CharType, Traits, Alloc >::multi_value_argument_builder< T >:
Collaboration graph
[legend]

Public Types

using builder_type = argument_builder< multi_value_command_line_argument< T, CharType, Traits, Alloc >, multi_value_argument_builder >
 The type of the argument_builder that derives from multi_value_argument_builder.
 

Public Member Functions

builder_typeseparator (CharType separator)
 Specifies a separator that separates multiple values in a single argument value. More...
 
- Public Member Functions inherited from ookii::basic_parser_builder< CharType, Traits, Alloc >::argument_builder_base
 argument_builder_base (argument_builder_base &)=delete
 
virtual ~argument_builder_base ()=default
 Default destructor.
 
template<typename T >
argument_builder< typed_argument_type< T >, argument_builder_base > & add_argument (T &value, string_type name)
 Adds a new argument, and returns an argument_builder that can be used to further customize it. More...
 
template<typename T >
multi_value_argument_builder< T >::builder_type & add_multi_value_argument (T &value, string_type name)
 Adds a new multi-value argument, and returns an argument_builder that can be used to further customize it. More...
 
parser_type build ()
 Creates a basic_command_line_parser using the current options and arguments. More...
 
const string_typename () const
 Returns the name of the argument.
 
argument_builder_baseoperator= (argument_builder_base &)=delete
 
virtual owned_or_borrowed_ptr< argument_base_typeto_argument ()=0
 Converts the argument_builder_base into a command_line_argument_base that can be used by the basic_command_line_parser.
 

Protected Member Functions

 multi_value_argument_builder (basic_parser_builder &basic_parser_builder, string_type name)
 Initializes a new instance of the multi_value_argument_builder class. More...
 
- Protected Member Functions inherited from ookii::basic_parser_builder< CharType, Traits, Alloc >::argument_builder_base
 argument_builder_base (basic_parser_builder &basic_parser_builder, string_type name)
 Initializes a new instance of the argument_builder_base class. More...
 
size_t get_next_position ()
 Gets the next position for a positional argument.
 
storage_type & storage ()
 Provides access to the argument's options storage.
 

Detailed Description

template<typename CharType = details::default_char_type, typename Traits = std::char_traits<CharType>, typename Alloc = std::allocator<CharType>>
template<typename T>
class ookii::basic_parser_builder< CharType, Traits, Alloc >::multi_value_argument_builder< T >

Base class for argument_builder for multi-value arguments.

Template Parameters
TThe type of the argument's container.

Constructor & Destructor Documentation

◆ multi_value_argument_builder()

template<typename CharType = details::default_char_type, typename Traits = std::char_traits<CharType>, typename Alloc = std::allocator<CharType>>
template<typename T >
ookii::basic_parser_builder< CharType, Traits, Alloc >::multi_value_argument_builder< T >::multi_value_argument_builder ( basic_parser_builder basic_parser_builder,
string_type  name 
)
inlineprotected

Initializes a new instance of the multi_value_argument_builder class.

Parameters
basic_parser_builderA reference to the basic_parser_builder used to build this argument.
nameThe name of the argument.

Member Function Documentation

◆ separator()

template<typename CharType = details::default_char_type, typename Traits = std::char_traits<CharType>, typename Alloc = std::allocator<CharType>>
template<typename T >
builder_type& ookii::basic_parser_builder< CharType, Traits, Alloc >::multi_value_argument_builder< T >::separator ( CharType  separator)
inline

Specifies a separator that separates multiple values in a single argument value.

Parameters
separatorThe separator to use, or '\0' to not use a separator.

Normally, multi-value arguments must be supplied multiple times in order to supply multiple values (e.g. -Value 1 -Value 2). Using a separator allows multiple values to be supplied at once (e.g. -Value 1;2).

Warning
The separator character cannot be used in argument values; there is no way to escape it. Be particularly careful with types whose parsing might be locale-dependent.

By default, no separator is used.


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