cpptoml is a header-only library for parsing TOML
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 172 commits behind skystrife:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
include
.clang-format
.gitignore
.travis.yml
CMakeLists.txt
LICENSE
README.md
cpptoml.doxygen.in
parse.cpp
parse_stdin.cpp

README.md

cpptoml

A header-only library for parsing TOML configuration files.

Targets: TOML v0.4.0

It is reasonably conforming, with the exception of unicode escape characters in strings. This includes support for the new DateTime format, inline tables, multi-line basic and raw strings, and digit separators.

Alternatives:

  • ctoml and tinytoml are both C++11 implementations of a TOML parser, but only support v0.2.0.
  • libtoml is a C implementation of a TOML parser, which can be linked to from your C++ programs easily. It supports only v0.2.0 also.

Build Status

Build Status

Test Results

The following two tests are the only failing tests from the toml-test suite.

Test: string-escapes (valid)

Parsing failed: Invalid escape sequence at line 9

-------------------------------------------------------------------------------
Test: unicode-escape (valid)

Parsing failed: Invalid escape sequence at line 1


76 passed, 2 failed

Compilation

Requires a well conforming C++11 compiler. On OSX this means clang++ with libc++ and libc++abi (the default clang installed with XCode's command line tools is sufficient).

On Linux, you should be able to use g++ >= 4.8.x, or clang++ with libc++ and libc++abi (if your package manager supplies this; most don't).

Compiling the examples can be done with cmake:

mkdir build
cd build
cmake ../
make

Example Usage

See the root directory files parse.cpp and parse_stdin.cpp for an example usage.