Add indent and sort keys support for JSON.print
This commit is contained in:
parent
c880302754
commit
f7168bf217
4 changed files with 46 additions and 19 deletions
|
|
@ -2669,12 +2669,12 @@ Variant JSONParseResult::get_result() const {
|
|||
}
|
||||
|
||||
void _JSON::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("print", "value"), &_JSON::print);
|
||||
ClassDB::bind_method(D_METHOD("print", "value", "indent", "sort_keys"), &_JSON::print, DEFVAL(String()), DEFVAL(false));
|
||||
ClassDB::bind_method(D_METHOD("parse", "json"), &_JSON::parse);
|
||||
}
|
||||
|
||||
String _JSON::print(const Variant &p_value) {
|
||||
return JSON::print(p_value);
|
||||
String _JSON::print(const Variant &p_value, const String &p_indent, bool p_sort_keys) {
|
||||
return JSON::print(p_value, p_indent, p_sort_keys);
|
||||
}
|
||||
|
||||
Ref<JSONParseResult> _JSON::parse(const String &p_json) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue