--- parser3/src/include/pa_table.h 2003/09/25 09:15:02 1.53 +++ parser3/src/include/pa_table.h 2020/12/15 17:10:32 1.71 @@ -1,14 +1,14 @@ /** @file Parser: table class decl. - Copyright (c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2020 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_TABLE_H #define PA_TABLE_H -static const char* IDENT_TABLE_H="$Date: 2003/09/25 09:15:02 $"; +#define IDENT_PA_TABLE_H "$Id: pa_table.h,v 1.71 2020/12/15 17:10:32 moko Exp $" #include "pa_types.h" #include "pa_hash.h" @@ -50,7 +50,10 @@ public: size_t current() const { return fcurrent; } void offset(bool absolute, int offset); - /** @return column index from @a column_name. '<0' if no such column + /// @return checks all rows to find maximum cells number + size_t max_cells() const; + + /** @return column index from @a column_name. '<0' if no such column if no such - 'bark' */ int column_name2index(const String& column, bool bark) const; @@ -58,6 +61,12 @@ public: /// @return item from @a column const String* item(size_t column); + /// sets @a column value + void put_item(size_t column, const String*); + + /// removes current row + void remove_current(); + /// @return item from @a column. '0' if no such column const String* item(const String& column) { int index=column_name2index(column, false); @@ -75,8 +84,8 @@ public: size_t saved_current=current(); size_t row=o.offset; if(o.reverse) { // reverse - for(size_t to=row-o.limit; row>=to; --row) { - set_current(row); + for(size_t i=0; i - bool table_first_that(bool (*func)(Table& self, I* info), void* info, Action_options& o) { + bool table_first_that(bool (*func)(Table& self, I info), I info, Action_options& o) { if(!o.adjust(count())) return false; size_t saved_current=current(); size_t row=o.offset; if(o.reverse) { // reverse - for(size_t to=row-o.limit; row>=to; --row) { - set_current(row); + for(size_t i=0; inumber lookup table - typedef Hash name2number_hash_class; + typedef HashString name2number_hash_class; name2number_hash_class* name2number; /// is that @c index falid? - bool valid(size_t index) const { return index>=0 && index