Diff for /parser3/src/classes/json.C between versions 1.16 and 1.20

version 1.16, 2011/11/30 06:15:26 version 1.20, 2012/05/28 10:43:58
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 162  static int json_callback(Json *json, int Line 162  static int json_callback(Json *json, int
                         json->key = json_string(json, value);                          json->key = json_string(json, value);
                         break;                          break;
                 case JSON_T_INTEGER:                  case JSON_T_INTEGER:
                         set_json_value(json, new VInt((int)value->vu.integer_value));                          set_json_value(json, new VDouble((double)value->vu.integer_value));
                         break;                          break;
                 case JSON_T_FLOAT:                  case JSON_T_FLOAT:
                         if (json->handle_double){                          if (json->handle_double){
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())){

Removed from v.1.16  
changed lines
  Added in v.1.20


E-mail: