--- parser3/src/classes/string.C 2003/04/08 11:08:11 1.125.2.15.2.22 +++ parser3/src/classes/string.C 2003/11/20 16:34:23 1.129 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_STRING_C="$Date: 2003/04/08 11:08:11 $"; +static const char * const IDENT_STRING_C="$Date: 2003/11/20 16:34:23 $"; #include "classes.h" #include "pa_vmethod_frame.h" @@ -111,7 +111,8 @@ static void _right(Request& r, MethodPar size_t n=(size_t)params.as_int(0, "n must be int", r); const String& string=GET_SELF(r, VString).string(); - r.write_assign_lang(string.mid(string.length()-n, string.length())); + size_t length=string.length(); + r.write_assign_lang(nkeyL; o++) - if(options->pos(o->keyL)>=0 - || (o->keyU && options->pos(o->keyU)>=0)) { + if(options->pos(o->keyL)!=STRING_NOT_FOUND + || (o->keyU && options->pos(o->keyU)!=STRING_NOT_FOUND)) { if(result & o->checkBit) throw Exception("parser.runtime", options, @@ -176,8 +176,7 @@ static int split_options(const String* o return result; } -static Table& split_vertical(Request& r, ArrayString& pieces, bool right) { - +static Table& split_vertical(ArrayString& pieces, bool right) { Table::columns_type columns(new ArrayString); *columns+=new String("piece"); @@ -200,7 +199,7 @@ static Table& split_vertical(Request& r, return table; } -static Table& split_horizontal(Request& r, ArrayString& pieces, bool right) { +static Table& split_horizontal(ArrayString& pieces, bool right) { Table& table=*new Table(Table::columns_type(0) /* nameless */); Table::element_type row(new ArrayString(pieces.count())); if(right) { // right @@ -220,7 +219,7 @@ static void split_with_options(Request& const String& string=GET_SELF(r, VString).string(); ArrayString pieces; - split_list(r, params, 0, string, pieces); + split_list(params, 0, string, pieces); if(!bits) { const String* options=0; @@ -232,8 +231,8 @@ static void split_with_options(Request& bool right=(bits & SPLIT_RIGHT) != 0; bool horizontal=(bits & SPLIT_HORIZONTAL) !=0; - Table& table=horizontal?split_horizontal(r, pieces, right) - :split_vertical(r, pieces, right); + Table& table=horizontal?split_horizontal(pieces, right) + :split_vertical(pieces, right); r.write_no_lang(*new VTable(&table)); } @@ -265,7 +264,6 @@ static void replace_action(Table& table, int prestart, int prefinish, int poststart, int postfinish, void *info) { - fprintf(stderr, "+"); Replace_action_info& ai=*static_cast(info); if(row) { // begin&middle // piece from last match['prestart'] to beginning of this match['prefinish'] @@ -283,7 +281,6 @@ static void replace_action(Table& table, } } else // end *ai.dest << ai.src->mid(poststart, postfinish); - fprintf(stderr, "-"); } /// @todo use pcre:study somehow @@ -313,7 +310,7 @@ static void _match(Request& r, MethodPar String result; VTable* vtable=new VTable; - Replace_action_info info; + Replace_action_info info={0}; info.request=&r; info.src=&src; info.dest=&result; @@ -330,7 +327,7 @@ static void _match(Request& r, MethodPar } } -static void change_case(Request& r, MethodParams& params, +static void change_case(Request& r, MethodParams&, String::Change_case_kind kind) { const String& src=GET_SELF(r, VString).string(); @@ -358,7 +355,7 @@ public: got_cell(false), result(*new String) {} - bool add_column(SQL_Error& error, const char* str, size_t /*length*/) { + bool add_column(SQL_Error& error, const char* /*str*/, size_t /*length*/) { if(got_column) { error=SQL_Error("parser.runtime", //statement_string, @@ -380,7 +377,7 @@ public: try { got_cell=true; - result.append_help_length(str, length, String::L_TAINTED); + result.append_know_length(str, length, String::L_TAINTED); return false; } catch(...) { error=SQL_Error("exception occured in String_sql_event_handlers::add_row_cell");