46 * this is the interface to the SAX handler |
46 * this is the interface to the SAX handler |
47 */ |
47 */ |
48 class MSaxLayoutAttributesHandler |
48 class MSaxLayoutAttributesHandler |
49 { |
49 { |
50 public: |
50 public: |
51 typedef SAX::basic_Attributes<std::string> TAttribs; // this is XML Attribs, not to be confused with layout attibutes! |
51 typedef Arabica::SAX::Attributes<std::string> TAttribs; // this is XML Attribs, not to be confused with layout attibutes! |
52 virtual MSaxLayoutAttributesHandler* HandleSax(const std::string& aElement, const TAttribs& aAttribs) { return this; }; |
52 virtual MSaxLayoutAttributesHandler* HandleSax(const std::string& aElement, const TAttribs& aAttribs) { return this; }; |
53 virtual void HandleSaxEnd(const std::string& aElement) { }; |
53 virtual void HandleSaxEnd(const std::string& aElement) { }; |
54 }; |
54 }; |
55 |
55 |
56 |
56 |
93 }; |
93 }; |
94 |
94 |
95 /** |
95 /** |
96 * this is the main SAX parser implementation |
96 * this is the main SAX parser implementation |
97 */ |
97 */ |
98 class TLayoutAttributesSaxParser : private SAX::basic_DefaultHandler<std::string> |
98 class TLayoutAttributesSaxParser : private Arabica::SAX::DefaultHandler<std::string> |
99 { |
99 { |
100 private: |
100 private: |
101 typedef stack<MSaxLayoutAttributesHandler*> TSaxAttributesHandlerStack; |
101 typedef stack<MSaxLayoutAttributesHandler*> TSaxAttributesHandlerStack; |
102 typedef SAX::basic_ErrorHandler<std::string>::SAXParseExceptionT TException; |
102 typedef Arabica::SAX::ErrorHandler<std::string>::SAXParseExceptionT TException; |
103 |
103 |
104 public: |
104 public: |
105 TLayoutAttributesSaxParser(MSaxLayoutAttributesHandler* aHandler); |
105 TLayoutAttributesSaxParser(MSaxLayoutAttributesHandler* aHandler); |
106 void Parse(const std::string& aFileName); |
106 void Parse(const std::string& aFileName); |
107 |
107 |
108 private: // from basic_DefaultHandler |
108 private: // from basic_DefaultHandler |
109 void startElement(const std::string& namespaceURI, const std::string& localName, const std::string& qName, const SAX::basic_Attributes<std::string>& atts); |
109 void startElement(const std::string& namespaceURI, const std::string& localName, const std::string& qName, const Arabica::SAX::Attributes<std::string>& atts); |
110 void endElement(const std::string& namespaceURI, const std::string& localName, const std::string& qName); |
110 void endElement(const std::string& namespaceURI, const std::string& localName, const std::string& qName); |
111 |
111 |
112 void warning(const TException& aException); |
112 void warning(const TException& aException); |
113 void error(const TException& aException); |
113 void error(const TException& aException); |
114 void fatalError(const TException& aException); |
114 void fatalError(const TException& aException); |