| 1 | #ifndef JIPLIB_JSON_COMPAT_H |
| 2 | #define JIPLIB_JSON_COMPAT_H |
| 3 | |
| 4 | #if __cplusplus >= 201703L |
| 5 | #include <string_view> |
| 6 | #define HAS_STRING_VIEW 1 |
| 7 | #else |
| 8 | #define HAS_STRING_VIEW 0 |
| 9 | #endif |
| 10 | |
| 11 | #include <json/json.h> |
| 12 | #include <string> |
| 13 | |
| 14 | namespace json_util { |
| 15 | // Returns a reference to the member, compatible with various JsonCpp versions |
| 16 | Json::Value& get_member(Json::Value& node, const std::string& key); |
| 17 | Json::Value& get_member(Json::Value& node, const char* key); |
| 18 | } |
| 19 | |
| 20 | #endif |