libebook::EBOOKSAXParser Class Referenceabstract

Base class for simple SAX-like XML parser. More...

#include <EBOOKSAXParser.h>

Public Member Functions

 EBOOKSAXParser (const RVNGInputStreamPtr_t &input)
 
virtual ~EBOOKSAXParser ()=0
 
void parse ()
 
virtual int getId (const char *name, const char *ns) const =0
 Get id of the element/attribute.
 
virtual void startElement (int id)=0
 
virtual void endElement (int id)=0
 
virtual void attribute (int id, const char *value)=0
 
virtual void startElementByName (const char *name, const char *ns)=0
 
virtual void endElementByName (const char *name, const char *ns)=0
 
virtual void attributeByName (const char *name, const char *ns, const char *value)=0
 
virtual void text (const char *value)=0
 

Private Member Functions

 EBOOKSAXParser (const EBOOKSAXParser &other)
 
EBOOKSAXParseroperator= (const EBOOKSAXParser &other)
 

Private Attributes

const RVNGInputStreamPtr_t m_input
 

Detailed Description

Base class for simple SAX-like XML parser.

There are two interfaces a derived class can use: the first one expects that the derived class uses a tokenizer and therefore passes token IDs to the callbacks (this is preferred). The other one uses strings (which can of course be used in combination with token IDs, if the XML format does allow foreign elements or attributes).

Calls of startElement / endElement (or startElementByName / endElementByName) are always paired. That means that endElement (or endElementByName) is emitted even for empty elements.

Constructor & Destructor Documentation

◆ EBOOKSAXParser() [1/2]

libebook::EBOOKSAXParser::EBOOKSAXParser ( const EBOOKSAXParser other)
private

◆ EBOOKSAXParser() [2/2]

libebook::EBOOKSAXParser::EBOOKSAXParser ( const RVNGInputStreamPtr_t input)
explicit

◆ ~EBOOKSAXParser()

libebook::EBOOKSAXParser::~EBOOKSAXParser ( )
pure virtual

Member Function Documentation

◆ attribute()

virtual void libebook::EBOOKSAXParser::attribute ( int  id,
const char *  value 
)
pure virtual

◆ attributeByName()

virtual void libebook::EBOOKSAXParser::attributeByName ( const char *  name,
const char *  ns,
const char *  value 
)
pure virtual

◆ endElement()

virtual void libebook::EBOOKSAXParser::endElement ( int  id)
pure virtual

◆ endElementByName()

virtual void libebook::EBOOKSAXParser::endElementByName ( const char *  name,
const char *  ns 
)
pure virtual

◆ getId()

virtual int libebook::EBOOKSAXParser::getId ( const char *  name,
const char *  ns 
) const
pure virtual

Get id of the element/attribute.

The value is based on the tokenizer the derived class uses.

Returns
the id.

◆ operator=()

EBOOKSAXParser & libebook::EBOOKSAXParser::operator= ( const EBOOKSAXParser other)
private

◆ parse()

void libebook::EBOOKSAXParser::parse ( )

◆ startElement()

virtual void libebook::EBOOKSAXParser::startElement ( int  id)
pure virtual

◆ startElementByName()

virtual void libebook::EBOOKSAXParser::startElementByName ( const char *  name,
const char *  ns 
)
pure virtual

◆ text()

virtual void libebook::EBOOKSAXParser::text ( const char *  value)
pure virtual

Member Data Documentation

◆ m_input

const RVNGInputStreamPtr_t libebook::EBOOKSAXParser::m_input
private

Referenced by EBOOKSAXParser(), and parse().


The documentation for this class was generated from the following files:

Generated for libe-book by doxygen 1.9.8