Skip to content

elegaanz/toml-glib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TOML GLib Build Status

A small library to parse TOML.

Small example

Put this in a Vala file:

using Toml;

void main () {
    try {
        Element doc = new Parser.from_file ("test.toml").parse ();
        string name = doc["visitor"]["name"].as<string> ();
        print ("Hello, %s!\n", name);
    } catch (Error err) {
        print ("Error: %s\n", err.message);
    }
}

Then in test.toml, put:

[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
  • valac

Run meson to configure the build environment and then ninja to build

meson build --prefix=/usr
cd build
ninja

To install, use ninja install

sudo ninja install

About

TOML library for Vala and GLib

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages