--- parser3/src/classes/table.C 2001/07/23 11:19:25 1.94 +++ parser3/src/classes/table.C 2001/07/25 10:43:14 1.95 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) */ -static const char *RCSId="$Id: table.C,v 1.94 2001/07/23 11:19:25 parser Exp $"; +static const char *RCSId="$Id: table.C,v 1.95 2001/07/25 10:43:14 parser Exp $"; #include "pa_config_includes.h" @@ -349,34 +349,6 @@ static void _empty(Request& r, const Str r.write_no_lang(*new(pool) VBool(pool, table.size()==0)); } -/// used by table: _record / store_column_item_to_hash -struct Record_info { - Pool *pool; - Table *table; - Hash *hash; -}; -static void store_column_item_to_hash(Array::Item *item, void *info) { - Record_info& ri=*static_cast(info); - String& column_name=*static_cast(item); - Value *value; - if(const String *column_item=ri.table->item(column_name)) - value=new(*ri.pool) VString(*column_item); - else - value=new(*ri.pool) VVoid(*ri.pool); - ri.hash->put(column_name, value); -} -static void _record(Request& r, const String& method_name, MethodParams *) { - Table& table=static_cast(r.self)->table(); - if(const Array *columns=table.columns()) { - Pool& pool=r.pool(); - Value& result=*new(pool) VHash(pool); - Record_info record_info={&pool, &table, result.get_hash()}; - columns->for_each(store_column_item_to_hash, &record_info); - result.set_name(method_name); - r.write_no_lang(result); - } -} - /// used by table: _hash / table_row_to_hash struct Row_info { Table *table; @@ -821,9 +793,6 @@ MTable::MTable(Pool& apool) : Methoded(a // ^table.empty[] add_native_method("empty", Method::CT_DYNAMIC, _empty, 0, 0); - // ^table.record[] - add_native_method("record", Method::CT_DYNAMIC, _record, 0, 0); - // ^table:hash[key field name] // ^table:hash[key field name][value field name;...] add_native_method("hash", Method::CT_DYNAMIC, _hash, 1, 1000);