kaycxx-cli
C++ CLI library
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
kaycxx::cli::parameters_handle< T > Class Template Reference

Handle for a registered positional parameter list. More...

#include <kaycxx/cli/parameters_handle.hpp>

Public Member Functions

parameters< T > constdefinition () const noexcept
 Returns the underlying parameter list definition.
 
parameters_handle min (std::size_t count) noexcept
 Sets the minimum number of values accepted by the parameter list.
 
parameters_handle max (std::size_t count) noexcept
 Sets the maximum number of values accepted by the parameter list.
 
parameters_handle default_values (std::vector< T > values)
 Sets default values for the parameter list.
 
parameters_handle default_values (std::initializer_list< T > values)
 Sets default values for the parameter list.
 

Friends

class command
 

Detailed Description

template<parseable_value T>
class kaycxx::cli::parameters_handle< T >

Handle for a registered positional parameter list.

The handle does not own the parameter definition. It references data owned by the command that created it.

Template Parameters
TParameter value type.

Member Function Documentation

◆ default_values() [1/2]

template<parseable_value T>
parameters_handle kaycxx::cli::parameters_handle< T >::default_values ( std::initializer_list< T values)
inline

Sets default values for the parameter list.

The value count is checked against the configured minimum and maximum when positional parameters are validated.

Parameters
valuesDefault values used when the parameter list is not present in parsed arguments.
Returns
This handle for chaining.

◆ default_values() [2/2]

template<parseable_value T>
parameters_handle kaycxx::cli::parameters_handle< T >::default_values ( std::vector< T values)
inline

Sets default values for the parameter list.

The value count is checked against the configured minimum and maximum when positional parameters are validated.

Parameters
valuesDefault values used when the parameter list is not present in parsed arguments.
Returns
This handle for chaining.

◆ definition()

template<parseable_value T>
parameters< T > const & kaycxx::cli::parameters_handle< T >::definition ( ) const
inlinenoexcept

Returns the underlying parameter list definition.

Returns
Parameter list definition owned by the command.

◆ max()

template<parseable_value T>
parameters_handle kaycxx::cli::parameters_handle< T >::max ( std::size_t  count)
inlinenoexcept

Sets the maximum number of values accepted by the parameter list.

Parameters
countMaximum number of values.
Returns
This handle for chaining.

◆ min()

template<parseable_value T>
parameters_handle kaycxx::cli::parameters_handle< T >::min ( std::size_t  count)
inlinenoexcept

Sets the minimum number of values accepted by the parameter list.

Parameters
countMinimum number of values.
Returns
This handle for chaining.

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