EBOOKSAXParser.h Source File documentation

EBOOKSAXParser.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 EBOOKSAXParser
31 {
32 // disable copying
33 EBOOKSAXParser(const EBOOKSAXParser &other);
34 EBOOKSAXParser &operator=(const EBOOKSAXParser &other);
35
36 public:
37 explicit EBOOKSAXParser(const RVNGInputStreamPtr_t &input);
38 virtual ~EBOOKSAXParser() = 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::EBOOKSAXParser::getId
virtual int getId(const char *name, const char *ns) const =0
Get id of the element/attribute.
libebook::EBOOKSAXParser::attributeByName
virtual void attributeByName(const char *name, const char *ns, const char *value)=0
libebook::RVNGInputStreamPtr_t
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr_t
Definition: libebook_utils.h:54
EBOOKSAXParser.h
ebookXMLReadFromStream
int ebookXMLReadFromStream(void *context, char *buffer, int len)
Definition: libebook_xml.cpp:19
libebook
Definition: BBeBCollector.cpp:19
value
qi::rule< Iterator, AttrValue_t, qi::space_type > value
Definition: TealDocParser.cpp:231
libebook::EBOOKSAXParser::text
virtual void text(const char *value)=0
libebook::char_cast
const char * char_cast(const char *const c)
Definition: libebook_xml.cpp:53
libebook::EBOOKSAXParser
Base class for simple SAX-like XML parser.
Definition: EBOOKSAXParser.h:31
libebook_utils.h
libebook::EBOOKSAXParser::EBOOKSAXParser
EBOOKSAXParser(const EBOOKSAXParser &other)
m_input
librevenge::RVNGInputStream * m_input
Definition: PeanutPressParser.cpp:262
libebook::EBOOKSAXParser::endElementByName
virtual void endElementByName(const char *name, const char *ns)=0
libebook::EBOOKSAXParser::parse
void parse()
Definition: EBOOKSAXParser.cpp:118
libebook::EBOOKSAXParser::startElement
virtual void startElement(int id)=0
ebookXMLCloseStream
int ebookXMLCloseStream(void *)
Definition: libebook_xml.cpp:43
libebook::EBOOKHTMLToken::input
@ input
Definition: EBOOKHTMLToken.h:89
parser
HUBBUBParserPtr_t parser
Definition: EBOOKHTMLParser.cpp:170
libebook::EBOOKSAXParser::startElementByName
virtual void startElementByName(const char *name, const char *ns)=0
name
string name
Definition: HTMLHelpStream.cpp:80
libebook::ParseError
Definition: libebook_utils.h:120
libebook::EBOOKSAXParser::attribute
virtual void attribute(int id, const char *value)=0
libebook::EBOOKSAXParser::~EBOOKSAXParser
virtual ~EBOOKSAXParser()=0
Definition: EBOOKSAXParser.cpp:114
libebook_xml.h
libebook::EBOOKSAXParser::operator=
EBOOKSAXParser & operator=(const EBOOKSAXParser &other)
libebook::EBOOKSAXParser::m_input
const RVNGInputStreamPtr_t m_input
Definition: EBOOKSAXParser.h:61
libebook::EBOOKSAXParser::endElement
virtual void endElement(int id)=0