Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: some minor spelling fixes #31

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/Configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ namespace external {
void declare_config(external::OtherObject& config) { ... } // Will not work!
```

In the body of `declare_config`, we tell `config_utilities` everything it needs to know about a config. This consists of a `name` used for human readable printing and warnings, `fields` and their names to read and write the config, and `checks` that define whether the value stored in config are valid or not:
In the body of `declare_config`, we tell `config_utilities` everything it needs to know about a config. This consists of a `name` used for human-readable printing and warnings, `fields` and their names to read and write the config, and `checks` that define whether the values stored in config are valid or not:
```c++
void declare_config(MyConfig& config) {
config::name("MyConfig");
// Declares the name to be 'MyConfig'. Does not have to match the truct name but is recmmended.
// Declares the name to be 'MyConfig'. Does not have to match the struct name but is recommended.

config::field(config.int_val, "int_val_name");
// Declares that 'MyConfig' has a public member 'int_val' that will be referred to as
// 'int_val_name' for parsing and printing.

config::field(config.x, "x", "m");
// Optionally specify a unit as 3rd argument. This will print that x is in nmeters.
// Optionally specify a unit as 3rd argument. This will print that x is in meters.

config::check(config.x, config::GT, 0, "x");
// Declares that the config is only valid if config.x > 0. The second "x" defines the name to
Expand All @@ -56,8 +56,8 @@ Binary checks such as GT (>), GE (>=), LT (<), LE (<=), EQ (==), NE (!=) can be
config::check(config.x, config::GT, 0, "x");
```

For a double sided value check, use `checkInRange(field,, lower, upper, field_name, lower_inclusive, upper_inclusive)`.
E.g. the condition `x is within [0, 100)` becomes:
For a double-sided value check, use `checkInRange(field,, lower, upper, field_name, lower_inclusive, upper_inclusive)`.
E.g., the condition `x is within [0, 100)` becomes:
```c++
config::checkInRange(config.x, 0.0, 100.0, "x", true, false);
```
Expand Down Expand Up @@ -114,7 +114,7 @@ private:

## Printing configs

To print configs to string incldue `printing.h`.
To print configs to string include `printing.h`.
This defines `toString()` for objects declared a config:
```c++
MyConfig cfg;
Expand Down
2 changes: 1 addition & 1 deletion docs/External.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct Talker {

} // namespace talker

/******** compiled in seperate library (`libexternal_talker_plugin.so`) *************************************/
/******** compiled in a separate library (`libexternal_talker_plugin.so`) *************************************/

namespace external {

Expand Down