[[tags: egg]] [[toc:]] == TOML A Chicken wrapper for the TOML configuration language === Requirements [[/eggref/5/r7rs|r7rs]] [[/eggref/5/rfc3339|rfc3339]] [[/eggref/5/coops|coops]] === Usage (import toml) === Loading TOML configuration (table-from-file FILENAME) --> Loads {{FILENAME}} contents as a TOML configuration. (table-from-string STRING) --> Loads the contents of {{STRING}} as TOML configuration. === Tables (toml-self-key TOMLTABLE) --> string Returns the key, if any, to which {{TOMLTABLE}} is assigned. (toml-key-exists? TOMLTABLE KEY) --> bool Checks if {{KEY}} exists in {{TOMLTABLE}}. (toml-count-key-vals TOMLTABLE) --> int (toml-count-arrays TOMLTABLE) --> int (toml-count-tables TOMLTABLE) --> int Returns the number of key-value entries, arrays, or tables respectively in {{TOMLTABLE}}. (toml-key-at TOMLTABLE INDEX) --> string Returns the table key at position {{INDEX}} in {{TOMLTABLE}}. (toml-string TOMLTABLE KEY) --> string (toml-bool TOMLTABLE KEY) --> bool (toml-int TOMLTABLE KEY) --> int (toml-double TOMLTABLE KEY) --> double (toml-timestamp TOMLTABLE KEY) --> rfc3339 (toml-array TOMLTABLE KEY) --> (toml-table TOMLTABLE KEY) --> Returns the element of the given type in {{TOMLTABLE}} at {{KEY}}. === Arrays (toml-self-key TOMLARRAY) --> string Returns the key, if any, to which {{TOMLARRAY}} is assigned. (toml-count-entries TOMLARRAY) --> int Returns the number of entries in {{TOMLARRAY}}. (toml-string TOMLARRAY KEY) --> string (toml-bool TOMLARRAY KEY) --> bool (toml-int TOMLARRAY KEY) --> int (toml-double TOMLARRAY KEY) --> double (toml-timestamp TOMLARRAY KEY) --> rfc3339 (toml-array TOMLARRAY KEY) --> (toml-table TOMLARRAY KEY) --> Returns the element of the given type in {{TOMLARRAY}} at {{KEY}}. == About this egg === Authors Daniel Ziltener CK Tan === Repository The repository of the Chicken wrapper can be found at [[https://gitea.lyrion.ch/Chicken/toml|https://gitea.lyrion.ch/Chicken/toml]]. The repository of the C implementation being wrapped can be found at [[https://github.com/cktan/tomlc99|https://github.com/cktan/tomlc99]]. === Version History ; 0.8 : updated the tomlc99 dependency ; 0.7 : fixed an issue with timestamp parsing ; 0.6 : first version of the wrapper === License MIT License Copyright (c) Daniel Ziltener https://gitea.lyrion.ch/zilti/toml Copyright (c) CK Tan https://github.com/cktan/tomlc99 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.