--- parser3/src/main/pa_string.C 2001/04/03 16:34:28 1.67 +++ parser3/src/main/pa_string.C 2001/04/04 10:50:36 1.69 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_string.C,v 1.67 2001/04/03 16:34:28 paf Exp $ + $Id: pa_string.C,v 1.69 2001/04/04 10:50:36 paf Exp $ */ #include "pa_config_includes.h" @@ -342,7 +342,7 @@ const Origin& String::origin() const { } #endif -String& String::piece(size_t start, size_t finish) const { +String& String::mid(size_t start, size_t finish) const { start=max(0, start); finish=min(size(), finish); if(start==finish) @@ -415,12 +415,12 @@ void String::split(Array& result, int pos_before; // while we have 'delim'... for(; (pos_before=pos(delim, delim_size, pos_after, lang))>=0 && limit; limit--) { - result+=&piece(pos_after, pos_before); + result+=&mid(pos_after, pos_before); pos_after=pos_before+delim_size; } // last piece if(pos_after=0 && limit; limit--) { - result+=&piece(pos_after, pos_before); + result+=&mid(pos_after, pos_before); pos_after=pos_before+delim.size(); } // last piece if(pos_aftercstr():0, option_bits); @@ -515,7 +515,7 @@ bool String::match(const String *aorigin if(!code) THROW(0, 0, - ®exp.piece(erroffset, regexp.size()), + ®exp.mid(erroffset, regexp.size()), "match error - %s", errptr); int info_substrings=pcre_info(code, 0, 0); @@ -528,7 +528,7 @@ bool String::match(const String *aorigin } int startoffset=0; - const char *subject=cstr(); + const char *subject=cstr(UL_AS_IS); int length=strlen(subject); int ovecsize; int *ovector=(int *)malloc(sizeof(int)* @@ -568,13 +568,13 @@ bool String::match(const String *aorigin } Array& row=*NEW Array(pool()); - row+=&piece(0, ovector[0]); // .pre-match column value - row+=&piece(ovector[0], ovector[1]); // .match - row+=&piece(ovector[1], size()); // .post-match + row+=&mid(0, ovector[0]); // .pre-match column value + row+=&mid(ovector[0], ovector[1]); // .match + row+=&mid(ovector[1], size()); // .post-match for(int i=1; i