doc: libimagutil: Add kv-split documentation
This commit is contained in:
parent
0bf22672f9
commit
3e18a6df6c
1 changed files with 16 additions and 4 deletions
|
@ -9,11 +9,23 @@ used by all other libraries and/or binaries.
|
||||||
|
|
||||||
It is explicitely not intended for module-use only, but for all other libraries.
|
It is explicitely not intended for module-use only, but for all other libraries.
|
||||||
|
|
||||||
## Datatypes {#sec:libutil:datatypes}
|
## Key-Value split {#sec:libutil:kvsplit}
|
||||||
|
|
||||||
_Nothing here yet_
|
This helper implements functionality to split key-value string into two parts.
|
||||||
|
It was introduced to simplify commandline specification for header fields (see
|
||||||
|
@lst:kvsplit:headerspec).
|
||||||
|
|
||||||
|
```{#lst:kvsplit:headerspec .bash .numberLines caption="Headerfield spec"}
|
||||||
|
imag store create --path /some.entry entry --header field=foo
|
||||||
|
# ^^^^^^^^^
|
||||||
|
```
|
||||||
|
|
||||||
|
It is implemented by introducing a `KeyValue` type which is generic over Key
|
||||||
|
and Value. This type gets implemented `KeyValue<String, String> for String` to
|
||||||
|
be able to split a `String` into two `String` objects, key and value
|
||||||
|
respectively. The implementation is realized via Regex.
|
||||||
|
|
||||||
|
The `KeyValue` type implementes `Into<(K, V)>` for convenience.
|
||||||
|
|
||||||
## Functions {#sec:libutil:functions}
|
|
||||||
|
|
||||||
_Nothing here yet_
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue