diff --git a/sane/gb_json.cpp b/sane/gb_json.cpp index 32d3cbb..a9aa402 100644 --- a/sane/gb_json.cpp +++ b/sane/gb_json.cpp @@ -236,23 +236,23 @@ namespace gb cj = cj->next; } - if (arr_val_.size() == 1 && arr_val_[0]->arr_val_.size() == 0) - { - json* child = arr_val_[0]; - - if (!child->key_.empty()) // array - { - arr_val_.clear(); - type_ = child->type_; - key_ = child->key_; - simple_val_.dval = child->simple_val_.dval; - strval_ = child->strval_; - for (auto& v : child->arr_val_) - arr_val_.push_back(v); - child->arr_val_.clear(); - child->release(); - } - } + //if (arr_val_.size() == 1 && arr_val_[0]->arr_val_.size() == 0) + //{ + // json* child = arr_val_[0]; + // + // if (!child->key_.empty()) // array + // { + // arr_val_.clear(); + // type_ = child->type_; + // key_ = child->key_; + // simple_val_.dval = child->simple_val_.dval; + // strval_ = child->strval_; + // for (auto& v : child->arr_val_) + // arr_val_.push_back(v); + // child->arr_val_.clear(); + // child->release(); + // } + //} if (arr_val_.size()) { @@ -521,10 +521,11 @@ namespace gb } } + return nullptr; // leaf node, return self - add_ref(); + //add_ref(); - return this; + //return this; } json* json::next_child(void) { @@ -1601,13 +1602,13 @@ namespace gb } std::string cont(""); - if (jsn_->is_leaf_node()) - { - jsn_->value(cont); - cont.insert(0, "{\"" + jsn_->key() + "\":\""); - cont += "\"}"; - } - else + //if (jsn_->is_leaf_node()) + //{ + // jsn_->value(cont); + // cont.insert(0, "{\"" + jsn_->key() + "\":\""); + // cont += "\"}"; + //} + //else cont = jsn_->to_string(); if (b64) {