Wrapper class for nlohmann:json with error checking.
More...
#include <SimulationParameters.h>
|
| | JsonWrapper (const nlohmann::json &json, const std::string &component, const std::string &name_str, const int &id) |
| | Wrap around JSON configuration with detailed error message in case key is not found in configuration.
|
| |
| const nlohmann::json & | operator[] (const char *key) const |
| | Wrap error check around key retrieval (throws detailed error if key doesn't exist)
|
| |
Wrapper class for nlohmann:json with error checking.
◆ JsonWrapper()
| JsonWrapper::JsonWrapper |
( |
const nlohmann::json & | json, |
|
|
const std::string & | component, |
|
|
const std::string & | name_str, |
|
|
const int & | id ) |
|
inline |
Wrap around JSON configuration with detailed error message in case key is not found in configuration.
- Parameters
-
| json | JSON configuration |
| component | Name of the JSON sub-list to be extracted |
| name_str | Name string of the JSON sub-list to be extracted |
| id | Index of JSON sub-list to be extracted |
◆ operator[]()
| const nlohmann::json & JsonWrapper::operator[] |
( |
const char * | key | ) |
const |
|
inline |
Wrap error check around key retrieval (throws detailed error if key doesn't exist)
- Parameters
-
| key | Key to retrieve from JSON object |
- Returns
- JSON entry of key
The documentation for this class was generated from the following file: