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: */
name
string name
Definition HTMLHelpStream.cpp:80
value
qi::rule< Iterator, AttrValue_t, qi::space_type > value
Definition TealDocParser.cpp:231
libebook::EBOOKSAXParser
Base class for simple SAX-like XML parser.
Definition EBOOKSAXParser.h:31
libebook::EBOOKSAXParser::attribute
virtual void attribute(int id, const char *value)=0
libebook::EBOOKSAXParser::endElement
virtual void endElement(int id)=0
libebook::EBOOKSAXParser::startElementByName
virtual void startElementByName(const char *name, const char *ns)=0
libebook::EBOOKSAXParser::attributeByName
virtual void attributeByName(const char *name, const char *ns, const char *value)=0
libebook::EBOOKSAXParser::parse
void parse()
Definition EBOOKSAXParser.cpp:118
libebook::EBOOKSAXParser::endElementByName
virtual void endElementByName(const char *name, const char *ns)=0
libebook::EBOOKSAXParser::~EBOOKSAXParser
virtual ~EBOOKSAXParser()=0
Definition EBOOKSAXParser.cpp:114
libebook::EBOOKSAXParser::getId
virtual int getId(const char *name, const char *ns) const =0
Get id of the element/attribute.
libebook::EBOOKSAXParser::m_input
const RVNGInputStreamPtr_t m_input
Definition EBOOKSAXParser.h:61
libebook::EBOOKSAXParser::text
virtual void text(const char *value)=0
libebook::EBOOKSAXParser::EBOOKSAXParser
EBOOKSAXParser(const EBOOKSAXParser &other)
libebook::EBOOKSAXParser::operator=
EBOOKSAXParser & operator=(const EBOOKSAXParser &other)
libebook::EBOOKSAXParser::startElement
virtual void startElement(int id)=0
libebook_utils.h
libebook
Definition BBeBCollector.cpp:19
libebook::RVNGInputStreamPtr_t
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr_t
Definition libebook_utils.h:54