1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

Consolidate JSON, JSONParseResults and JSONParser into JSON

Renames JSON.parse_string() to parse()
Renames JSON.decode_data() to stringify()
This commit is contained in:
Marcel Admiraal
2020-12-29 18:12:33 +00:00
parent df170c8af0
commit 2bafcd3422
25 changed files with 188 additions and 430 deletions

View File

@@ -32,6 +32,7 @@
#include "core/core_string_names.h"
#include "core/debugger/engine_debugger.h"
#include "core/io/json.h"
#include "core/io/marshalls.h"
#include "core/io/resource.h"
#include "core/math/math_funcs.h"
@@ -1838,6 +1839,11 @@ String Variant::stringify(List<const void *> &stack) const {
return "";
}
String Variant::to_json_string() const {
JSON json;
return json.stringify(*this);
}
Variant::operator Vector2() const {
if (type == VECTOR2) {
return *reinterpret_cast<const Vector2 *>(_data._mem);