
\begin{DoxyItemize}
\item infos = Information about the yambi plugin is in keys below
\item infos/author = René Schwaiger \href{mailto:sanssecours@me.com}{\tt sanssecours@me.\+com}
\item infos/licence = B\+SD
\item infos/needs = directoryvalue yamlsmith
\item infos/provides = storage/yaml
\item infos/recommends =
\item infos/placements = getstorage
\item infos/status = maintained unittest preview experimental unfinished nodoc concept discouraged
\item infos/metadata =
\item infos/description = This storage plugin use a parser generated by Bison to read Y\+A\+ML files
\end{DoxyItemize}\hypertarget{autotoc_md753_src_plugins_yambi_README_md}{}\section{Y\+A\+M\+Bi}\label{autotoc_md753_src_plugins_yambi_README_md}
\hypertarget{autotoc_md753_autotoc_md754}{}\subsection{Introduction}\label{autotoc_md753_autotoc_md754}
This plugin uses \href{https://www.gnu.org/software/bison}{\tt Bison} to generate a parser for the \href{http://yaml.org}{\tt Y\+A\+ML} serialization format.\hypertarget{autotoc_md753_autotoc_md755}{}\subsection{Dependencies}\label{autotoc_md753_autotoc_md755}
The plugin requires \href{https://repology.org/metapackage/bison/versions}{\tt Bison} (version 3.\+0 or later).\hypertarget{autotoc_md753_autotoc_md756}{}\subsection{Examples}\label{autotoc_md753_autotoc_md756}
\hypertarget{autotoc_md753_autotoc_md757}{}\subsubsection{Mappings}\label{autotoc_md753_autotoc_md757}

\begin{DoxyCode}
# Mount plugin
sudo kdb mount config.yaml user/tests/yambi yambi

kdb set user/tests/yambi 'Mount Point'
kdb get user/tests/yambi
#> Mount Point

kdb set user/tests/yambi/bambi 'Mule Deer'
kdb get user/tests/yambi/bambi
#> Mule Deer

kdb set user/tests/yambi/thumper 'Rabbit'
kdb get user/tests/yambi/thumper
#> Rabbit

kdb set user/tests/yambi/bambi/baby 'Bobby Stewart'
kdb set user/tests/yambi/bambi/young 'Donnie Dunagan'
kdb set user/tests/yambi/bambi/adolescent 'Hardie Albright'
kdb set user/tests/yambi/bambi/adult 'John Sutherland'

kdb get user/tests/yambi/bambi/baby
#> Bobby Stewart

kdb ls user/tests/yambi
#> user/tests/yambi
#> user/tests/yambi/bambi
#> user/tests/yambi/bambi/adolescent
#> user/tests/yambi/bambi/adult
#> user/tests/yambi/bambi/baby
#> user/tests/yambi/bambi/young
#> user/tests/yambi/thumper

# Undo modifications
kdb rm -r user/tests/yambi
sudo kdb umount user/tests/yambi
\end{DoxyCode}
\hypertarget{autotoc_md753_autotoc_md758}{}\subsubsection{Arrays}\label{autotoc_md753_autotoc_md758}

\begin{DoxyCode}
# Mount plugin
sudo kdb mount config.yaml user/tests/yambi yambi

kdb set user/tests/yambi/friends
kdb set user/tests/yambi/friends/#0 Thumper
kdb set user/tests/yambi/friends/#1 Flower

# Retrieve last array index
kdb meta-get user/tests/yambi/friends array
#> #1

kdb get user/tests/yambi/friends/#0
#> Thumper
kdb get user/tests/yambi/friends/#1
#> Flower

# Undo modifications
kdb rm -r user/tests/yambi
sudo kdb umount user/tests/yambi
\end{DoxyCode}
\hypertarget{autotoc_md753_autotoc_md759}{}\subsubsection{Boolean Values}\label{autotoc_md753_autotoc_md759}
``` \hypertarget{autotoc_md753_autotoc_md760}{}\section{Mount plugin}\label{autotoc_md753_autotoc_md760}
sudo kdb mount config.\+yaml user/tests/yambi yambi\hypertarget{autotoc_md753_autotoc_md761}{}\section{Manually add a boolean value to the database}\label{autotoc_md753_autotoc_md761}
printf \textquotesingle{}boolean\+: false\textquotesingle{} $>$ {\ttfamily kdb file user/tests/yambi}\hypertarget{autotoc_md753_autotoc_md762}{}\section{Elektra stores boolean values as `0` and `1`}\label{autotoc_md753_autotoc_md762}
kdb get user/tests/yambi/boolean \#$>$ 0\hypertarget{autotoc_md753_autotoc_md763}{}\section{Undo modifications to the key database}\label{autotoc_md753_autotoc_md763}
kdb rm -\/r user/tests/yambi sudo kdb umount user/tests/yambi 
\begin{DoxyCode}
### Error Messages
\end{DoxyCode}
 \hypertarget{autotoc_md753_autotoc_md764}{}\section{Mount plugin}\label{autotoc_md753_autotoc_md764}
sudo kdb mount config.\+yaml user/tests/yambi yambi\hypertarget{autotoc_md753_autotoc_md765}{}\section{Manually add data containing syntax errors}\label{autotoc_md753_autotoc_md765}
printf -- \textquotesingle{}Thumper\+: -\/ Eating greens is a special treat.~\newline
\textquotesingle{} $>$ {\ttfamily kdb file user/tests/yambi} printf -- \textquotesingle{} -\/ It makes long ears and great big feet.~\newline
\textquotesingle{} $>$$>$ {\ttfamily kdb file user/tests/yambi} printf -- \textquotesingle{}-\/ But it sure is awful stuff to eat.~\newline
\textquotesingle{} $>$$>$ {\ttfamily kdb file user/tests/yambi} printf -- \textquotesingle{} -\/ I made that last part up myself~\newline
.\textquotesingle{} $>$$>$ {\ttfamily kdb file user/tests/yambi} printf -- \textquotesingle{}Stephen King\+:~\newline
\textquotesingle{} $>$$>$ {\ttfamily kdb file user/tests/yambi} printf -- \textquotesingle{} The first movie I ever saw was a horror movie.~\newline
\textquotesingle{} $>$$>$ {\ttfamily kdb file user/tests/yambi} printf -- \textquotesingle{} -\/ It was Bambi.~\newline
\textquotesingle{} $>$$>$ {\ttfamily kdb file user/tests/yambi}\hypertarget{autotoc_md753_autotoc_md766}{}\section{Try to retrieve data}\label{autotoc_md753_autotoc_md766}
kdb get user/tests/yambi/\+Thumper/\#2 \hypertarget{autotoc_md753_autotoc_md767}{}\section{R\+E\+T\+: 5}\label{autotoc_md753_autotoc_md767}
\hypertarget{autotoc_md753_autotoc_md768}{}\section{S\+T\+D\+E\+R\+R\+: .$\ast$config.\+yaml\+:3\+:1\+: syntax error, unexpected element, expecting end of map or key.$\ast$}\label{autotoc_md753_autotoc_md768}
\hypertarget{autotoc_md753_autotoc_md769}{}\section{Let us look at the error message more closely.}\label{autotoc_md753_autotoc_md769}
\hypertarget{autotoc_md753_autotoc_md770}{}\section{Since the location of `config.\+yaml` depends on the current user and O\+S,}\label{autotoc_md753_autotoc_md770}
\hypertarget{autotoc_md753_autotoc_md771}{}\section{we store the text before `config.\+yaml` as `user/tests/error/prefix`.}\label{autotoc_md753_autotoc_md771}
kdb set user/tests/error \char`\"{}\$(2$>$\&1 kdb ls user/tests/yambi)\char`\"{} kdb set user/tests/error/prefix \char`\"{}\$(kdb get user/tests/error $\vert$ grep \textquotesingle{}config.\+yaml\textquotesingle{} $\vert$ head -\/1 $\vert$ sed -\/\+E \textquotesingle{}s/(.$\ast$)config.\+yaml.$\ast$/\textbackslash{}1/\textquotesingle{})\char`\"{} kdb get user/tests/error/prefix \hypertarget{autotoc_md753_autotoc_md772}{}\section{We also store the length of the prefix, so we can remove it from every}\label{autotoc_md753_autotoc_md772}
\hypertarget{autotoc_md753_autotoc_md773}{}\section{line of the error message.}\label{autotoc_md753_autotoc_md773}
kdb set user/tests/error/prefix/length \char`\"{}\$(kdb get user/tests/error/prefix $\vert$ wc -\/c $\vert$ sed \textquotesingle{}s/\mbox{[} \mbox{]}$\ast$//g\textquotesingle{})\char`\"{}\hypertarget{autotoc_md753_autotoc_md774}{}\section{Since we only want to look at the “reason” of the error, we}\label{autotoc_md753_autotoc_md774}
\hypertarget{autotoc_md753_autotoc_md775}{}\section{remove the other part of the error message with `head` and `tail`.}\label{autotoc_md753_autotoc_md775}
kdb get user/tests/error $\vert$ tail -\/n6 $\vert$ cut -\/c\char`\"{}\$(kdb get user/tests/error/prefix/length $\vert$ tr -\/d \textquotesingle{}\textbackslash{}n\textquotesingle{})\char`\"{}-\/ \#$>$ config.\+yaml\+:3\+:1\+: syntax error, unexpected element, expecting end of map or key \#$>$ -\/ But it sure is awful stuff to eat. \#$>$ $^\wedge$ \#$>$ config.\+yaml\+:7\+:2\+: syntax error, unexpected start of sequence, expecting end of map or key \#$>$ -\/ It was Bambi. \#$>$ $^\wedge$\hypertarget{autotoc_md753_autotoc_md776}{}\section{Fix syntax errors}\label{autotoc_md753_autotoc_md776}
printf -- \textquotesingle{}Thumper\+: -\/ Eating greens is a special treat.~\newline
\textquotesingle{} $>$ {\ttfamily kdb file user/tests/yambi} printf -- \textquotesingle{} -\/ It makes long ears and great big feet.~\newline
\textquotesingle{} $>$$>$ {\ttfamily kdb file user/tests/yambi} printf -- \textquotesingle{} -\/ But it sure is awful stuff to eat.~\newline
\textquotesingle{} $>$$>$ {\ttfamily kdb file user/tests/yambi} printf -- \textquotesingle{} -\/ I made that last part up myself~\newline
.\textquotesingle{} $>$$>$ {\ttfamily kdb file user/tests/yambi} printf -- \textquotesingle{}Stephen King\+:~\newline
\textquotesingle{} $>$$>$ {\ttfamily kdb file user/tests/yambi} printf -- \textquotesingle{} -\/ The first movie I ever saw was a horror movie.~\newline
\textquotesingle{} $>$$>$ {\ttfamily kdb file user/tests/yambi} printf -- \textquotesingle{} -\/ It was Bambi.~\newline
\textquotesingle{} $>$$>$ {\ttfamily kdb file user/tests/yambi}\hypertarget{autotoc_md753_autotoc_md777}{}\section{Retrieve data}\label{autotoc_md753_autotoc_md777}
kdb get user/tests/yambi/\+Thumper/\#2 \#$>$ But it sure is awful stuff to eat.\hypertarget{autotoc_md753_autotoc_md778}{}\section{Undo modifications}\label{autotoc_md753_autotoc_md778}
kdb rm -\/r user/tests/error kdb rm -\/r user/tests/yambi sudo kdb umount user/tests/yambi ```\hypertarget{autotoc_md753_autotoc_md779}{}\subsection{Limitations}\label{autotoc_md753_autotoc_md779}
The plugin supports the same limited Y\+A\+ML syntax as \hyperlink{autotoc_md861_src_plugins_yanlr_README_md}{Yan LR}.


\begin{DoxyItemize}
\item The plugin always assumes {\bfseries U\+T\+F-\/8} encoded data. 
\end{DoxyItemize}