add json verification for configurations

Add json verificiation for configurations.  A configuration is lightly
validated.

Change-Id: I42361daf6ad21d3480e92c3808f5fc8ab8318e0b
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/build/buildjson.hpp b/build/buildjson.hpp
new file mode 100644
index 0000000..afc90df
--- /dev/null
+++ b/build/buildjson.hpp
@@ -0,0 +1,27 @@
+#pragma once
+
+#include <nlohmann/json.hpp>
+#include <string>
+
+using json = nlohmann::json;
+
+/**
+ * Given json data, validate the minimum.
+ * The json data must be valid, and must contain two keys:
+ * sensors, and zones.
+ *
+ * @param[in] data - the json data.
+ * @return nothing - throws exceptions on invalid bits.
+ */
+void validateJson(const json& data);
+
+/**
+ * Given a json configuration file, parse it.
+ *
+ * There must be at least one sensor, and one zone.
+ * That one zone must contain at least one PID.
+ *
+ * @param[in] path - path to the configuration
+ * @return the json data.
+ */
+json parseValidateJson(const std::string& path);