--- parser3/src/include/pa_table.h 2001/02/20 18:45:51 1.8 +++ parser3/src/include/pa_table.h 2001/03/12 13:13:20 1.12 @@ -1,9 +1,13 @@ /* - $Id: pa_table.h,v 1.8 2001/02/20 18:45:51 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.12 2001/03/12 13:13:20 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,13 +23,13 @@ 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; } @@ -33,17 +37,12 @@ public: 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; @@ -54,10 +53,13 @@ protected: // columns Array *fcolumns; + bool valid(int index) { return index>=0 && index