1 #pragma once 2 3 #include <nlohmann/json.hpp> 4 5 #include <string> 6 7 using json = nlohmann::json; 8 9 /** 10 * Given json data, validate the minimum. 11 * The json data must be valid, and must contain two keys: 12 * sensors, and zones. 13 * 14 * @param[in] data - the json data. 15 * @return nothing - throws exceptions on invalid bits. 16 */ 17 void validateJson(const json& data); 18 19 /** 20 * Given a json configuration file, parse it. 21 * 22 * There must be at least one sensor, and one zone. 23 * That one zone must contain at least one PID. 24 * 25 * @param[in] path - path to the configuration 26 * @return the json data. 27 */ 28 json parseValidateJson(const std::string& path); 29