Diff for /parser3/src/classes/string.C between versions 1.156 and 1.158

version 1.156, 2007/08/28 09:28:00 version 1.158, 2007/11/27 10:51:01
Line 96  static void _bool(Request& r, MethodPara Line 96  static void _bool(Request& r, MethodPara
                         throw Exception(PARSER_RUNTIME,                          throw Exception(PARSER_RUNTIME,
                                 0,                                  0,
                                 "parameter is empty string, error converting");                                  "parameter is empty string, error converting");
                 converted=self_string.as_bool();                  
                   try {
                           converted=self_string.as_bool();
                   } catch(...) {
                           const String& lower_string=self_string.change_case(r.charsets.source(), String::CC_LOWER);
                           if(lower_string == "true"){
                                   converted=true;
                           } else if (lower_string == "false"){
                                   converted=false;
                           } else {
                                   rethrow;
                           }
                   }
         } catch(...) { // convert problem          } catch(...) { // convert problem
                 if(params.count()>0)                  if(params.count()>0)
                         converted=params.as_bool(0, "default must be bool", r); // (default)                          converted=params.as_bool(0, "default must be bool", r); // (default)
Line 535  static void _sql(Request& r, MethodParam Line 547  static void _sql(Request& r, MethodParam
 static void _replace(Request& r, MethodParams& params) {  static void _replace(Request& r, MethodParams& params) {
         const String& src=GET_SELF(r, VString).string();          const String& src=GET_SELF(r, VString).string();
   
         Table* table=params.as_no_junction(0, "parameter must not be code").get_table();          Table* table=params.as_no_junction(0, PARAM_MUST_NOT_BE_CODE).get_table();
         if(!table)          if(!table)
                 throw Exception(PARSER_RUNTIME,                  throw Exception(PARSER_RUNTIME,
                         0,                          0,

Removed from v.1.156  
changed lines
  Added in v.1.158


E-mail: