--- parser3/src/classes/string.C 2007/08/28 09:28:00 1.156 +++ parser3/src/classes/string.C 2007/11/27 10:51:01 1.158 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_STRING_C="$Date: 2007/08/28 09:28:00 $"; +static const char * const IDENT_STRING_C="$Date: 2007/11/27 10:51:01 $"; #include "classes.h" #include "pa_vmethod_frame.h" @@ -96,7 +96,19 @@ static void _bool(Request& r, MethodPara throw Exception(PARSER_RUNTIME, 0, "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 if(params.count()>0) converted=params.as_bool(0, "default must be bool", r); // (default) @@ -535,7 +547,7 @@ static void _sql(Request& r, MethodParam static void _replace(Request& r, MethodParams& params) { 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) throw Exception(PARSER_RUNTIME, 0,