--- parser3/src/include/pa_table.h 2001/01/29 22:34:57 1.5 +++ parser3/src/include/pa_table.h 2001/03/12 20:55:15 1.13 @@ -1,9 +1,13 @@ /* - $Id: pa_table.h,v 1.5 2001/01/29 22:34:57 paf Exp $ + Parser + Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) + Author: Alexander Petrosyan (http://design.ru/paf) + + $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 */ @@ -19,31 +23,25 @@ class Table : public Array { public: - Table(Request& request, - 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), forigin.file, forigin.line+fcurrent); - } -protected: + const String *item(const String& column_name); - // request I'm processed on - Request& request; +private: // the base origin of table's data - Origin forigin; + const String& fsource; // column name->number lookup table Hash name2number; @@ -54,10 +52,13 @@ protected: // columns Array *fcolumns; - const Array *at(int index); + bool valid(int index) { return index>=0 && index