Diff for /parser3/src/classes/string.C between versions 1.252 and 1.256

version 1.252, 2024/09/07 15:01:38 version 1.256, 2024/10/02 22:54:02
Line 147  static void _bool(Request& r, MethodPara Line 147  static void _bool(Request& r, MethodPara
         // for some time due to stupid {} in original design          // for some time due to stupid {} in original design
         const String& fmt=r.process_to_string(fmt_maybe_code);          const String& fmt=r.process_to_string(fmt_maybe_code);
   
         const char* buf=format(r.get_self().as_double(), fmt.trim().cstrm());          const char* buf=format_double(r.get_self().as_double(), fmt.trim().cstrm());
   
         r.write(String(buf));          r.write(String(buf));
 }  }
Line 221  static void split_action(Table& , ArrayS Line 221  static void split_action(Table& , ArrayS
 }  }
   
 static void split_list(Value& delim_value, const String& string, ArrayString& result) {  static void split_list(Value& delim_value, const String& string, ArrayString& result) {
         if(Value* value=delim_value.as(VREGEX_TYPE)){          if(VRegex *vregex=dynamic_cast<VRegex*>(&delim_value)){
                 VRegex *vregex=static_cast<VRegex*>(value);  
                 vregex->study();                  vregex->study();
   
                 int matches_count=0;                  int matches_count=0;
Line 278  static Table& split_vertical(ArrayString Line 277  static Table& split_vertical(ArrayString
                         table+=row;                          table+=row;
                 }                  }
         } else { // left          } else { // left
                 ArrayString::Iterator i(pieces);                  for(ArrayString::Iterator i(pieces); i; ) {
                 while(i.has_next()) {  
                         Table::element_type row(new ArrayString);                          Table::element_type row(new ArrayString);
                         *row+=i.next();                          *row+=i.next();
                         table+=row;                          table+=row;
Line 296  static Table& split_horizontal(ArrayStri Line 294  static Table& split_horizontal(ArrayStri
                 for(int i=pieces.count(); --i>=0; )                  for(int i=pieces.count(); --i>=0; )
                         *row+=pieces[i];                          *row+=pieces[i];
         } else { // left          } else { // left
                 for(ArrayString::Iterator i(pieces); i.has_next(); )                  for(ArrayString::Iterator i(pieces); i; )
                         *row+=i.next();                          *row+=i.next();
         }          }
         table+=row;          table+=row;
Line 387  static void _match(Request& r, MethodPar Line 385  static void _match(Request& r, MethodPar
         Value& regexp=params.as_no_junction(0, "regexp must not be code");          Value& regexp=params.as_no_junction(0, "regexp must not be code");
         Value* options=(params_count>1)?&params.as_no_junction(1, OPTIONS_MUST_NOT_BE_CODE):0;          Value* options=(params_count>1)?&params.as_no_junction(1, OPTIONS_MUST_NOT_BE_CODE):0;
   
         VRegex* vregex;          VRegex* vregex=dynamic_cast<VRegex*>(&regexp);
         VRegexCleaner vrcleaner;          VRegexCleaner vrcleaner;
   
         if(Value* value=regexp.as(VREGEX_TYPE)){          if(vregex){
                 if(options && options->is_defined())                  if(options && options->is_defined())
                         throw Exception(PARSER_RUNTIME, 0, "you can not specify regex-object and options together");                          throw Exception(PARSER_RUNTIME, 0, "you cannot specify regex-object and options together");
                 vregex=static_cast<VRegex*>(value);  
         } else {          } else {
                 vregex=new VRegex(r.charsets.source(), &regexp.as_string(), (options) ? (&options->as_string()) : 0);                  vregex=new VRegex(r.charsets.source(), &regexp.as_string(), (options) ? (&options->as_string()) : 0);
                 vregex->study();                  vregex->study();
Line 489  public: Line 486  public:
         bool add_row(SQL_Error& /*error*/) { /* ignore */ return false; }          bool add_row(SQL_Error& /*error*/) { /* ignore */ return false; }
         bool add_row_cell(SQL_Error& error, const char* str, size_t) {          bool add_row_cell(SQL_Error& error, const char* str, size_t) {
                 if(got_cell) {                  if(got_cell) {
                         error=SQL_Error("result must not contain more then one row");                          error=SQL_Error("result must contain no more than one row");
                         return true;                          return true;
                 }                  }
                 try {                  try {

Removed from v.1.252  
changed lines
  Added in v.1.256


E-mail: