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
17 Bacula® - The Network Backup Solution
19 Copyright (C) 2004-2009 Free Software Foundation Europe e.V.
21 The main author of Bacula is Kern Sibbald, with contributions from
22 many others, a complete list can be found in the file AUTHORS.
23 This program is Free Software; you can redistribute it and/or
24 modify it under the terms of version three of the GNU Affero General Public
25 License as published by the Free Software Foundation and included
28 This program is distributed in the hope that it will be useful, but
29 WITHOUT ANY WARRANTY; without even the implied warranty of
30 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
31 General Public License for more details.
33 You should have received a copy of the GNU Affero General Public License
34 along with this program; if not, write to the Free Software
35 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
38 Bacula® is a registered trademark of Kern Sibbald.
39 The licensor of Bacula is the Free Software Foundation Europe
40 (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
41 Switzerland, email:ftf@fsfeurope.org.
44 #ifndef WXBTABLEPARSER_H
45 #define WXBTABLEPARSER_H
47 #include "wx/wxprec.h"
53 // for all others, include the necessary headers (this file is usually all you
54 // need because it includes almost all "standard" wxWindows headers)
61 #include <wx/dynarray.h>
64 * Allow the use of Object Array (auto-deletion, object returned as themselves
65 * and not as pointers)
67 class wxbArrayString: public wxArrayString, public wxObject {
69 wxbArrayString(int n = 2000);
70 virtual ~wxbArrayString();
73 WX_DECLARE_OBJARRAY( wxbArrayString, wxbTable );
76 * Class used to parse tables received from director. Data can be accessed with
79 * Example : wxString elem = parser[3][2]; fetches column 2 of element 3.
81 class wxbTableParser: public wxbTable, public wxbDataParser
84 wxbTableParser(bool header = true);
85 virtual ~wxbTableParser();
88 * Receives data to analyse.
90 virtual bool Analyse(wxString str, int status);
93 * Return true table parsing has finished.
98 * Returns table header as an array of wxStrings.
100 const wxbArrayString& GetHeader();
102 wxbArrayString tableHeader;
105 * 0 - Table has not begun
106 * 1 - first +--+ line obtained, header will follow
107 * 2 - second +--+ line obtained, data will follow
108 * 3 - last +--+ line obtained, table parsing has finished
113 #endif // WXBTABLEPARSER_H