Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 46eebfb
Showing
8 changed files
with
2,634 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.swp | ||
*.o | ||
.ycm_* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
cmake_minimum_required( VERSION 2.8 ) | ||
project( cpptoml ) | ||
|
||
option( USE_LIBCXX "Use libc++ for the C++ standard library" ON ) | ||
|
||
include_directories( "include/" ) | ||
|
||
if( UNIX ) | ||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" ) | ||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic" ) | ||
if( USE_LIBCXX ) | ||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" ) | ||
endif() | ||
endif() | ||
|
||
add_executable( parse parse.cpp ) | ||
add_executable( cpptoml parse_stdin.cpp ) | ||
|
||
find_package( Doxygen ) | ||
if( DOXYGEN_FOUND ) | ||
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/cpptoml.doxygen.in | ||
${CMAKE_CURRENT_BINARY_DIR}/cpptoml.doxygen @ONLY | ||
) | ||
add_custom_target( doc | ||
${DOXYGEN_EXECUTABLE} | ||
${CMAKE_CURRENT_BINARY_DIR}/cpptoml.doxygen | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Copyright (c) 2013 Chase Geigle | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# cpptoml | ||
A header-only library for parsing [TOML][toml] configuration files. | ||
|
||
It is reasonably conformant, with the exception of unicode characters in | ||
strings. | ||
|
||
## Test Results | ||
The following two tests are the only failing tests from [the toml-test | ||
suite][toml-test]. | ||
|
||
``` | ||
Test: string-escapes (valid) | ||
Error running test: Could not decode JSON output from parser: invalid character '\f' in string literal | ||
------------------------------------------------------------------------------- | ||
Test: unicode-escape (valid) | ||
Error running test: exit status 1 | ||
54 passed, 2 failed | ||
``` | ||
|
||
# Compilation | ||
Requires a well conforming C++11 compiler. My recommendation is clang++ with | ||
libc++ and libc++abi, as this combination can't really be beat in terms of | ||
completed features + ABI support on Linux and OSX. | ||
|
||
Compiling the examples can be done with cmake: | ||
|
||
``` | ||
mkdir build | ||
cd build | ||
cmake ../ -DCMAKE_BUILD_TYPE=Debug | ||
``` | ||
|
||
# Example Usage | ||
See the root directory files `parse.cpp` and `parse_stdin.cpp` for an | ||
example usage. | ||
|
||
[toml]: https://github.com/mojombo/toml | ||
[toml-test]: https://github.com/BurntSushi/toml-test |
Oops, something went wrong.