1#ifndef JSON_FILE_READER_H
2#define JSON_FILE_READER_H
4#include "bitrl/extern/nlohmann/json/json.hpp"
19 using json = nlohmann::json;
61 throw std::logic_error(
"JSON file is not open. Have you called open()?");
70 throw std::logic_error(
"JSON file is not open. Have you called open()?");
73 auto data = data_.at(
label);
bool is_open() const noexcept
Return true if and only if the file is open.
Definition file_handler_base.h:55
Definition file_reader_base.h:25
Definition json_file_reader.h:15
virtual void open() override final
Attempts to open the file for reading.
Definition json_file_reader.cpp:17
const json & get(const std::string &label) const
Definition json_file_reader.h:51
nlohmann::json json
Definition json_file_reader.h:19
T get_value(const std::string &label) const
Get the value specified by the label.
Definition json_file_reader.h:57
T at(const std::string &label) const
Definition json_file_reader.h:66
OutT resolve(const std::string &name, const std::map< std::string, std::any > &input)
Definition std_map_utils.h:25
Definition bitrl_consts.h:14