Diff for /parser3/src/classes/string.C between versions 1.264 and 1.266

version 1.264, 2025/12/15 23:07:29 version 1.266, 2026/01/07 15:03:18
Line 65  static const String match_var_name(MATCH Line 65  static const String match_var_name(MATCH
 // methods  // methods
   
 static void _length(Request& r, MethodParams&) {  static void _length(Request& r, MethodParams&) {
         double result=GET_SELF(r, VString).string().length(r.charsets.source());          double result=(double)GET_SELF(r, VString).string().length(r.charsets.source());
         r.write(*new VDouble(result));          r.write(*new VDouble(result));
 }  }
   
Line 74  static void _int(Request& r, MethodParam Line 74  static void _int(Request& r, MethodParam
   
         if(self_string.is_empty()) {          if(self_string.is_empty()) {
                 if(params.count()>0)                  if(params.count()>0)
                         r.write(*new VInt(params.as_int(0, "default must be int", r))); // (default)                          r.write(*new VInt(params.as_wint(0, "default must be int", r))); // (default)
                 else                  else
                         throw Exception(PARSER_RUNTIME, 0, "unable to convert empty string without default specified");                          throw Exception(PARSER_RUNTIME, 0, "unable to convert empty string without default specified");
         } else {          } else {
                 try {                  try {
                         r.write(*new VInt(self_string.as_int()));                          r.write(*new VInt(self_string.as_wint()));
                 } catch(...) { // convert problem                  } catch(...) { // convert problem
                         if(params.count()>0)                          if(params.count()>0)
                                 r.write(*new VInt(params.as_int(0, "default must be int", r))); // (default)                                  r.write(*new VInt(params.as_wint(0, "default must be int", r))); // (default)
                         else                          else
                                 rethrow; // we have a problem when no default                                  rethrow; // we have a problem when no default
                 }                  }

Removed from v.1.264  
changed lines
  Added in v.1.266


E-mail: