|
4 | 4 | [](https://www.nuget.org/packages/Samboy063.Tomlet/)
|
5 | 5 | 
|
6 | 6 | 
|
| 7 | +[](https://coveralls.io/github/SamboyCoding/Tomlet?branch=master) |
7 | 8 |
|
8 | 9 | ### I have a [discord server](https://discord.gg/CfPSP5GMMv) for support
|
9 | 10 |
|
10 | 11 | Tomlet is a zero-dependency library for the [TOML](https://toml.io/) configuration file format. It's targeting [TOML v1.0.0](https://toml.io/en/v1.0.0).
|
11 | 12 |
|
12 |
| -Currently supported features are as follows: |
13 |
| - |
14 |
| -- [x] Primitive key-value pair reading |
15 |
| -- [x] Table Reading |
16 |
| -- [x] Inline Table Reading |
17 |
| -- [x] Array Reading |
18 |
| -- [x] Table-Array Reading |
19 |
| -- [x] Primitive key-value pair writing |
20 |
| -- [x] Table Writing |
21 |
| -- [x] Inline Table Writing |
22 |
| -- [x] Array Writing |
23 |
| -- [x] Table-Array Writing |
24 |
| -- [x] Full Unit Tests for everything supported here. |
| 13 | +The entire 1.0.0 specification as described [here](https://toml.io/en/v1.0.0) is implemented. |
25 | 14 |
|
26 | 15 | ## A word on dotted keys
|
27 | 16 |
|
@@ -67,6 +56,19 @@ class MyClass {
|
67 | 56 | }
|
68 | 57 | ```
|
69 | 58 |
|
| 59 | +### Comments |
| 60 | + |
| 61 | +Comments are parsed and stored alongside their corresponding values, where possible. Every instance of `TomlValue` |
| 62 | +has a `Comments` property, which contains both the "inline" and "preceding" comments. Precending comments are |
| 63 | +the comments that appear before the value (and therefore can span multiple lines), and inline comments are |
| 64 | +the comments that appear on the same line as the value (and thus must be a single line). |
| 65 | + |
| 66 | +Any preceding comment which is not associated with a value (i.e. it is placed after the last value) will be |
| 67 | +stored in the `TrailingComment` property of the TOML document itself, and will be re-serialized from there. |
| 68 | + |
| 69 | +If you're using Tomlet's reflective serialization feature (i.e. `TomletMain.____From`), you can use the `TomlInlineComment` and `TomlPrecedingComment` |
| 70 | +attributes on fields or properties to specify the respective comments. |
| 71 | + |
70 | 72 | ### Parse a TOML File
|
71 | 73 |
|
72 | 74 | `TomlParser.ParseFile` is a utility method to parse an on-disk toml file. This just uses File.ReadAllText, so I/O errors will be thrown up to your calling code.
|
|
0 commit comments