a_alxparser.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __BARRY_A_ALX_PARSER_H__
00024 #define __BARRY_A_ALX_PARSER_H__
00025
00026 #include <vector>
00027
00028 #include "dll.h"
00029 #include "xmlparser.h"
00030 #include "a_codsection.h"
00031 #include "a_library.h"
00032 #include "a_application.h"
00033 #include "a_osloader.h"
00034 #include <tr1/memory>
00035
00036
00037 namespace Barry {
00038
00039 namespace ALX {
00040
00041
00042 class BXEXPORT ALXParser : public XML::XMLParser
00043 {
00044 public:
00045 enum MainNodeType {
00046 MAIN_NONE,
00047 IN_LOADER,
00048 IN_SYSTEM,
00049 IN_SYSTEM_APPLICATION,
00050 IN_SYSTEM_LIBRARY,
00051 IN_APPLICATION,
00052 IN_APPLICATION_APPLICATION,
00053 IN_LIBRARY
00054 };
00055
00056 enum SubNodeType {
00057 SUB_NONE,
00058 IN_DIRECTORY,
00059 IN_OSFILES,
00060 IN_NAME,
00061 IN_DESCRIPTION,
00062 IN_VERSION,
00063 IN_VENDOR,
00064 IN_COPYRIGHT,
00065 IN_LANGUAGE,
00066 IN_LANGUAGE_SUPPORTED,
00067 IN_REQUIRED,
00068 IN_FILESET
00069 };
00070
00071 private:
00072 bool m_register;
00073 OSLoader& osloader;
00074 MainNodeType node;
00075 SubNodeType subnode;
00076 std::string buffdata;
00077
00078 std::tr1::shared_ptr<CODSection> m_codsection;
00079 std::tr1::shared_ptr<CODSection> m_savecodsection;
00080
00081 public:
00082 ALXParser(OSLoader& osloader, std::istream& input);
00083 virtual ~ALXParser(void);
00084
00085 virtual bool Run(const bool enable);
00086
00087 protected:
00088
00089 virtual void on_start_document();
00090 virtual void on_end_document();
00091 virtual void on_start_element(const Glib::ustring& name,
00092 const xmlpp::SaxParser::AttributeList& attrs);
00093 virtual void on_end_element(const Glib::ustring& name);
00094 virtual void on_characters(const Glib::ustring& data);
00095 virtual void on_comment(const Glib::ustring& text);
00096 virtual void on_warning(const Glib::ustring& text);
00097 virtual void on_error(const Glib::ustring& text);
00098 virtual void on_fatal_error(const Glib::ustring& text);
00099 };
00100
00101
00102 }
00103
00104 }
00105
00106 #endif
00107
00108