lib: removed virtual inheritance from some ALX parser classes
[barry.git] / src / a_alxparser.h
blobbec2fe40ff9ec8050a84fe5a9b5f4c3253496dbb
1 ///
2 /// \file a_alxparser.h
3 /// ALX file parser (for one file)
4 ///
6 /*
7 Copyright (C) 2010, Nicolas VIVIEN
8 Copyright (C) 2005-2010, Net Direct Inc. (http://www.netdirect.ca/)
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 See the GNU General Public License in the COPYING file at the
20 root directory of this project for more details.
23 #ifndef __BARRY_A_ALX_PARSER_H__
24 #define __BARRY_A_ALX_PARSER_H__
26 #include <vector>
28 #include "dll.h"
29 #include "xmlparser.h"
30 #include "a_codsection.h"
31 #include "a_library.h"
32 #include "a_application.h"
33 #include "a_osloader.h"
36 namespace Barry {
38 namespace ALX {
41 class BXEXPORT ALXParser : public XML::XMLParser
43 public:
44 enum MainNodeType {
45 MAIN_NONE,
46 IN_LOADER,
47 IN_SYSTEM,
48 IN_SYSTEM_APPLICATION,
49 IN_SYSTEM_LIBRARY,
50 IN_APPLICATION,
51 IN_LIBRARY
54 enum SubNodeType {
55 SUB_NONE,
56 IN_DIRECTORY,
57 IN_OSFILES,
58 IN_NAME,
59 IN_DESCRIPTION,
60 IN_VERSION,
61 IN_VENDOR,
62 IN_COPYRIGHT,
63 IN_LANGUAGE,
64 IN_LANGUAGE_SUPPORTED,
65 IN_REQUIRED,
66 IN_FILESET
69 private:
70 bool m_register;
71 OSLoader& osloader;
72 MainNodeType node;
73 SubNodeType subnode;
74 std::string buffdata;
76 CODSection *m_codsection;
78 public:
79 ALXParser(OSLoader& osloader, std::istream& input);
80 virtual ~ALXParser(void);
82 virtual bool Run(const bool enable);
84 protected:
85 // SaxParser overrides, also overridden in XMLParser
86 virtual void on_start_document();
87 virtual void on_end_document();
88 virtual void on_start_element(const Glib::ustring& name,
89 const xmlpp::SaxParser::AttributeList& attrs);
90 virtual void on_end_element(const Glib::ustring& name);
91 virtual void on_characters(const Glib::ustring& data);
92 virtual void on_comment(const Glib::ustring& text);
93 virtual void on_warning(const Glib::ustring& text);
94 virtual void on_error(const Glib::ustring& text);
95 virtual void on_fatal_error(const Glib::ustring& text);
99 } // namespace ALX
101 } // namespace Barry
103 #endif