|
|
| version 1.16, 2011/11/30 06:15:26 | version 1.19, 2012/05/27 22:33:59 |
|---|---|
| Line 1 | Line 1 |
| /** @file | /** @file |
| Parser: @b json parser class. | Parser: @b json parser class. |
| Copyright (c) 2010 ArtLebedev Group (http://www.artlebedev.com) | Copyright (c) 2000-2012 Art. Lebedev Studio (http://www.artlebedev.com) |
| */ | */ |
| static const char * const IDENT_RESPONSE_C="$Date$"; | |
| #include "classes.h" | #include "classes.h" |
| #include "pa_vmethod_frame.h" | #include "pa_vmethod_frame.h" |
| Line 20 static const char * const IDENT_RESPONSE | Line 18 static const char * const IDENT_RESPONSE |
| #include "pa_vxdoc.h" | #include "pa_vxdoc.h" |
| #endif | #endif |
| volatile const char * IDENT_JSON_C="$Id$"; | |
| // class | // class |
| class MJson: public Methoded { | class MJson: public Methoded { |
| Line 173 static int json_callback(Json *json, int | Line 173 static int json_callback(Json *json, int |
| set_json_value(json, new VString(*json_string(json, value))); | set_json_value(json, new VString(*json_string(json, value))); |
| break; | break; |
| case JSON_T_NULL: | case JSON_T_NULL: |
| set_json_value(json, new VVoid()); | set_json_value(json, VVoid::get()); |
| break; | break; |
| case JSON_T_TRUE: | case JSON_T_TRUE: |
| set_json_value(json, &VBool::get(true)); | set_json_value(json, &VBool::get(true)); |
| Line 385 static void _string(Request& r, MethodPa | Line 385 static void _string(Request& r, MethodPa |
| } else if(key == "file" && value->is_string()){ | } else if(key == "file" && value->is_string()){ |
| const String& svalue=value->as_string(); | const String& svalue=value->as_string(); |
| if(!json.set_file_format(svalue)) | if(!json.set_file_format(svalue)) |
| throw Exception(PARSER_RUNTIME, &svalue, "must be 'base64' or 'text'"); | throw Exception(PARSER_RUNTIME, &svalue, "must be 'base64', 'text' or 'stat'"); |
| valid_options++; | valid_options++; |
| #ifdef XML | #ifdef XML |
| } else if(key == "xdoc" && (vvalue = value->get_hash())){ | } else if(key == "xdoc" && (vvalue = value->get_hash())){ |