add example for using configuration's parenthesis operator

This commit is contained in:
ohsqueezy 2023-06-08 18:02:04 -04:00
parent f7368907da
commit c16d71222d
1 changed files with 11 additions and 0 deletions

View File

@ -100,6 +100,17 @@ public:
* Get a read-only reference to the value at the given hierarchy of keys. If no type is specified for the return type, a
* JSON object will be returned.
*
* Example,
*
* std::cout << _configuration() << std::endl;
* std::cout << _configuration("recording", "enabled") << " " << _configuration("input") << " " << _configuration("levels", 0, 3, 1) << std::endl;
*
* Prints,
*
* [full config...]
* true {"any-key-ignore-commands":[],"default-unsuppress-delay":0.7,"ignore-repeat-keypress":true,"suppress-any-key-on-mods":true, \
* "system-any-key-ignore-commands":["fullscreen","screenshot","record","quit"]} 261.0
*
* @param keys hierarchy of keys used to look up a specific value in the config JSON
* @return read-only reference to value specified by keys
*/