Skip to content

Commit

Permalink
Update doxygen docs to be in sync with the README. (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
niklas-uhl authored Feb 14, 2025
1 parent 2c033e7 commit a176c1f
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions docs/main.dox
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ int b = 3;
KASSERT(a + a == b, "Under the assumption that a is " << a << ", the world is a lie!");
```

Use \ref THROWING_KASSERT to throw an exception if the assertion fails.
This requires the library to be build in exception mode (`-DKASSERT_EXCEPTION_MODE=On`).
If exception mode is not enabled, \ref THROWING_KASSERT acts the same as \ref KASSERT.
Use \ref THROWING_KASSERT to throw an exception if the assertion fails.
This requires the target property \c KASSERT_EXCEPTION_MODE to be set
to \c ON on the target linking against \c kassert. If exception mode is
not enabled, \ref THROWING_KASSERT acts the same as \ref KASSERT.

```
THROWING_KASSERT(1 + 1 == 3, "The world is a lie!");
Expand All @@ -51,11 +52,16 @@ argument, followed by the remaining arguments `[, ...]` passed to \ref THROWING_

### Assertion Levels

To control which assertions are enabled or disabled, you must supply the CMake option `-DKASSERT_ASSERTION_LEVEL=<numeric>`.
If omitted, the assertion level is set to `0`, which disables all assertions.
Assertions are enabled if their assertion level (optional third parameter of \ref KASSERT) is <b>less than or equal to</b> the active assertion level.
The default level is \ref kassert::assert::normal (30).
Set the CMake target property \c KASSERT_ASSERTION_LEVEL on you target linking against \c kassert to the numeric value of the desired assertion level.
If omitted, the assertion level is set to 0, which disables all assertions.

Assertions are enabled if their assertion level (optional third parameter of \ref KASSERT ) is **less than or equal to** the active assertion level.
The default level is `kassert::assert::normal` (30), see \ref assertion-levels.
```cmake
add_library(my_code ...)
target_link_libraries(my_code PRIVATE kassert::kassert)
set_target_properties(my_code PROPERTIES KASSERT_ASSERTION_LEVEL 10)
```

### Custom Assertion Levels

Expand All @@ -78,7 +84,7 @@ constexpr int heavy = KAMPING_ASSERTION_LEVEL_HEAVY;

## LICENSE

KAssert is released under the MIT License. See [LICENSE](https://github.com/kamping-site/kassert/blob/main/LICENSE) for details.
KAssert is released under the MIT License. See ./LICENSE for details.


*/
Expand Down

0 comments on commit a176c1f

Please sign in to comment.