MCPcopy Create free account
hub / github.com/EasyRPG/Player / GetType

Function GetType

src/json_helper.cpp:146–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144 }
145
146 std::string GetType(const json& json_obj, std::string_view json_path) {
147 std::string path_str = std::string(json_path);
148 json::json_pointer ptr(path_str);
149 if (!json_obj.contains(ptr)) {
150 return {};
151 }
152
153 const json& value = json_obj[ptr];
154
155 if (value.is_object()) return std::string("object");
156 if (value.is_array()) return std::string("array");
157 if (value.is_string()) return std::string("string");
158 if (value.is_number()) return std::string("number");
159 if (value.is_boolean()) return std::string("boolean");
160 if (value.is_null()) return std::string("null");
161 return std::string("unknown");
162 }
163
164 std::string GetPath(const json& json_obj, const json& search_value) {
165 std::function<std::string(const json&, const json&, const std::string&)> find_path;

Callers 15

IsActiveMethod · 0.85
GetTransitionTypeMethod · 0.85
GetTeleportMapIdMethod · 0.85
GetTeleportXMethod · 0.85
GetTeleportYMethod · 0.85
GetBattleResultMethod · 0.85
GetSaveSlotMethod · 0.85
GetSaveResultVarMethod · 0.85
GetSourceEventIdMethod · 0.85
GetTargetEventIdMethod · 0.85
GetMapIdMethod · 0.85
GetXMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected