group of parameters and/or other groups; can be configured to act as a group of alternatives (exclusive match) More...

#include <clipp.h>

Inheritance diagram for clipp::group:
Collaboration diagram for clipp::group:

Classes

class  depth_first_traverser
 recursively iterates over all nodes More...
 

Public Types

using child = child_t< parameter, group >
 
using value_type = child
 
using const_iterator = children_store::const_iterator
 
using iterator = children_store::iterator
 
using size_type = children_store::size_type
 
- Public Types inherited from clipp::detail::token< group >
using doc_string = clipp::doc_string
 

Public Member Functions

 group ()=default
 
template<class Param , class... Params>
 group (doc_string docstr, Param param, Params... params)
 
template<class... Params>
 group (parameter param, Params... params)
 
template<class P2 , class... Ps>
 group (group p1, P2 p2, Ps... ps)
 
 group (const group &)=default
 
 group (group &&)=default
 
groupoperator= (const group &)=default
 
groupoperator= (group &&)=default
 
groupjoinable (bool yes)
 determines if a command line argument can be matched by a combination of (partial) matches through any number of children More...
 
bool joinable () const noexcept
 returns if a command line argument can be matched by a combination of (partial) matches through any number of children More...
 
groupscoped (bool yes)
 turns explicit scoping on or off operators , & | and other combinating functions will not merge groups that are marked as scoped More...
 
bool scoped () const noexcept
 returns true if operators , & | and other combinating functions will merge groups and false otherwise More...
 
groupexclusive (bool yes)
 determines if children are mutually exclusive alternatives More...
 
bool exclusive () const noexcept
 returns if children are mutually exclusive alternatives More...
 
bool any_required () const
 returns true, if any child is required to match More...
 
bool all_required () const
 returns true, if all children are required to match More...
 
bool any_optional () const
 returns true if any child is optional (=non-required) More...
 
bool all_optional () const
 returns true if all children are optional (=non-required) More...
 
bool blocking () const noexcept
 returns if the entire group is blocking / positional More...
 
groupblocking (bool yes)
 determines if the entire group is blocking / positional More...
 
bool any_blocking () const
 returns true if any child is blocking More...
 
bool all_blocking () const
 returns true if all children is blocking More...
 
bool any_flagless () const
 returns if any child is a value parameter (recursive) More...
 
bool all_flagless () const
 returns if all children are value parameters (recursive) More...
 
grouppush_back (const parameter &v)
 adds child parameter at the end More...
 
grouppush_back (parameter &&v)
 adds child parameter at the end More...
 
grouppush_back (const group &g)
 adds child group at the end More...
 
grouppush_back (group &&g)
 adds child group at the end More...
 
template<class Param1 , class Param2 , class... Params>
grouppush_back (Param1 &&param1, Param2 &&param2, Params &&... params)
 adds children (groups and/or parameters) More...
 
grouppush_front (const parameter &v)
 adds child parameter at the beginning More...
 
grouppush_front (parameter &&v)
 adds child parameter at the beginning More...
 
grouppush_front (const group &g)
 adds child group at the beginning More...
 
grouppush_front (group &&g)
 adds child group at the beginning More...
 
groupmerge (group &&g)
 adds all children of other group at the end More...
 
template<class... Groups>
groupmerge (group &&g1, group &&g2, Groups &&... gs)
 adds all children of several other groups at the end More...
 
childoperator[] (size_type index) noexcept
 indexed, nutable access to child More...
 
const childoperator[] (size_type index) const noexcept
 indexed, non-nutable access to child More...
 
childfront () noexcept
 mutable access to first child More...
 
const childfront () const noexcept
 non-mutable access to first child More...
 
childback () noexcept
 mutable access to last child More...
 
const childback () const noexcept
 non-mutable access to last child More...
 
bool empty () const noexcept
 returns true, if group has no children, false otherwise More...
 
size_type size () const noexcept
 returns number of children More...
 
size_type depth () const
 returns number of nested levels; 1 for a flat group More...
 
iterator begin () noexcept
 returns mutating iterator to position of first element More...
 
const_iterator begin () const noexcept
 returns non-mutating iterator to position of first element More...
 
const_iterator cbegin () const noexcept
 returns non-mutating iterator to position of first element More...
 
iterator end () noexcept
 returns mutating iterator to position one past the last element More...
 
const_iterator end () const noexcept
 returns non-mutating iterator to position one past the last element More...
 
const_iterator cend () const noexcept
 returns non-mutating iterator to position one past the last element More...
 
depth_first_traverser begin_dfs () const noexcept
 returns augmented iterator for depth first searches More...
 
size_type param_count () const
 returns recursive parameter count More...
 
arg_list all_flags () const
 returns range of all flags (recursive) More...
 
bool flags_are_prefix_free () const
 returns true, if no flag occurs as true prefix of any other flag (identical flags will be ignored) More...
 
arg_string common_flag_prefix () const
 returns longest common prefix of all flags More...
 
- Public Member Functions inherited from clipp::detail::token< group >
const doc_stringdoc () const noexcept
 returns documentation string More...
 
groupdoc (const doc_string &txt)
 sets documentations string More...
 
groupdoc (doc_string &&txt)
 sets documentations string More...
 
bool repeatable () const noexcept
 returns if a group/parameter is repeatable More...
 
grouprepeatable (bool yes) noexcept
 sets repeatability of group/parameter More...
 
bool blocking () const noexcept
 returns if a group/parameter is blocking/positional More...
 
groupblocking (bool yes) noexcept
 determines, if a group/parameter is blocking/positional More...
 

Detailed Description

group of parameters and/or other groups; can be configured to act as a group of alternatives (exclusive match)

Definition at line 2445 of file clipp.h.

Member Typedef Documentation

◆ child

Definition at line 2645 of file clipp.h.

◆ const_iterator

using clipp::group::const_iterator = children_store::const_iterator

Definition at line 2652 of file clipp.h.

◆ iterator

using clipp::group::iterator = children_store::iterator

Definition at line 2653 of file clipp.h.

◆ size_type

using clipp::group::size_type = children_store::size_type

Definition at line 2654 of file clipp.h.

◆ value_type

Definition at line 2646 of file clipp.h.

Constructor & Destructor Documentation

◆ group() [1/6]

clipp::group::group ( )
default

◆ group() [2/6]

template<class Param , class... Params>
clipp::group::group ( doc_string  docstr,
Param  param,
Params...  params 
)
inlineexplicit

Definition at line 2946 of file clipp.h.

◆ group() [3/6]

template<class... Params>
clipp::group::group ( parameter  param,
Params...  params 
)
inlineexplicit

Definition at line 2955 of file clipp.h.

◆ group() [4/6]

template<class P2 , class... Ps>
clipp::group::group ( group  p1,
P2  p2,
Ps...  ps 
)
inlineexplicit

Definition at line 2963 of file clipp.h.

◆ group() [5/6]

clipp::group::group ( const group )
default

◆ group() [6/6]

clipp::group::group ( group &&  )
default

Member Function Documentation

◆ all_blocking()

bool clipp::group::all_blocking ( ) const
inline

returns true if all children is blocking

Definition at line 3074 of file clipp.h.

◆ all_flagless()

bool clipp::group::all_flagless ( ) const
inline

returns if all children are value parameters (recursive)

Definition at line 3091 of file clipp.h.

◆ all_flags()

arg_list clipp::group::all_flags ( ) const
inline

returns range of all flags (recursive)

Definition at line 3274 of file clipp.h.

◆ all_optional()

bool clipp::group::all_optional ( ) const
inline

returns true if all children are optional (=non-required)

Definition at line 3049 of file clipp.h.

◆ all_required()

bool clipp::group::all_required ( ) const
inline

returns true, if all children are required to match

Definition at line 3036 of file clipp.h.

◆ any_blocking()

bool clipp::group::any_blocking ( ) const
inline

returns true if any child is blocking

Definition at line 3067 of file clipp.h.

◆ any_flagless()

bool clipp::group::any_flagless ( ) const
inline

returns if any child is a value parameter (recursive)

Definition at line 3083 of file clipp.h.

◆ any_optional()

bool clipp::group::any_optional ( ) const
inline

returns true if any child is optional (=non-required)

Definition at line 3045 of file clipp.h.

◆ any_required()

bool clipp::group::any_required ( ) const
inline

returns true, if any child is required to match

Definition at line 3030 of file clipp.h.

◆ back() [1/2]

const child& clipp::group::back ( ) const
inlinenoexcept

non-mutable access to last child

Definition at line 3214 of file clipp.h.

◆ back() [2/2]

child& clipp::group::back ( )
inlinenoexcept

mutable access to last child

Definition at line 3212 of file clipp.h.

◆ begin() [1/2]

const_iterator clipp::group::begin ( ) const
inlinenoexcept

returns non-mutating iterator to position of first element

Definition at line 3239 of file clipp.h.

◆ begin() [2/2]

iterator clipp::group::begin ( )
inlinenoexcept

returns mutating iterator to position of first element

Definition at line 3237 of file clipp.h.

◆ begin_dfs()

depth_first_traverser clipp::group::begin_dfs ( ) const
inlinenoexcept

returns augmented iterator for depth first searches

taverser knows end of iteration and can skip over children

Definition at line 3256 of file clipp.h.

◆ blocking() [1/2]

bool clipp::group::blocking ( ) const
inlinenoexcept

returns if the entire group is blocking / positional

Definition at line 3056 of file clipp.h.

◆ blocking() [2/2]

group& clipp::group::blocking ( bool  yes)
inline

determines if the entire group is blocking / positional

Definition at line 3061 of file clipp.h.

◆ cbegin()

const_iterator clipp::group::cbegin ( ) const
inlinenoexcept

returns non-mutating iterator to position of first element

Definition at line 3241 of file clipp.h.

◆ cend()

const_iterator clipp::group::cend ( ) const
inlinenoexcept

returns non-mutating iterator to position one past the last element

Definition at line 3248 of file clipp.h.

◆ common_flag_prefix()

arg_string clipp::group::common_flag_prefix ( ) const
inline

returns longest common prefix of all flags

Definition at line 3305 of file clipp.h.

◆ depth()

size_type clipp::group::depth ( ) const
inline

returns number of nested levels; 1 for a flat group

Definition at line 3225 of file clipp.h.

◆ empty()

bool clipp::group::empty ( ) const
inlinenoexcept

returns true, if group has no children, false otherwise

Definition at line 3219 of file clipp.h.

◆ end() [1/2]

const_iterator clipp::group::end ( ) const
inlinenoexcept

returns non-mutating iterator to position one past the last element

Definition at line 3246 of file clipp.h.

◆ end() [2/2]

iterator clipp::group::end ( )
inlinenoexcept

returns mutating iterator to position one past the last element

Definition at line 3244 of file clipp.h.

◆ exclusive() [1/2]

bool clipp::group::exclusive ( ) const
inlinenoexcept

returns if children are mutually exclusive alternatives

Definition at line 3023 of file clipp.h.

◆ exclusive() [2/2]

group& clipp::group::exclusive ( bool  yes)
inline

determines if children are mutually exclusive alternatives

Definition at line 3018 of file clipp.h.

◆ flags_are_prefix_free()

bool clipp::group::flags_are_prefix_free ( ) const
inline

returns true, if no flag occurs as true prefix of any other flag (identical flags will be ignored)

Definition at line 3283 of file clipp.h.

◆ front() [1/2]

const child& clipp::group::front ( ) const
inlinenoexcept

non-mutable access to first child

Definition at line 3209 of file clipp.h.

◆ front() [2/2]

child& clipp::group::front ( )
inlinenoexcept

mutable access to first child

Definition at line 3207 of file clipp.h.

◆ joinable() [1/2]

bool clipp::group::joinable ( ) const
inlinenoexcept

returns if a command line argument can be matched by a combination of (partial) matches through any number of children

Definition at line 2992 of file clipp.h.

◆ joinable() [2/2]

group& clipp::group::joinable ( bool  yes)
inline

determines if a command line argument can be matched by a combination of (partial) matches through any number of children

Definition at line 2984 of file clipp.h.

◆ merge() [1/2]

group& clipp::group::merge ( group &&  g)
inline

adds all children of other group at the end

Definition at line 3176 of file clipp.h.

◆ merge() [2/2]

template<class... Groups>
group& clipp::group::merge ( group &&  g1,
group &&  g2,
Groups &&...  gs 
)
inline

adds all children of several other groups at the end

Definition at line 3187 of file clipp.h.

◆ operator=() [1/2]

group& clipp::group::operator= ( const group )
default

◆ operator=() [2/2]

group& clipp::group::operator= ( group &&  )
default

◆ operator[]() [1/2]

const child& clipp::group::operator[] ( size_type  index) const
inlinenoexcept

indexed, non-nutable access to child

Definition at line 3201 of file clipp.h.

◆ operator[]() [2/2]

child& clipp::group::operator[] ( size_type  index)
inlinenoexcept

indexed, nutable access to child

Definition at line 3197 of file clipp.h.

◆ param_count()

size_type clipp::group::param_count ( ) const
inline

returns recursive parameter count

Definition at line 3263 of file clipp.h.

◆ push_back() [1/5]

group& clipp::group::push_back ( const group g)
inline

adds child group at the end

Definition at line 3117 of file clipp.h.

◆ push_back() [2/5]

group& clipp::group::push_back ( const parameter v)
inline

adds child parameter at the end

Definition at line 3103 of file clipp.h.

◆ push_back() [3/5]

group& clipp::group::push_back ( group &&  g)
inline

adds child group at the end

Definition at line 3124 of file clipp.h.

◆ push_back() [4/5]

template<class Param1 , class Param2 , class... Params>
group& clipp::group::push_back ( Param1 &&  param1,
Param2 &&  param2,
Params &&...  params 
)
inline

adds children (groups and/or parameters)

Definition at line 3134 of file clipp.h.

◆ push_back() [5/5]

group& clipp::group::push_back ( parameter &&  v)
inline

adds child parameter at the end

Definition at line 3110 of file clipp.h.

◆ push_front() [1/4]

group& clipp::group::push_front ( const group g)
inline

adds child group at the beginning

Definition at line 3160 of file clipp.h.

◆ push_front() [2/4]

group& clipp::group::push_front ( const parameter v)
inline

adds child parameter at the beginning

Definition at line 3146 of file clipp.h.

◆ push_front() [3/4]

group& clipp::group::push_front ( group &&  g)
inline

adds child group at the beginning

Definition at line 3167 of file clipp.h.

◆ push_front() [4/4]

group& clipp::group::push_front ( parameter &&  v)
inline

adds child parameter at the beginning

Definition at line 3153 of file clipp.h.

◆ scoped() [1/2]

bool clipp::group::scoped ( ) const
inlinenoexcept

returns true if operators , & | and other combinating functions will merge groups and false otherwise

Definition at line 3010 of file clipp.h.

◆ scoped() [2/2]

group& clipp::group::scoped ( bool  yes)
inline

turns explicit scoping on or off operators , & | and other combinating functions will not merge groups that are marked as scoped

Definition at line 3002 of file clipp.h.

◆ size()

size_type clipp::group::size ( ) const
inlinenoexcept

returns number of children

Definition at line 3222 of file clipp.h.


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