clipp::parser Class Reference

default command line arguments parser More...

#include <clipp.h>

Classes

class  arg_mapping
 arg -> parameter mapping More...
 
class  missing_event
 references a non-matched, required parameter More...
 

Public Types

using dfs_traverser = group::depth_first_traverser
 
using scoped_dfs_traverser = detail::scoped_dfs_traverser
 
using missing_events = std::vector< missing_event >
 
using arg_mappings = std::vector< arg_mapping >
 

Public Member Functions

 parser (const group &root, arg_index offset=0)
 initializes parser with a command line interface More...
 
bool operator() (const arg_string &arg)
 processes one command line argument More...
 
const arg_mappingsargs () const
 returns range of argument -> parameter mappings More...
 
missing_events missed () const
 returns list of missing events More...
 
arg_index parse_count () const noexcept
 returns number of processed command line arguments More...
 
bool valid () const noexcept
 returns false if previously processed command line arguments lead to an invalid / inconsistent parsing result More...
 
 operator bool () const noexcept
 returns false if previously processed command line arguments lead to an invalid / inconsistent parsing result More...
 

Detailed Description

default command line arguments parser

Definition at line 4176 of file clipp.h.

Member Typedef Documentation

◆ arg_mappings

Definition at line 4260 of file clipp.h.

◆ dfs_traverser

◆ missing_events

Definition at line 4259 of file clipp.h.

◆ scoped_dfs_traverser

Constructor & Destructor Documentation

◆ parser()

clipp::parser::parser ( const group root,
arg_index  offset = 0 
)
inlineexplicit

initializes parser with a command line interface

Parameters
offset= argument index offset used for reports

Definition at line 4284 of file clipp.h.

Member Function Documentation

◆ args()

const arg_mappings& clipp::parser::args ( ) const
inline

returns range of argument -> parameter mappings

Definition at line 4322 of file clipp.h.

◆ missed()

missing_events clipp::parser::missed ( ) const
inline

returns list of missing events

Definition at line 4327 of file clipp.h.

◆ operator bool()

clipp::parser::operator bool ( ) const
inlineexplicitnoexcept

returns false if previously processed command line arguments lead to an invalid / inconsistent parsing result

Definition at line 4347 of file clipp.h.

◆ operator()()

bool clipp::parser::operator() ( const arg_string arg)
inline

processes one command line argument

Definition at line 4298 of file clipp.h.

◆ parse_count()

arg_index clipp::parser::parse_count ( ) const
inlinenoexcept

returns number of processed command line arguments

Definition at line 4337 of file clipp.h.

◆ valid()

bool clipp::parser::valid ( ) const
inlinenoexcept

returns false if previously processed command line arguments lead to an invalid / inconsistent parsing result

Definition at line 4342 of file clipp.h.


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