diff src/include/json.h @ 7:07a9095eaeed

Update Refactored some code, moved some around
author Paper <mrpapersonic@gmail.com>
date Thu, 24 Aug 2023 23:11:38 -0400
parents 1d82f6e04d7d
children
line wrap: on
line diff
--- a/src/include/json.h	Wed Aug 16 00:49:17 2023 -0400
+++ b/src/include/json.h	Thu Aug 24 23:11:38 2023 -0400
@@ -1,8 +1,10 @@
 #include "../../dep/json/json.h"
-
+#ifndef __json_h
+#define __json_h
 namespace JSON {
-	std::string GetString(nlohmann::json const& json, nlohmann::json::json_pointer const& ptr);
-	int GetInt(nlohmann::json const& json, nlohmann::json::json_pointer const& ptr);
-	bool GetBoolean(nlohmann::json const& json, nlohmann::json::json_pointer const& ptr);
-	double GetDouble(nlohmann::json const& json, nlohmann::json::json_pointer const& ptr);
+	std::string GetString(nlohmann::json const& json, nlohmann::json::json_pointer const& ptr, std::string def = "");
+	int GetInt(nlohmann::json const& json, nlohmann::json::json_pointer const& ptr, int def = 0);
+	bool GetBoolean(nlohmann::json const& json, nlohmann::json::json_pointer const& ptr, bool def = false);
+	double GetDouble(nlohmann::json const& json, nlohmann::json::json_pointer const& ptr, double def = 0);
 }
+#endif // __json_h
\ No newline at end of file