mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-18 02:08:09 +08:00
Merge pull request #277 from oldoldtea/fix-readme
This commit is contained in:
49
README.md
49
README.md
@@ -23,15 +23,16 @@ toml11 is a feature-rich TOML language library for C++11/14/17/20.
|
||||
|
||||
## Example
|
||||
|
||||
```toml
|
||||
# example.toml
|
||||
title = "an example toml file"
|
||||
nums = [3, 1, 4, 1, 5] # pi!
|
||||
```
|
||||
|
||||
```cpp
|
||||
#include <toml.hpp>
|
||||
#include <iostream>
|
||||
|
||||
// ```toml
|
||||
// title = "an example toml file"
|
||||
// nums = [3, 1, 4, 1, 5] # pi!
|
||||
// ```
|
||||
|
||||
int main()
|
||||
{
|
||||
// select TOML version at runtime (optional)
|
||||
@@ -50,7 +51,7 @@ int main()
|
||||
}
|
||||
if(data.at("nums").is_array())
|
||||
{
|
||||
data.push_back(9);
|
||||
data["nums"].as_array().push_back(9);
|
||||
}
|
||||
|
||||
// check comments
|
||||
@@ -70,20 +71,36 @@ int main()
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
For more details, please refer to the [documentation](https://toruniina.github.io/toml11/).
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Integration](#integration)
|
||||
- [Features](#features)
|
||||
- [parsing a file](#parsing-a-file)
|
||||
- [finding a value](#finding-a-value)
|
||||
- [comments](#comments)
|
||||
- [error messages](#error-messages)
|
||||
- [serialization](#serialization)
|
||||
- [Breaking Changes from v3](#changes-from-v3)
|
||||
- [Contributors](#contributors)
|
||||
- [Licensing Terms](#licensing-terms)
|
||||
- [toml11](#toml11)
|
||||
- [Example](#example)
|
||||
- [Table of Contents](#table-of-contents)
|
||||
- [Integration](#integration)
|
||||
- [Single Include File](#single-include-file)
|
||||
- [git submodule](#git-submodule)
|
||||
- [CMake `FetchContent`](#cmake-fetchcontent)
|
||||
- [CMake Package Manager (CPM)](#cmake-package-manager-cpm)
|
||||
- [Install Using CMake](#install-using-cmake)
|
||||
- [Precompile Library](#precompile-library)
|
||||
- [Building Example](#building-example)
|
||||
- [Building Tests](#building-tests)
|
||||
- [Features](#features)
|
||||
- [Parsing a File](#parsing-a-file)
|
||||
- [finding a value](#finding-a-value)
|
||||
- [comments](#comments)
|
||||
- [error messages](#error-messages)
|
||||
- [serialization](#serialization)
|
||||
- [Configuring Types](#configuring-types)
|
||||
- [Examples](#examples)
|
||||
- [Changes from v3](#changes-from-v3)
|
||||
- [Breaking Changes](#breaking-changes)
|
||||
- [Added features](#added-features)
|
||||
- [Contributors](#contributors)
|
||||
- [Licensing terms](#licensing-terms)
|
||||
|
||||
## Integration
|
||||
|
||||
|
Reference in New Issue
Block a user