Skip to content

Commit

Permalink
Small doc update.
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinH committed Apr 10, 2024
1 parent b8406d2 commit 8e967c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions doc/All-Config-Functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ For example `foo = (parse (default ...))` is allowed, but `foo = (default (parse

## print

The `print` function takes a part of the config and turns it back into a JAXN string (which is the same as a JSON string as long as the JAXN extensions to the JSON data model, binary data and non-finite floating point numbers, are **not** used).
The `print` function takes a part of the config and turns it back into a JAXN string (which is the same as a JSON string as long as the JAXN extension to the JSON data model, binary data and non-finite floating point numbers, are **not** used).

#### Example taoCONFIG Input File

Expand Down Expand Up @@ -204,7 +204,7 @@ foo = (shell "uname -s")
}
```

Note that availability and behaviour of the `shell` value extension are inherently system dependent.
Note that availability and behaviour of the `shell` function are inherently system dependent.
Currently it is only supported on Unix-style operating systems that are sufficiently POSIX compliant, most prominently Linux and macOS.


Expand Down Expand Up @@ -251,7 +251,7 @@ foo = (string $48656C6C6F2C20776F726C6421)
}
```

Note that the conversion from `binary` to `string` is automatic when the binary data is passed to an extension that expects a string.
Note that the conversion from `binary` to `string` is automatic when the binary data is passed to a function that expects a string argument.
The automatic conversion, too, checks whether the binary data is a valid UTF-8 sequence and throws an exception if that is not the case.


Expand Down
9 changes: 5 additions & 4 deletions doc/Parsing-Config-Files.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* [Custom Traits](#custom-traits)
* [Builtin Schema](#builtin-schema)

This library requires decent C++17 support, currently supported are GCC 9 and Clang 11 (or newer).
This library requires decent C++17 support.
Minimum supported compiler versions are GCC 9 and Clang 11.

The following assumes that the [PEGTL], [taoJSON] and [taoCONFIG] are all available to your compiler, i.e. the include paths are set up correctly.
When checking out [taoCONFIG] via git this can be achieved by (recursively!) initialising and updating all git submodules.
Expand All @@ -23,7 +24,7 @@ tao::config::value tao::config::from_file( const std::filesystem::path& );
tao::config::value tao::config::from_files( const std::vector< std::filesystem::path >& files );
```
When more than one file is passed to `from_files()` it behaves (mostly) like parsing a single file with the concatenated contents (the only difference being that while individual files may optionally contain top-level curly braces for the implicit top-level JSON Object these would produce an error in the concatenated file).
When more than one file is passed to `from_files()` it behaves (mostly) like parsing a single file with the concatenated contents (the only difference being that while individual files may optionally contain top-level curly braces for the implicit top-level JSON Object it would produce an error if the hypothetical concatenated file would contain multiple top-level objects).
The config can also be parsed from a `std::string` instead of a file.
The second parameter, `source`, should be a string that describes the source of the data.
Expand All @@ -36,11 +37,11 @@ tao::config::value tao::config::from_string( const std::string& data, const std:

## Inspecting

Since the parsed config is presented as single [taoJSON] value object, all the facilities from the [taoJSON] library can be used to inspect and operate on the obtained config.
Since the parsed config is returned as single [taoJSON] value object, a `tao::json::basic_value< tao::config::traits >`, all facilities from the [taoJSON] library can be used to inspect and operate on such an in-memory config representation.

## Annotations

By default, i.e. when using the included `tao::config::traits` for `tao::json::basic_value`, the [taoJSON] library's annotation feature is used to store the "config Key", as well as the filename (or, more generally, the source) and line and column numbers where they occurred in the parsed input.
By default, i.e. when using the included `tao::config::traits` for `tao::json::basic_value`, the [taoJSON] annotation feature is used to store the "config Key", as well as the filename (or, more generally, the source) and line and column numbers where they occurred in the parsed input.

The config Key is conceptually a kind of strongly typed JSON Pointer.
That is, unlike in a JSON Pointer, the string "2" and the integer 2 are distinguished.
Expand Down

0 comments on commit 8e967c9

Please sign in to comment.