--- parser3/src/include/pa_table.h 2001/03/11 08:16:33 1.10 +++ parser3/src/include/pa_table.h 2001/03/12 20:55:15 1.13 @@ -3,11 +3,11 @@ Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_table.h,v 1.10 2001/03/11 08:16:33 paf Exp $ + $Id: pa_table.h,v 1.13 2001/03/12 20:55:15 paf Exp $ */ /* - hence most of tables are "named", no need to uptimize unnamed onces + hence most of tables are "named", no need to uptimize nameless onces */ @@ -23,31 +23,25 @@ class Table : public Array { public: - Table(Request& arequest, - char *afile, uint aline, + Table(Pool& apool, + const String& asource, Array *acolumns, int initial_rows=CR_INITIAL_ROWS_DEFAULT); - // the base origin of table's data - //const Origin& origin() { return forigin; } + // the source of table's data + const String& source() { return fsource; } const Array *columns() { return fcolumns; } void set_current(int acurrent) { fcurrent=acurrent; } int get_current() { return fcurrent; } - void inc_current() { fcurrent++; } - - void read_item(String& result, const String& column_name) { - result.APPEND(item(column_name), 0/*TODO:think about*/, forigin.file, forigin.line+fcurrent); - } -protected: + const String *item(const String& column_name); - // the request I'm processed on. for error reporting - Request& request; +private: // the base origin of table's data - Origin forigin; + const String& fsource; // column name->number lookup table Hash name2number; @@ -58,10 +52,13 @@ protected: // columns Array *fcolumns; + bool valid(int index) { return index>=0 && index