dxd - dynax driver framework 2.6.0d200
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::parser Class Reference

cmd line parser More...

#include <dx_parser.h>

+ Inheritance diagram for dx::parser:
+ Collaboration diagram for dx::parser:

Classes

struct  dispatch
 

Public Types

typedef std::deque< std::string > args
 

Public Member Functions

 catch (...)
 
DX_PRAGMA_IGNORE_RETURN_VALUE_BEGIN catch (const dx::exception &__dx_exception)
 
 catch (const std::exception &__std_exception)
 
DX_PRAGMA_IGNORE_RETURN_VALUE_BEGIN virtual DX_PRAGMA_IGNORE_RETURN_VALUE_END void operator<< (args &args) try
 
virtual void operator<< (const args &args)
 
virtual DX_PRAGMA_IGNORE_RETURN_VALUE_END void parse (args &args)
 
 parser (const char *name, const decltype(dictionary)&dictionary={})
 
virtual void quiet (const args &={}) noexcept
 
virtual ~parser ()=default
 

Protected Member Functions

 catch (...)
 
 catch (...)
 
DX_PRAGMA_IGNORE_RETURN_VALUE_BEGIN catch (const dx::exception &__dx_exception)
 
DX_PRAGMA_IGNORE_RETURN_VALUE_BEGIN catch (const dx::exception &__dx_exception)
 
 catch (const std::exception &__std_exception)
 
 catch (const std::exception &__std_exception)
 
virtual bool head () const noexcept
 
virtual void help (args &args) try
 
virtual void help_head () const noexcept
 
virtual void help_scope () const noexcept
 
const auto select (const std::string &id) const try
 
virtual DX_PRAGMA_IGNORE_RETURN_VALUE_END void version (const args &={}) noexcept
 

Protected Attributes

std::map< std::deque< std::string >, dispatchdictionary
 
const char * name {}
 
struct { 
 
   bool   quiet = false 
 
parameter 
 

Detailed Description

cmd line parser

Member Typedef Documentation

◆ args

typedef std::deque<std::string> dx::parser::args

Constructor & Destructor Documentation

◆ parser()

dx::parser::parser ( const char * name,
const decltype(dictionary)& dictionary = {} )
inline

◆ ~parser()

virtual dx::parser::~parser ( )
virtualdefault

Member Function Documentation

◆ catch() [1/9]

dx::parser::catch ( ...)
inlineprotected

◆ catch() [2/9]

dx::parser::catch ( ...)
inlineprotected

◆ catch() [3/9]

dx::parser::catch ( ...)
inline

◆ catch() [4/9]

DX_PRAGMA_IGNORE_RETURN_VALUE_BEGIN dx::parser::catch ( const dx::exception & __dx_exception)
inlineprotected

◆ catch() [5/9]

DX_PRAGMA_IGNORE_RETURN_VALUE_BEGIN dx::parser::catch ( const dx::exception & __dx_exception)
inlineprotected

◆ catch() [6/9]

DX_PRAGMA_IGNORE_RETURN_VALUE_BEGIN dx::parser::catch ( const dx::exception & __dx_exception)
inline

◆ catch() [7/9]

dx::parser::catch ( const std::exception & __std_exception)
inlineprotected

◆ catch() [8/9]

dx::parser::catch ( const std::exception & __std_exception)
inlineprotected

◆ catch() [9/9]

dx::parser::catch ( const std::exception & __std_exception)
inline

◆ head()

◆ help()

virtual void dx::parser::help ( args & args)
inlineprotectedvirtual

◆ help_head()

◆ help_scope()

◆ operator<<() [1/2]

DX_PRAGMA_IGNORE_RETURN_VALUE_BEGIN virtual DX_PRAGMA_IGNORE_RETURN_VALUE_END void dx::parser::operator<< ( args & args)
inlinevirtual

Reimplemented in dx::select< parsers_t >.

◆ operator<<() [2/2]

virtual void dx::parser::operator<< ( const args & args)
inlinevirtual

◆ parse()

◆ quiet()

virtual void dx::parser::quiet ( const args & = {})
inlinevirtualnoexcept

◆ select()

const auto dx::parser::select ( const std::string & id) const
inlineprotected
+ Here is the caller graph for this function:

◆ version()

virtual DX_PRAGMA_IGNORE_RETURN_VALUE_END void dx::parser::version ( const args & = {})
inlineprotectedvirtualnoexcept

Member Data Documentation

◆ dictionary

std::map<std::deque<std::string>, dispatch> dx::parser::dictionary
protected
Initial value:
{
{{"--help", "-h", "-?"},{std::bind(&parser::help, this, std::placeholders::_1), "help or detailed help on specific arguments", [this](){for(const auto& verb: dictionary) std::cout<< "["<< verb.first.front()<< "] ";}, true}},
{{"--quiet", "-q"}, {std::bind(&parser::quiet, this, std::placeholders::_1), "quiet!"}},
{{"--version", "-v"}, {std::bind(&parser::version, this, std::placeholders::_1), std::string{"display "}+ name+ " version"}},
}
std::map< std::deque< std::string >, dispatch > dictionary
Definition dx_parser.h:119
const char * name
Definition dx_parser.h:58
bool quiet
Definition dx_parser.h:60
virtual void help(args &args) try
Definition dx_parser.h:154
virtual DX_PRAGMA_IGNORE_RETURN_VALUE_END void version(const args &={}) noexcept
Definition dx_parser.h:188

◆ name

const char* dx::parser::name {}
protected

◆ [struct]

struct { ... } dx::parser::parameter

◆ quiet

bool dx::parser::quiet = false

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

(c) copyright 2009 dynamic acoustics e.U. generated on Wed Feb 11 2026

a closed source license may be obtained by requesting a written permission from dynamic acoustics e.U.
however - governmental use generally and military use especially is strictly prohibited though.