|
|
| version 1.50, 2017/01/23 12:43:36 | version 1.53, 2017/11/15 22:48:57 |
|---|---|
| Line 1 | Line 1 |
| /** @file | /** @file |
| Parser: @b json parser class. | Parser: @b json parser class. |
| Copyright (c) 2000-2015 Art. Lebedev Studio (http://www.artlebedev.com) | Copyright (c) 2000-2017 Art. Lebedev Studio (http://www.artlebedev.com) |
| */ | */ |
| #include "classes.h" | #include "classes.h" |
| Line 32 public: | Line 32 public: |
| DECLARE_CLASS_VAR(json, new MJson); | DECLARE_CLASS_VAR(json, new MJson); |
| // methods | // methods |
| struct Json { | struct Json : public PA_Allocated { |
| Stack<VHash*> stack; | Stack<VHash*> stack; |
| Stack<String*> key_stack; | Stack<String*> key_stack; |
| Line 66 struct Json { | Line 66 struct Json { |
| static void set_json_value(Json *json, Value *value){ | static void set_json_value(Json *json, Value *value){ |
| VHash *top = json->stack.top_value(); | VHash *top = json->stack.top_value(); |
| if(json->key == NULL){ | if(json->key == NULL){ |
| top->hash().put(String(format(top->get_hash()->count(), 0)), value); | top->hash().put(format(top->get_hash()->count(), 0), value); |
| } else { | } else { |
| switch (json->distinct){ | switch (json->distinct){ |
| case Json::D_EXCEPTION: | case Json::D_EXCEPTION: |