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

the driver extension installer: a product's <Product>Install.app - a dext is activated by the app carrying it in Contents/Library/SystemExtensions alone - and a command line alike More...

#include <dx_install.h>

Inheritance diagram for dx::install::parser:
Collaboration diagram for dx::install::parser:

Public Types

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

Public Member Functions

void operator <<(argsargs& argsargs) override
virtual void operator <<(const argsargs& argsargs)
 parser(const char* name, const ::GUID& guid= {}, const decltype(hwids)& hwids= {}, const std::string& bus= {})
template<typename desc_t, size_t models>
 parser(const char* name, const desc_t(&)[models])
 a product's devices as its desc models them: its dext is the product's urid
template<typename desc_t, size_t models>
 parser(const char* name, const desc_t(& model)[models])
 parser(const char* name, const std::string& dext= {})
virtual void quiet(const args &= {}) noexcept

Protected Member Functions

template<typename step_t>
void devices(argsargs& argsargs, const char* done, step_t&& step)
 a step on the devices of every hardware id, the inf optional - a hardware id failing is reported, the next one taken, and the verb fails at the end: the installer's exit code, a custom action's failure
std::string enumerator(const std::string& hwid) const
virtual bool head() const noexcept
virtual void help(argsargs& argsargs)
virtual void help_head() const noexcept
virtual void indent(argsargs& argsargs)
virtual void install(argsargs& argsargs)
virtual void install(argsargs& argsargs)
virtual void no_args(const argsargs& argsargs)
void reenumerate() const
 the devices of the replaced dext, which runs on until they go: each leaves its bus and enumerates again (dx::ioctl::device::reenumerate), the dext activated taking it
void resolve(const std::string& inf)
 the class and the hardware ids for a run: what the arguments left unknown comes off the inf
virtual void restart(argsargs& argsargs)
 the devices brought back where they stand, on the package that ranks best now
virtual void scan(argsargs& argsargs)
 the devices reenumerated where they stand, an installation that failed or found no package retried
auto select(const std::string& id)
void submit(argsargs& argsargs, const char* factory, const char* done)
 the request the factory makes for the dext an argument names, the product's otherwise
virtual void uninstall(argsargs& argsargs)
virtual void uninstall(argsargs& argsargs)
virtual void version(const argsargs& argsargs= {})

Static Protected Member Functions

static redirect::pipe& pipe(const std::string& id= {})
 where the run's lines go: the terminal and unified logging, where an app launched from the Finder has none - and there, once the head stands, the user's notifications; static, so what main() reports of a failure reaches them too
static dx::log::pipe sinks(bool notification)
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

std::string bus
 the devices' enumerator where the product names one, empty: each hardware id's own prefix
std::string dext
 the dext's bundle identifier
std::map<std::deque<std::string>, dispatch> dictionary
bool given{}
 a hwid sub parameter replaced the product's list
::GUID guid
 the devices' class, GUID_NULL unknown
std::deque<std::string> hwids
 the devices, as an inf's models name them (USB\VID_xxxx&PID_xxxx)
const char* name{}
struct dx::parser:: { ... }  parameter
decltype(dispatch::parameter) sub
 the sub parameters –install and –uninstall share

Detailed Description

the driver extension installer: a product's <Product>Install.app - a dext is activated by the app carrying it in Contents/Library/SystemExtensions alone - and a command line alike

the driver package installer: a product's <Product>Install.exe, the installer's custom action (dxd_installer.wxs) and a command line alike

--install [dext] asks the system to activate the dext, replacing one of another version; its first activation waits for the user's approval in the system settings. --uninstall [dext] deactivates it. The dext is the product's urid (the constructor), an argument overrides it; launched without arguments and without a terminal - from the Finder - the app installs. SystemExtensions.framework is Objective-C alone: its classes and the request's delegate are reached through the runtime, as dx::usb::capture does.

--install [class <guid>] [hwid <id> [hwid ..]] <inf>: purges every package with a model of the hardware ids (a competitor for the same devices - the alternative package of the product, an older release - would otherwise be ranked against the new one) and installs the package through setup::install(); --uninstall [class <guid>] [hwid <id> ..] [inf]: removes the devices' nodes and every package of theirs, then rescans the bus; --restart [..] [inf] installs on every device where it stands the package that ranks best (setup::reinstall(), a software device's node kept); --scan [..] [inf] reenumerates the devices, retrying an installation that failed. The devices' class and hardware ids are the product's (the constructor), a sub parameter overrides them - the first hwid replaces the list, further ones add - and what is still unknown comes off the inf given (its ClassGUID, its models); the enumerator is the product's where it names one - a software device's hardware id carries no prefix, SWD enumerates it - and each hardware id's own prefix otherwise.

Member Typedef Documentation

◆ args

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

Constructor & Destructor Documentation

◆ parser() [1/4]

template<typename desc_t, size_t models>
dx::install::parser::parser(const char* name, const desc_t(&)[models])
inline

a product's devices as its desc models them: its dext is the product's urid

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

◆ parser() [2/4]

dx::install::parser::parser(const char* name, const std::string& dext= {})
inline

◆ parser() [3/4]

dx::install::parser::parser(const char* name, const ::GUID& guid= {}, const decltype(hwids)& hwids= {}, const std::string& bus= {})
inline

◆ parser() [4/4]

template<typename desc_t, size_t models>
dx::install::parser::parser(const char* name, const desc_t(&) model[models])
inline

a product's devices as its desc models them: their hardware ids, the class the version header names (DX_CLASS_GUID) or media, SWD enumerating a software device

Here is the call graph for this function:

Member Function Documentation

◆ devices()

template<typename step_t>
void dx::install::parser::devices(args& args, const char* done, step_t&& step)
inlineprotected

a step on the devices of every hardware id, the inf optional - a hardware id failing is reported, the next one taken, and the verb fails at the end: the installer's exit code, a custom action's failure

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

◆ enumerator()

std::string dx::install::parser::enumerator(const std::string& hwid) const
inlineprotected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ head()

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

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

◆ install() [1/2]

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

◆ install() [2/2]

virtual void dx::install::parser::install(args& args)
inlineprotectedvirtual
Here is the call 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:

◆ operator <<() [1/2]

void dx::install::parser::operator <<(args& args)
inlineoverridevirtual

Reimplemented from dx::parser.

◆ operator <<() [2/2]

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

◆ pipe()

redirect::pipe& dx::install::parser::pipe(const std::string& id= {})
inlinestaticprotected

where the run's lines go: the terminal and unified logging, where an app launched from the Finder has none - and there, once the head stands, the user's notifications; static, so what main() reports of a failure reaches them too

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:

◆ reenumerate()

void dx::install::parser::reenumerate() const
inlineprotected

the devices of the replaced dext, which runs on until they go: each leaves its bus and enumerates again (dx::ioctl::device::reenumerate), the dext activated taking it

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

◆ resolve()

void dx::install::parser::resolve(const std::string& inf)
inlineprotected

the class and the hardware ids for a run: what the arguments left unknown comes off the inf

Here is the caller graph for this function:

◆ restart()

virtual void dx::install::parser::restart(args& args)
inlineprotectedvirtual

the devices brought back where they stand, on the package that ranks best now

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

◆ scan()

virtual void dx::install::parser::scan(args& args)
inlineprotectedvirtual

the devices reenumerated where they stand, an installation that failed or found no package retried

Here is the call graph for this function:
Here is the caller 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:

◆ sinks()

dx::log::pipe dx::install::parser::sinks(bool notification)
inlinestaticprotected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ submit()

void dx::install::parser::submit(args& args, const char* factory, const char* done)
inlineprotected

the request the factory makes for the dext an argument names, the product's otherwise

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

◆ uninstall() [1/2]

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

◆ uninstall() [2/2]

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

◆ 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

◆ bus

std::string dx::install::parser::bus
protected

the devices' enumerator where the product names one, empty: each hardware id's own prefix

◆ dext

std::string dx::install::parser::dext
protected

the dext's bundle identifier

◆ 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

◆ given

bool dx::install::parser::given{}
protected

a hwid sub parameter replaced the product's list

◆ guid

::GUID dx::install::parser::guid
protected

the devices' class, GUID_NULL unknown

◆ hwids

std::deque<std::string> dx::install::parser::hwids
protected

the devices, as an inf's models name them (USB\VID_xxxx&PID_xxxx)

◆ name

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

◆ parameter

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

◆ sub

decltype(dispatch::parameter) dx::install::parser::sub
protected
Initial value:
{
{{"class"}, {[this](args& args) {guid= dx::guid{args.front()}; args.pop_front();}, "the devices' class", "guid", {.required= 1}}},
{{"hwid"}, {[this](args& args){
if(!given)
hwids.clear();
given= true;
hwids.push_back(args.front());
args.pop_front();}, "a device's hardware id: the first replaces the product's, further ones add", "id", {.required= 1}}},
}
a GUID with the arithmetic Windows leaves out: constructed from its parts or its string,...
Definition dx_proxy.h:35
std::deque< std::string > hwids
the devices, as an inf's models name them (USB\VID_xxxx&PID_xxxx)
Definition windows/dx_install.h:90
bool given
a hwid sub parameter replaced the product's list
Definition windows/dx_install.h:91
::GUID guid
the devices' class, GUID_NULL unknown
Definition windows/dx_install.h:89

the sub parameters –install and –uninstall share


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