Mercurial > minori
comparison 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 |
comparison
equal
deleted
inserted
replaced
6:1d82f6e04d7d | 7:07a9095eaeed |
---|---|
1 #include "../../dep/json/json.h" | 1 #include "../../dep/json/json.h" |
2 | 2 #ifndef __json_h |
3 #define __json_h | |
3 namespace JSON { | 4 namespace JSON { |
4 std::string GetString(nlohmann::json const& json, nlohmann::json::json_pointer const& ptr); | 5 std::string GetString(nlohmann::json const& json, nlohmann::json::json_pointer const& ptr, std::string def = ""); |
5 int GetInt(nlohmann::json const& json, nlohmann::json::json_pointer const& ptr); | 6 int GetInt(nlohmann::json const& json, nlohmann::json::json_pointer const& ptr, int def = 0); |
6 bool GetBoolean(nlohmann::json const& json, nlohmann::json::json_pointer const& ptr); | 7 bool GetBoolean(nlohmann::json const& json, nlohmann::json::json_pointer const& ptr, bool def = false); |
7 double GetDouble(nlohmann::json const& json, nlohmann::json::json_pointer const& ptr); | 8 double GetDouble(nlohmann::json const& json, nlohmann::json::json_pointer const& ptr, double def = 0); |
8 } | 9 } |
10 #endif // __json_h |