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