--- parser3/src/include/pa_table.h 2015/07/28 14:42:44 1.65 +++ parser3/src/include/pa_table.h 2023/09/26 20:49:08 1.73 @@ -1,14 +1,14 @@ /** @file Parser: table class decl. - Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) - Author: Alexandr Petrosian (http://paf.design.ru) + Copyright (c) 2001-2023 Art. Lebedev Studio (http://www.artlebedev.com) + Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_TABLE_H #define PA_TABLE_H -#define IDENT_PA_TABLE_H "$Id: pa_table.h,v 1.65 2015/07/28 14:42:44 moko Exp $" +#define IDENT_PA_TABLE_H "$Id: pa_table.h,v 1.73 2023/09/26 20:49:08 moko Exp $" #include "pa_types.h" #include "pa_hash.h" @@ -32,9 +32,7 @@ class Table: public Array public: typedef ArrayString* columns_type; - Table( - columns_type acolumns, - size_t initial_rows=3); + Table(columns_type acolumns, size_t initial_rows=3); Table(const Table& src, Action_options& options); /// gets column names @@ -50,17 +48,25 @@ 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; + void column_names_init(); + /// @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); @@ -118,7 +124,6 @@ public: return false; } - bool locate(int column, const String& value, Action_options& options); bool locate(const String& column, const String& value, Action_options& options);