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

macOS: the service's command line - launchd installs and starts it (the product's package), so it runs in the console alone More...

#include <dx_service.h>

Inheritance diagram for dx::service::parser:
Collaboration diagram for dx::service::parser:

Public Types

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

Public Member Functions

void close() noexcept
void initialize(const std::string& id= "", const ::DWORD(& access)[2]= {SC_MANAGER_ALL_ACCESS, SERVICE_ALL_ACCESS}, const std::string desc= "", const std::string& path= "")
void install(const std::string& name)
void open()
 operator std::unique_ptr<::QUERY_SERVICE_CONFIGA>()
 operator std::unique_ptr<::SERVICE_DESCRIPTION>()
 operator ::SERVICE_STATUS_PROCESS()
virtual void operator <<(argsargs& argsargs)
virtual void operator <<(const argsargs& argsargs)
 parser(const std::string& id, const char* name, const decltype(dictionary)& dictionary, const std::string& path= {})
 parser(const std::string& id, const char* name, const std::string& desc, const std::string& path)
 parser(const std::string& id, const char* name, const std::string& desc= {}, const decltype(dictionary)& dictionary= {})
 parser(const std::string& id, const char* name, const std::string& desc= {}, const decltype(dictionary)& dictionary= {}, const std::string& path= {})
virtual void quiet(const args &= {}) noexcept
void remove()
void stop()
dx::service::manager::enumerate promoted this(::DWORD value)
dx::service::manager::status promoted this(promoted::lock_t&& lock, const ::DWORD& value, const ::DWORD &)

Public Attributes

dx::service::manager::enumerate* this
dx::service::manager::status* this

Protected Member Functions

virtual void arg(argsargs& argsargs)
bool head() const noexcept override
virtual void help(argsargs& argsargs)
virtual void help_head() const noexcept
virtual void indent(argsargs& argsargs)
virtual void info(args &)
virtual void install(argsargs& argsargs)
virtual void kill(args &)
virtual void load(argsargs& argsargs)
virtual void no_args(const argsargs& argsargs)
virtual void remove(args &)
virtual void run(args &)
virtual void run(args &)
auto select(const std::string& id)
virtual void start(argsargs& argsargs)
virtual void stop(args &)
virtual void version(const argsargs& argsargs= {})

Static Protected Member Functions

template<typename value_t= int32_t>
static std::optional<value_t> value(argsargs& argsargs)
template<typename value_t= int32_t>
static value_t value(argsargs& argsargs, const char* name)
 the next argument as a number of value_t, which the parameter named requires
template<typename value_t>
static value_t value(argsargs& argsargs, value_t dflt)
 the next argument as a number of value_t, the default where it is none

Protected Attributes

::DWORD access{}
std::string desc
std::map<std::deque<std::string>, dispatch> dictionary
::SC_HANDLE handle{}
std::string id
const char* name{}
struct dx::parser:: { ... }  parameter
std::string path
preference preference{std::string{"SOFTWARE\\"}+ id, HKEY_LOCAL_MACHINE, static_cast<::REGSAM>(process::admin()? KEY_ALL_ACCESS: KEY_READ)}
::SC_HANDLE service{}

Detailed Description

macOS: the service's command line - launchd installs and starts it (the product's package), so it runs in the console alone

the service control command line: install, start, stop, remove and run in the console, on a dx::service::manager of its own. Its settings live under HKLM\SOFTWARE\<id>, writable where the process is elevated

Member Typedef Documentation

◆ args

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

Constructor & Destructor Documentation

◆ parser() [1/4]

dx::service::parser::parser(const std::string& id, const char* name, const std::string& desc= {}, const decltype(dictionary)& dictionary= {})
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parser() [2/4]

dx::service::parser::parser(const std::string& id, const char* name, const std::string& desc= {}, const decltype(dictionary)& dictionary= {}, const std::string& path= {})
inline
Here is the call graph for this function:

◆ parser() [3/4]

dx::service::parser::parser(const std::string& id, const char* name, const decltype(dictionary)& dictionary, const std::string& path= {})
inline

◆ parser() [4/4]

dx::service::parser::parser(const std::string& id, const char* name, const std::string& desc, const std::string& path)
inline
Here is the call graph for this function:

Member Function Documentation

◆ arg()

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

◆ close()

void dx::service::manager::close()
inlinenoexceptinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ head()

bool dx::service::parser::head() const
inlineoverrideprotectedvirtualnoexcept

Reimplemented from dx::parser.

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

◆ help()

virtual void dx::parser::help(args& args)
inlineprotectedvirtualinherited
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
inlineprotectedvirtualnoexceptinherited

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

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

◆ indent()

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

◆ info()

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

◆ initialize()

void dx::service::manager::initialize(const std::string& id= "", const ::DWORD(&) access[2]= {SC_MANAGER_ALL_ACCESS, SERVICE_ALL_ACCESS}, const std::string desc= "", const std::string& path= "")
inlineinherited

◆ install() [1/2]

void dx::service::manager::install(const std::string& name)
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ install() [2/2]

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

◆ kill()

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

◆ load()

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

◆ no_args()

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

◆ open()

void dx::service::manager::open()
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator std::unique_ptr<::QUERY_SERVICE_CONFIGA>()

dx::service::manager::operator std::unique_ptr<::QUERY_SERVICE_CONFIGA>()
inlineinherited
Here is the call graph for this function:

◆ operator std::unique_ptr<::SERVICE_DESCRIPTION>()

dx::service::manager::operator std::unique_ptr<::SERVICE_DESCRIPTION>()
inlineinherited
Here is the call graph for this function:

◆ operator ::SERVICE_STATUS_PROCESS()

dx::service::manager::operator ::SERVICE_STATUS_PROCESS()
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator <<() [1/2]

virtual void dx::parser::operator <<(args& args)
inlinevirtualinherited

Reimplemented in dx::install::parser, dx::select< parsers_t >, and dx::test::driver< super_device_t, device_t, driver_t >.

Here is the call graph for this function:

◆ operator <<() [2/2]

virtual void dx::parser::operator <<(const args& args)
inlinevirtualinherited
Here is the caller graph for this function:

◆ quiet()

virtual void dx::parser::quiet(const args&= {})
inlinevirtualnoexceptinherited
Here is the caller graph for this function:

◆ remove() [1/2]

void dx::service::manager::remove()
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ remove() [2/2]

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

◆ run() [1/2]

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

◆ run() [2/2]

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

◆ select()

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

◆ start()

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

◆ stop() [1/2]

void dx::service::manager::stop()
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stop() [2/2]

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

◆ this() [1/2]

dx::service::manager::enumerate promoted dx::service::manager::this(::DWORD value)
inlineinherited

◆ this() [2/2]

dx::service::manager::status promoted dx::service::manager::this(promoted::lock_t&& lock, const ::DWORD& value, const ::DWORD&)
inlineinherited

◆ value() [1/3]

template<typename value_t= int32_t>
std::optional<value_t> dx::parser::value(args& args)
inlinestaticprotectedinherited

the next argument where it is a number of value_t, consumed: $ and 0x hexadecimal, decimal otherwise - none where it is no number or outside value_t

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

◆ value() [2/3]

template<typename value_t= int32_t>
value_t dx::parser::value(args& args, const char* name)
inlinestaticprotectedinherited

the next argument as a number of value_t, which the parameter named requires

Here is the call graph for this function:

◆ value() [3/3]

template<typename value_t>
value_t dx::parser::value(args& args, value_t dflt)
inlinestaticprotectedinherited

the next argument as a number of value_t, the default where it is none

Here is the call graph for this function:

◆ version()

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

Member Data Documentation

◆ access

::DWORD dx::service::manager::access{}
protectedinherited

◆ desc

std::string dx::service::manager::desc
protectedinherited

◆ dictionary

std::map<std::deque<std::string>, dispatch> dx::parser::dictionary
protectedinherited
Initial value:
{
{{"--continue", "--no-error", "--ignore", "--ignore-error"},
{[this](args& args) {parameter.error.ignore= true; no_args(args);}, "ignore errors and continue"}},
{{"--indent", "--tab"}, {std::bind(&parser::indent, this, std::placeholders::_1), "set/get indention width and pattern", "[width [pattern]]", {}, {
{{"err", "stderr"}, {[this](args&) {this->parameter.log.err= true;}, "select std error"}},
{{"log", "stdlog"}, {[this](args&) {this->parameter.log.log= true;}, "select std log"}},
{{"out", "stdout"}, {[this](args&) {this->parameter.log.out= true;}, "select std out"}},
}}},
{{"--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 void indent(args &args)
Definition dx_parser.h:264
virtual void no_args(const args &args)
Definition dx_parser.h:232
const char * name
Definition dx_parser.h:68
std::deque< std::string > args
Definition dx_parser.h:64
struct dx::parser::@046247176025362246310022157273031025265032273157 parameter
virtual void version(const args &args={})
Definition dx_parser.h:287
virtual void quiet(const args &={}) noexcept
Definition dx_parser.h:323

◆ handle

::SC_HANDLE dx::service::manager::handle{}
protectedinherited

◆ id

std::string dx::service::parser::id
protected

◆ name

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

◆ parameter

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

◆ path

std::string dx::service::manager::path
protectedinherited

◆ preference

preference dx::service::parser::preference{std::string{"SOFTWARE\\"}+ id, HKEY_LOCAL_MACHINE, static_cast<::REGSAM>(process::admin()? KEY_ALL_ACCESS: KEY_READ)}
protected

◆ service

::SC_HANDLE dx::service::manager::service{}
protectedinherited

◆ this [1/2]

dx::service::manager::enumerate* dx::service::manager::this
inherited
Initial value:
{[this](::DWORD value){
switch(value){
case SERVICE_NOTIFY_DELETE_PENDING:
close();
break;
}}}}
static std::optional< value_t > value(args &args)
Definition dx_parser.h:241
void close() noexcept
Definition windows/service/dx_service.h:379

◆ this [2/2]

dx::service::manager::status* dx::service::manager::this
inherited

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