Moved JSON functions to built-in to_json, parse_json, validate_json

This commit is contained in:
Juan Linietsky
2017-01-08 22:40:00 -03:00
parent fdc3380cf6
commit 62273e51a2
10 changed files with 112 additions and 49 deletions

View File

@ -29,7 +29,6 @@
#include "dictionary.h"
#include "safe_refcount.h"
#include "variant.h"
#include "io/json.h"
struct _DictionaryVariantHash {
@ -277,22 +276,6 @@ const Variant* Dictionary::next(const Variant* p_key) const {
return _p->variant_map.next(p_key);
}
Error Dictionary::parse_json(const String& p_json) {
String errstr;
int errline=0;
if (p_json != ""){
Error err = JSON::parse(p_json,*this,errstr,errline);
if (err!=OK) {
ERR_EXPLAIN("Error parsing JSON: "+errstr+" at line: "+itos(errline));
ERR_FAIL_COND_V(err!=OK,err);
}
}
return OK;
}
Dictionary Dictionary::copy() const {
Dictionary n(is_shared());
@ -307,11 +290,6 @@ Dictionary Dictionary::copy() const {
return n;
}
String Dictionary::to_json() const {
return JSON::print(*this);
}
void Dictionary::operator=(const Dictionary& p_dictionary) {