dxd - dynax driver framework 2.6.0d204
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 (...)
 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)
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)
 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
virtual DX_PRAGMA_IGNORE_RETURN_VALUE_END void no_args (const args &args) try
DX_PRAGMA_IGNORE_RETURN_VALUE_END auto select (const std::string &id) try
virtual DX_PRAGMA_IGNORE_RETURN_VALUE_END void version (const args &args={}) try

Protected Attributes

std::map< std::deque< std::string >, dispatchdictionary
const char * name {}
struct { 
   struct { 
      bool   ignore 
   }   error
   bool   quiet 
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
Here is the caller graph for this function:

◆ ~parser()

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

Member Function Documentation

◆ catch() [1/15]

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

◆ catch() [2/15]

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

◆ catch() [3/15]

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

◆ catch() [4/15]

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

◆ catch() [5/15]

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

◆ catch() [6/15]

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

◆ catch() [7/15]

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

◆ catch() [8/15]

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

◆ catch() [9/15]

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

◆ catch() [10/15]

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

◆ catch() [11/15]

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

◆ catch() [12/15]

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

◆ catch() [13/15]

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

◆ catch() [14/15]

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

◆ catch() [15/15]

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

◆ head()

virtual bool dx::parser::head ( ) const
inlineprotectedvirtualnoexcept

Reimplemented in dx::service::parser, dx::test::driver< super_device_t, audio_pin_t, io_t, device_t, driver_t, engine_t >, and dx::test::driver< super_device_t, audio_pin_t, io_t, device_t, driver_t, engine_t >.

Here is the caller graph for this function:

◆ help()

virtual void dx::parser::help ( args & args)
inlineprotectedvirtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ help_head()

virtual void dx::parser::help_head ( ) const
inlineprotectedvirtualnoexcept

Reimplemented in dx::test::driver< super_device_t, audio_pin_t, io_t, device_t, driver_t, engine_t >, and dx::test::driver< super_device_t, audio_pin_t, io_t, device_t, driver_t, engine_t >.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ help_scope()

virtual void dx::parser::help_scope ( ) const
inlineprotectedvirtualnoexcept

Reimplemented in dx::select< parsers_t >, dx::test::driver< super_device_t, audio_pin_t, io_t, device_t, driver_t, engine_t >, and dx::test::driver< super_device_t, audio_pin_t, io_t, device_t, driver_t, engine_t >.

Here is the caller graph for this function:

◆ no_args()

virtual DX_PRAGMA_IGNORE_RETURN_VALUE_END void dx::parser::no_args ( const args & args)
inlineprotectedvirtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 >.

Here is the call graph for this function:

◆ operator<<() [2/2]

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

◆ parse()

virtual DX_PRAGMA_IGNORE_RETURN_VALUE_END void dx::parser::parse ( args & args)
inlinevirtual

Reimplemented in dx::test::driver< super_device_t, audio_pin_t, io_t, device_t, driver_t, engine_t >, and dx::test::driver< super_device_t, audio_pin_t, io_t, device_t, driver_t, engine_t >.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ quiet()

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

◆ select()

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

◆ version()

virtual DX_PRAGMA_IGNORE_RETURN_VALUE_END void dx::parser::version ( const args & args = {})
inlineprotectedvirtual
Here is the call graph for this function:
Here is the caller graph for this function:

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}},
{{"--continue", "--no-error", "--ignore", "--ignore-error"},
{[this](args& args) {parameter.error.ignore= true; no_args(args);}, "ignore errors and continue"}},
{{"--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"}},
}
virtual DX_PRAGMA_IGNORE_RETURN_VALUE_END void version(const args &args={}) try
Definition dx_parser.h:204
std::map< std::deque< std::string >, dispatch > dictionary
Definition dx_parser.h:126
const char * name
Definition dx_parser.h:59
bool quiet
Definition dx_parser.h:61
virtual void help(args &args) try
Definition dx_parser.h:163
virtual DX_PRAGMA_IGNORE_RETURN_VALUE_END void no_args(const args &args) try
Definition dx_parser.h:197
std::deque< std::string > args
Definition dx_parser.h:55
struct dx::parser::@046247176025362246310022157273031025265032273157 parameter

◆ [struct]

struct { ... } dx::parser::error

◆ ignore

bool dx::parser::ignore

◆ name

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

◆ [struct]

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

◆ quiet

bool dx::parser::quiet

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

(c) copyright 2009 dynamic acoustics e.U. generated on

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.