|
Elektra 0.8.26
|

This plugin is used to read configuration files that use hexadecimal values. All "hex-values" (see below) will be converted into decimal when Elektra reads values from the mounted file. When Elektra writes back to the file the converted values will be converted back and stored as before (0X will be replaced with 0x).
There are multiple ways you can signal to the hexnumber plugin, that a value should be converted:
When mounting a backend with the hexnumber plugin, a few settings can be configured.
To enable forced conversion mode set /force to any value. In forced conversion mode the plugin tries to convert ALL strings starting with 0x (or 0X) into decimal before passing the value on to the rest of Elektra. This can be useful for importing a configuration file that uses hexadecimal values into Elektra without writing a specification for the file.
NOTE: be careful when using this option, as any configuration value that contains invalid non-hexadecimal characters (i.e. does not match 0[xX][0-9A-Fa-f]+) will result in an error.
The types recognized as integers can be configured. For this purpose specify all additional types you want to be considered for possible hexadecimal conversion as an Elektra array. All keys with a type from /accept/types/#, or one of the default types, will be converted to hexadecimal if the value starts with 0x (or 0X).
A few examples on how to use the plugin: