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:
41
README.md
41
README.md
@@ -23,15 +23,16 @@ toml11 is a feature-rich TOML language library for C++11/14/17/20.
|
|||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
```toml
|
||||||
|
# example.toml
|
||||||
|
title = "an example toml file"
|
||||||
|
nums = [3, 1, 4, 1, 5] # pi!
|
||||||
|
```
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
#include <toml.hpp>
|
#include <toml.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
// ```toml
|
|
||||||
// title = "an example toml file"
|
|
||||||
// nums = [3, 1, 4, 1, 5] # pi!
|
|
||||||
// ```
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
// select TOML version at runtime (optional)
|
// select TOML version at runtime (optional)
|
||||||
@@ -50,7 +51,7 @@ int main()
|
|||||||
}
|
}
|
||||||
if(data.at("nums").is_array())
|
if(data.at("nums").is_array())
|
||||||
{
|
{
|
||||||
data.push_back(9);
|
data["nums"].as_array().push_back(9);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check comments
|
// check comments
|
||||||
@@ -70,20 +71,36 @@ int main()
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
For more details, please refer to the [documentation](https://toruniina.github.io/toml11/).
|
For more details, please refer to the [documentation](https://toruniina.github.io/toml11/).
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
- [Integration](#integration)
|
- [toml11](#toml11)
|
||||||
- [Features](#features)
|
- [Example](#example)
|
||||||
- [parsing a file](#parsing-a-file)
|
- [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)
|
- [finding a value](#finding-a-value)
|
||||||
- [comments](#comments)
|
- [comments](#comments)
|
||||||
- [error messages](#error-messages)
|
- [error messages](#error-messages)
|
||||||
- [serialization](#serialization)
|
- [serialization](#serialization)
|
||||||
- [Breaking Changes from v3](#changes-from-v3)
|
- [Configuring Types](#configuring-types)
|
||||||
- [Contributors](#contributors)
|
- [Examples](#examples)
|
||||||
- [Licensing Terms](#licensing-terms)
|
- [Changes from v3](#changes-from-v3)
|
||||||
|
- [Breaking Changes](#breaking-changes)
|
||||||
|
- [Added features](#added-features)
|
||||||
|
- [Contributors](#contributors)
|
||||||
|
- [Licensing terms](#licensing-terms)
|
||||||
|
|
||||||
## Integration
|
## Integration
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user