.TH "md_src_plugins_directoryvalue_README" 3elektra "Fri Dec 22 2017" "Version 0.8.21" "Elektra" \" -*- nroff -*- .ad l .nh .SH NAME md_src_plugins_directoryvalue_READMEPlugin: directoryvalue \- .IP "\(bu" 2 infos = Information about the directoryvalue plugin is in keys below .IP "\(bu" 2 infos/author = René Schwaiger sanssecours@me.com .IP "\(bu" 2 infos/licence = BSD .IP "\(bu" 2 infos/needs = .IP "\(bu" 2 infos/provides = .IP "\(bu" 2 infos/recommends = .IP "\(bu" 2 infos/placements = postgetstorage presetstorage .IP "\(bu" 2 infos/status = maintained unittest nodep preview .IP "\(bu" 2 infos/metadata = .IP "\(bu" 2 infos/description = This plugin converts directory values to leaf values .PP .SH "Directory Value" .PP .SS "Introduction" .PP The Directory Value plugin converts .PP .IP "1." 4 directory (non-leaf) values to leaf values in the “set” direction, and .IP "2." 4 converts them back to directory values in the “get” direction\&. .PP .PP A directory value is a key that contains children\&. For example in the key set: .PP .PP .nf user/grandparent = Grandparent user/grandparent/leaf = Leaf user/grandparent/parent = Parent user/grandparent/parent/child = Child user/mother = Mother user/mother/daughter = Daughter user/mother/son = Son .fi .PP .PP the keys .PP .PP .nf user/grandparent user/grandparent/parent user/mother .fi .PP .PP represent directory values, while the keys .PP .PP .nf user/grandparent/leaf user/grandparent/parent/child user/mother/daughter user/mother/son .fi .PP .PP specify leaf values\&. You can easily check this by drawing the key set in the form of a rooted tree: .PP .PP .nf user / \ granparent mother / | / \ leaf parent daughter son | child .fi .PP .PP \&. The Directory Value plugin converts all directory values to leaf values in the “set” direction by adding new keys with the postfix \fC___dirdata\fP\&. Theses keys then store the old value of their parent keys .PP .PP .nf user/grandparent = user/grandparent/___dirdata = Grandparent user/grandparent/leaf = Leaf user/grandparent/parent = user/grandparent/parent/___dirdata = Parent user/grandparent/parent/child = Child user/mother = user/mother/___dirdata = Mother user/mother/daughter = Daugther user/mother/son = Son .fi .PP .PP \&. You might ask why we need the Directory Value plugin at all\&. The reason why we created this plugin is that some storage plugins like \fB`yajl`\fP or \fB`yamlcpp`\fP are only able to save values inside leaf keys\&. By loading the Directory Value plugin these storage plugins are also able to represent directory values properly\&. .PP .SS "Array Values" .PP The Directory value plugin also converts array values\&. Let us take a look at an example key set: .PP .PP .nf user/array = Array Value user/array/#0 = Firt Value user/array/#1 = Second Value user/array/#2 = Third Value .fi .PP .PP \&. The plugin \fBdoes not\fP convert this key set into: .PP .PP .nf user/array = user/array/___dirdata = Array Value user/array/#0 = First Value user/array/#1 = Second Value user/array/#2 = Third Value .fi .PP .PP , since then \fCuser/array\fP \fBwould not be an array\fP any more\&. Instead the plugin inserts a new element at index 0 with the \fBvalue prefix\fP \fC___dirdata:\fP: .PP .PP .nf user/array = user/array/#0 = ___dirdata: Array Value user/array/#1 = First Value user/array/#2 = Second Value user/array/#3 = Third Value .fi .PP .PP \&. This way a storage plugin such as YAJL or YAML CPP are still able to store \fCuser/array\fP as an array\&. .PP \fBRemark:\fP The plugin only converts array parents that store \fBstring values\fP\&. .PP .SS "Usage" .PP To mount the plugin use the command: .PP ``\fC