3 * Class used to parse tables received from director in this format :
5 * +---------+---------+-------------------+
6 * | Header1 | Header2 | ... |
7 * +---------+---------+-------------------+
8 * | Data11 | Data12 | ... |
10 * +---------+---------+-------------------+
12 * Nicolas Boichat, April 2004
16 Copyright (C) 2004 Kern Sibbald and John Walker
18 This program is free software; you can redistribute it and/or
19 modify it under the terms of the GNU General Public License
20 as published by the Free Software Foundation; either version 2
21 of the License, or (at your option) any later version.
23 This program is distributed in the hope that it will be useful,
24 but WITHOUT ANY WARRANTY; without even the implied warranty of
25 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 GNU General Public License for more details.
28 You should have received a copy of the GNU General Public License
29 along with this program; if not, write to the Free Software
30 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
33 #ifndef WXBTABLEPARSER_H
34 #define WXBTABLEPARSER_H
36 #include "wx/wxprec.h"
42 // for all others, include the necessary headers (this file is usually all you
43 // need because it includes almost all "standard" wxWindows headers)
50 #include <wx/hashmap.h>
52 /* int-indexed array of wxString, used for one line */
53 WX_DECLARE_HASH_MAP( int, wxString, wxIntegerHash, wxIntegerEqual, wxbTableRow );
54 /* int-indexed array of wxbTableRow, contains the whole table */
55 WX_DECLARE_HASH_MAP( int, wxbTableRow, wxIntegerHash, wxIntegerEqual, wxbTable );
58 * Class used to parse tables received from director. Data can be accessed with
61 * Example : wxString elem = parser[3][2]; fetches column 2 of element 3.
63 class wxbTableParser: public wxbTable, public wxbDataParser
67 virtual ~wxbTableParser();
70 * Receives director information, forwarded by the wxbPanel which
73 virtual void Print(wxString str, int status);
76 * Return true table parsing has finished.
81 * Returns table header as an array of wxStrings.
83 wxbTableRow* GetHeader();
85 wxbTableRow tableHeader;
88 * 0 - Table has not begun
89 * 1 - first +--+ line obtained, header will follow
90 * 2 - second +--+ line obtained, data will follow
91 * 3 - last +--+ line obtained, table parsing has finished
96 #endif // WXBTABLEPARSER_H