EBOOKXMLParser.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3 * This file is part of the libe-book project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10 #ifndef EBOOKXMLPARSER_H_INCLUDED
11 #define EBOOKXMLPARSER_H_INCLUDED
12
13 #include "libebook_utils.h"
14
15 namespace libebook
16 {
17
30 class EBOOKXMLParser
31 {
32 // disable copying
33 EBOOKXMLParser(const EBOOKXMLParser &other);
34 EBOOKXMLParser &operator=(const EBOOKXMLParser &other);
35
36 public:
37 explicit EBOOKXMLParser(const RVNGInputStreamPtr_t &input);
38 virtual ~EBOOKXMLParser() = 0;
39
40 void parse();
41
48 virtual int getId(const char *name, const char *ns) const = 0;
49
50 virtual void startElement(int id) = 0;
51 virtual void endElement(int id) = 0;
52 virtual void attribute(int id, const char *value) = 0;
53
54 virtual void startElementByName(const char *name, const char *ns) = 0;
55 virtual void endElementByName(const char *name, const char *ns) = 0;
56 virtual void attributeByName(const char *name, const char *ns, const char *value) = 0;
57
58 virtual void text(const char *value) = 0;
59
60 private:
61 const RVNGInputStreamPtr_t m_input;
62 };
63
64 }
65
66 #endif // EBOOKXMLPARSER_H_INCLUDED
67
68 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libebook::EBOOKXMLParser::m_input
const RVNGInputStreamPtr_t m_input
Definition: EBOOKXMLParser.h:61
libebook::RVNGInputStreamPtr_t
boost::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr_t
Definition: libebook_utils.h:82
libebook::EBOOKXMLParser::endElementByName
virtual void endElementByName(const char *name, const char *ns)=0
libebook::EBOOKXMLParser::operator=
EBOOKXMLParser & operator=(const EBOOKXMLParser &other)
libebook::EBOOKXMLParser::parse
void parse()
Definition: EBOOKXMLParser.cpp:118
libebook::EBOOKXMLParser::getId
virtual int getId(const char *name, const char *ns) const =0
Get id of the element/attribute.
libebook::EBOOKXMLParser::endElement
virtual void endElement(int id)=0
libebook::EBOOKHTMLToken::value
Definition: EBOOKHTMLToken.h:263
libebook_utils.h
libebook::EBOOKXMLParser::attributeByName
virtual void attributeByName(const char *name, const char *ns, const char *value)=0
libebook::EBOOKXMLParser::EBOOKXMLParser
EBOOKXMLParser(const EBOOKXMLParser &other)
libebook::EBOOKXMLParser::startElement
virtual void startElement(int id)=0
name
string name
Definition: CHMStream.cpp:80
libebook::EBOOKXMLParser::text
virtual void text(const char *value)=0
libebook::EBOOKXMLParser::startElementByName
virtual void startElementByName(const char *name, const char *ns)=0
libebook::EBOOKHTMLToken::input
Definition: EBOOKHTMLToken.h:91
libebook::EBOOKXMLParser::attribute
virtual void attribute(int id, const char *value)=0
libebook
Definition: CHMParser.cpp:20
libebook::EBOOKXMLParser::~EBOOKXMLParser
virtual ~EBOOKXMLParser()=0
Definition: EBOOKXMLParser.cpp:114
libebook::EBOOKXMLParser
Base class for simple SAX-like XML parser.
Definition: EBOOKXMLParser.h:30