TOML
A Chicken wrapper for the TOML configuration language
Requirements
Usage
(import toml)
Loading TOML configuration
[syntax] (table-from-file FILENAME) --> <TomlTable>Loads FILENAME contents as a TOML configuration.
[syntax] (table-from-string STRING) --> <TomlTable>Loads the contents of STRING as TOML configuration.
Tables
[syntax] (toml-self-key TOMLTABLE) --> stringReturns the key, if any, to which TOMLTABLE is assigned.
[syntax] (toml-key-exists? TOMLTABLE KEY) --> boolChecks if KEY exists in TOMLTABLE.
[syntax] (toml-count-key-vals TOMLTABLE) --> int[syntax] (toml-count-arrays TOMLTABLE) --> int
[syntax] (toml-count-tables TOMLTABLE) --> int
Returns the number of key-value entries, arrays, or tables respectively in TOMLTABLE.
[syntax] (toml-key-at TOMLTABLE INDEX) --> stringReturns the table key at position INDEX in TOMLTABLE.
[syntax] (toml-string TOMLTABLE KEY) --> string[syntax] (toml-bool TOMLTABLE KEY) --> bool
[syntax] (toml-int TOMLTABLE KEY) --> int
[syntax] (toml-double TOMLTABLE KEY) --> double
[syntax] (toml-timestamp TOMLTABLE KEY) --> rfc3339
[syntax] (toml-array TOMLTABLE KEY) --> <TomlArray>
[syntax] (toml-table TOMLTABLE KEY) --> <TomlTable>
Returns the element of the given type in TOMLTABLE at KEY.
Arrays
[syntax] (toml-self-key TOMLARRAY) --> stringReturns the key, if any, to which TOMLARRAY is assigned.
[syntax] (toml-count-entries TOMLARRAY) --> intReturns the number of entries in TOMLARRAY.
[syntax] (toml-string TOMLARRAY KEY) --> string[syntax] (toml-bool TOMLARRAY KEY) --> bool
[syntax] (toml-int TOMLARRAY KEY) --> int
[syntax] (toml-double TOMLARRAY KEY) --> double
[syntax] (toml-timestamp TOMLARRAY KEY) --> rfc3339
[syntax] (toml-array TOMLARRAY KEY) --> <TomlArray>
[syntax] (toml-table TOMLARRAY KEY) --> <TomlTable>
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.
The repository of the C implementation being wrapped can be found at 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/Chicken/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.