--- parser3/src/classes/table.C 2003/02/04 14:12:42 1.172.2.4 +++ parser3/src/classes/table.C 2003/02/04 15:15:02 1.172.2.5 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_TABLE_C="$Date: 2003/02/04 14:12:42 $"; +static const char* IDENT_TABLE_C="$Date: 2003/02/04 15:15:02 $"; #include "classes.h" #include "pa_vmethod_frame.h" @@ -64,11 +64,11 @@ static void get_copy_options(Request& r, } if(valid_options!=options->size()) throw Exception("parser.runtime", - &method_name, + method_name, "called with invalid option"); } else throw Exception("parser.runtime", - &method_name, + method_name, "options must be hash"); } if(!limit) // zero limit = sould be 'nothing to copy', for methods zero means 'all' @@ -105,7 +105,7 @@ static void _create(Request& r, StringPt head.get_string(0)->split(*columns, 0, "\t", 1, String::UL_AS_IS); } - Table& table=*new(pool) Table(pool, &method_name, columns); + Table& table=*new(pool) Table(pool, method_name, columns); // parse cells Array rows(pool); data.split(rows, &pos_after, "\n", 1, String::UL_AS_IS); @@ -144,7 +144,7 @@ static void _load(Request& r, StringPtr // parse columns Array *columns; #ifndef NO_STRING_ORIGIN - const Origin& origin=method_name.origin(); + const Origin& origin=method_name->origin(); const char* file=origin.file; uint line=origin.line; #endif @@ -168,7 +168,7 @@ static void _load(Request& r, StringPtr } // parse cells - Table& table=*new(pool) Table(pool, &method_name, columns); + Table& table=*new(pool) Table(pool, method_name, columns); char *row_chars; while(row_chars=getrow(&data)) { // remove empty&comment lines @@ -374,13 +374,13 @@ static void _hash(Request& r, StringPtr } if(valid_options!=options->size()) throw Exception("parser.runtime", - &method_name, + method_name, "called with invalid option"); } } if(param_index==2) // bad options param type throw Exception("parser.runtime", - &method_name, + method_name, "options must be hash"); Array value_fields(pool); @@ -396,7 +396,7 @@ static void _hash(Request& r, StringPtr } } else throw Exception("parser.runtime", - &method_name, + method_name, "value field(s) must be string or self_table" ); } else { // by all columns, including key @@ -452,7 +452,7 @@ static void _sort(Request& r, StringPtr false; // default=asc Table& old_table=static_cast(r.get_self())->table(&method_name); - Table& new_table=*new(pool) Table(pool, &method_name, old_table.columns()); + Table& new_table=*new(pool) Table(pool, method_name, old_table.columns()); Table_seq_item *seq=(Table_seq_item *)pool.malloc(sizeof(Table_seq_item)*old_table.size()); int i; @@ -487,7 +487,7 @@ static void _sort(Request& r, StringPtr static bool _locate_expression(Request& r, StringPtr method_name, MethodParams& params) { if(params.count()>1) throw Exception("parser.runtime", - &method_name, + method_name, "locate by expression has only one parameter - expression"); Value& expression_code=params.as_junction(0, "must be expression"); @@ -507,7 +507,7 @@ static bool _locate_expression(Request& static bool _locate_name_value(Request& r, StringPtr method_name, MethodParams& params) { if(params.count()>2) throw Exception("parser.runtime", - &method_name, + method_name, "locate by name and value has only two parameters - name and value"); Table& table=static_cast(r.get_self())->table(&method_name); @@ -527,7 +527,7 @@ static void _locate(Request& r, StringPt static void _flip(Request& r, StringPtr method_name, MethodParams& params) { Pool& pool=r.pool(); Table& old_table=static_cast(r.get_self())->table(&method_name); - Table& new_table=*new(pool) Table(pool, &method_name, 0/*nameless*/); + Table& new_table=*new(pool) Table(pool, method_name, 0/*nameless*/); if(old_table.size()) if(int old_cols=old_table.at(0).size()) for(int column=0; column(r.get_self())->table(&method_name); if(&src == &dest) throw Exception("parser.runtime", - &method_name, + method_name, "source and destination are same table"); int offset, limit; @@ -628,7 +628,7 @@ public: } bool before_rows(SQL_Error& error) { try { - table=new(pool) Table(pool, &method_name, &columns); + table=new(pool) Table(pool, method_name, &columns); return false; } catch(...) { error=SQL_Error("exception occured in Table_sql_event_handlers::before_rows"); @@ -691,11 +691,11 @@ static void _sql(Request& r, StringPtr m } if(valid_options!=options->size()) throw Exception("parser.runtime", - &method_name, + method_name, "called with invalid option"); } else throw Exception("parser.runtime", - &method_name, + method_name, "options must be hash"); } @@ -728,7 +728,7 @@ static void _sql(Request& r, StringPtr m Table *result= handlers.table?handlers.table: // query resulted in table? return it - new(pool) Table(pool, &method_name, 0); // query returned no table, fake it + new(pool) Table(pool, method_name, 0); // query returned no table, fake it // replace any previous table value static_cast(r.get_self())->set_table(*result); @@ -739,7 +739,7 @@ static void _columns(Request& r, StringP Array& result_columns=*new(pool) Array(pool); result_columns+=new(pool) String(pool, "column"); - Table& result_table=*new(pool) Table(pool, &method_name, &result_columns); + Table& result_table=*new(pool) Table(pool, method_name, &result_columns); Table& source_table=static_cast(r.get_self())->table(&method_name); if(const Array *source_columns=source_table.columns()) {