]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/wx-console/wxbtableparser.h
Add version strings
[bacula/bacula] / bacula / src / wx-console / wxbtableparser.h
index fb249592d38964b40106f898fe24fc7afdf6a78e..dfce4989e41e4dfa66943a5f75e14a00dd7a0e6e 100644 (file)
@@ -11,6 +11,7 @@
  *
  *    Nicolas Boichat, April 2004
  *
+ *    Version $Id$
  */
 /*
    Copyright (C) 2004 Kern Sibbald and John Walker
    #include "wx/wx.h"
 #endif
 
-#include <wx/hashmap.h>
+#include "wxbutils.h"
 
-/* int-indexed array of wxString, used for one line */
-WX_DECLARE_HASH_MAP( int, wxString, wxIntegerHash, wxIntegerEqual, wxbTableRow );
-/* int-indexed array of wxbTableRow, contains the whole table */
-WX_DECLARE_HASH_MAP( int, wxbTableRow, wxIntegerHash, wxIntegerEqual, wxbTable );
+#include <wx/dynarray.h>
+
+/* 
+ * Allow the use of Object Array (auto-deletion, object returned as themselves 
+ * and not as pointers)
+ */
+class wxbArrayString: public wxArrayString, public wxObject {
+   public:
+      wxbArrayString(int n = 1);
+      virtual ~wxbArrayString();
+};
+
+WX_DECLARE_OBJARRAY( wxbArrayString, wxbTable );
 
 /*
  * Class used to parse tables received from director. Data can be accessed with
@@ -58,17 +68,16 @@ WX_DECLARE_HASH_MAP( int, wxbTableRow, wxIntegerHash, wxIntegerEqual, wxbTable )
  *
  * Example : wxString elem = parser[3][2]; fetches column 2 of element 3.
  */
-class wxbTableParser: public wxbTable
+class wxbTableParser: public wxbTable, public wxbDataParser
 {
    public:
       wxbTableParser();
-      ~wxbTableParser();
+      virtual ~wxbTableParser();
 
       /*
-       *   Receives director information, forwarded by the wxbPanel which
-       *  uses this parser.
+       *   Receives data to analyse.
        */
-      void Print(wxString str, int status);
+      virtual bool Analyse(wxString str, int status);
 
       /*
        *   Return true table parsing has finished.
@@ -78,9 +87,9 @@ class wxbTableParser: public wxbTable
       /*
        *   Returns table header as an array of wxStrings.
        */
-      wxbTableRow* GetHeader();
+      const wxbArrayString& GetHeader();
    private:
-      wxbTableRow tableHeader;
+      wxbArrayString tableHeader;
 
       /*
        * 0 - Table has not begun
@@ -92,4 +101,3 @@ class wxbTableParser: public wxbTable
 };
 
 #endif // WXBTABLEPARSER_H
-