You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Update to toml++ v3
- Improve code in src/utilites.cpp
- Add magic_enum as a dependency
- Update CHANGELOG
- move some headers to `src/include`
- Fix tests
Copy file name to clipboardExpand all lines: README.md
+71-26Lines changed: 71 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,12 +20,15 @@ toml.lua is a [Lua](https://www.lua.org) wrapper around [toml++](https://github.
20
20
-[Decoding](#decoding)
21
21
-[Encoding](#encoding)
22
22
-[Error Handling](#error-handling)
23
-
-[TOML To JSON](#toml-to-json)
23
+
-[TOML Conversion](#toml-conversion)
24
+
-[JSON](#json)
25
+
-[YAML](#yaml)
26
+
-[Output Formatting](#output-formatting)
24
27
-[Dependencies](#dependencies)
25
28
-[Licenses](#licenses)
26
29
-[Contributing](#contributing)
27
30
28
-
<!-- Added by: lebje, at: Wed Nov 24 13:59:16 EST 2021 -->
31
+
<!-- Added by: lebje, at: Thu Dec 2 22:19:10 EST 2021 -->
29
32
30
33
<!--te-->
31
34
@@ -48,10 +51,10 @@ luarocks install toml
48
51
49
52
### Manual Compilation
50
53
51
-
1. Run `cmake -H. -Bbuild -G<generator-name>` to generate the required files.
54
+
1. Run `cmake -S . -B build -G <generator-name>` to generate the required files.
52
55
53
56
> If you have a non standard Lua install location, add the environment variable `LUA_DIR` and have it point to the directory containing the `include` and `lib` folders for your Lua installation. For example:
`toml.encode`, `toml.tomlToJSON`, and `toml.tomlToYAML` all take an optional second parameter: a table containing keys that disable or enable different formatting options.
238
+
Passing an empty table removes all options, while not providing a table will use the default options.
239
+
240
+
```lua
222
241
{
223
-
"a" : 1275892,
224
-
"b" : "Hello, World!",
225
-
"c" : true,
226
-
"d" : 124.2548,
227
-
"e" : {
228
-
"f" : [
229
-
1,
230
-
2,
231
-
3,
232
-
"4",
233
-
5.142
234
-
],
235
-
"g" : "1979-05-27",
236
-
"h" : "07:32:00",
237
-
"i" : "1979-05-27T07:32:00-07:00"
238
-
}
242
+
--- Dates and times will be emitted as quoted strings.
243
+
quoteDatesAndTimes=true,
244
+
245
+
--- Infinities and NaNs will be emitted as quoted strings.
246
+
quoteInfinitesAndNaNs=false,
247
+
248
+
--- Strings will be emitted as single-quoted literal strings where possible.
249
+
allowLiteralStrings=false,
250
+
251
+
--- Strings containing newlines will be emitted as triple-quoted 'multi-line' strings where possible.
252
+
allowMultiLineStrings=false,
253
+
254
+
--- Allow real tab characters in string literals (as opposed to the escaped form `\t`).
255
+
allowRealTabsInStrings=false,
256
+
257
+
--- Allow non-ASCII characters in strings (as opposed to their escaped form, e.g. `\u00DA`).
258
+
allow_unicode_strings=true,
259
+
260
+
--- Allow integers with #value_flags::format_as_binary to be emitted as binary.
261
+
allowBinaryIntegers=true,
262
+
263
+
--- Allow integers with #value_flags::format_as_octal to be emitted as octal.
264
+
allowOctalIntegers=true,
265
+
266
+
--- Allow integers with #value_flags::format_as_hexadecimal to be emitted as hexadecimal.
267
+
allowHexadecimalIntegers=true,
268
+
269
+
--- Apply indentation to tables nested within other tables/arrays.
270
+
indentSubTables=true,
271
+
272
+
--- Apply indentation to array elements when the array is forced to wrap over multiple lines.
273
+
indentArrayElements=true,
274
+
275
+
--- Combination of `indentSubTables` and `indentArrayElements`.
276
+
indentation=true,
277
+
278
+
--- Emit floating-point values with relaxed (human-friendly) precision.
279
+
relaxedFloatPrecision=false
239
280
}
240
-
--]]
241
281
```
242
282
283
+
> The comments for the options are from [the tomlplusplus documentation](https://marzer.github.io/tomlplusplus/namespacetoml.html#a2102aa80bc57783d96180f36e1f64f6a)
The [toml++](https://github.com/marzer/tomlplusplus/) license is available in the `tomlplusplus` directory in the `LICENSE` file.
251
294
252
295
The [sol2](https://github.com/ThePhD/sol2) license is available in the `sol2` directory in the `LICENSE.txt` file.
253
296
297
+
The [magic_enum](https://github.com/Neargye/magic_enum) license is available in [its repository](https://github.com/Neargye/magic_enum/blob/master/LICENSE).
298
+
254
299
## Contributing
255
300
256
301
Before committing, please install [pre-commit](https://pre-commit.com), [clang-format](https://clang.llvm.org/docs/ClangFormat.html), [StyLua](https://github.com/JohnnyMorganz/StyLua), and [Prettier](https://prettier.io), then install the pre-commit hook:
0 commit comments