Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elegaanz/toml-glib
TOML library for Vala and GLib
https://github.com/elegaanz/toml-glib
glib toml vala
Last synced: 11 days ago
JSON representation
TOML library for Vala and GLib
- Host: GitHub
- URL: https://github.com/elegaanz/toml-glib
- Owner: elegaanz
- License: gpl-3.0
- Created: 2017-04-30T18:16:23.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-08-08T13:36:48.000Z (over 4 years ago)
- Last Synced: 2024-10-24T09:43:45.071Z (about 2 months ago)
- Topics: glib, toml, vala
- Language: Vala
- Size: 38.1 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TOML GLib [![Build Status](https://travis-ci.org/Bat41/toml-glib.svg?branch=master)](https://travis-ci.org/Bat41/toml-glib)
A small library to parse TOML.
## Small example
Put this in a Vala file:
```vala
using Toml;void main () {
try {
Element doc = new Parser.from_file ("test.toml").parse ();
string name = doc["visitor"]["name"].as ();
print ("Hello, %s!\n", name);
} catch (Error err) {
print ("Error: %s\n", err.message);
}
}
```Then in `test.toml`, put:
```toml
[visitor]
name = "world"
```Compile with:
```
valac --pkg toml-glib *.vala
```You should get this:
```
Hello, world!
```## Building and Installation
You'll need the following dependencies:
* libgee-0.8-dev
* libglib2.0-dev
* meson
* valacRun `meson` to configure the build environment and then `ninja` to build
meson build --prefix=/usr
cd build
ninjaTo install, use `ninja install`
sudo ninja install