LibreOffice Module shell (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
xml_parser Class Reference

#include <xml_parser.hxx>

Collaboration diagram for xml_parser:
[legend]

Public Member Functions

 xml_parser ()
 
 ~xml_parser ()
 
void parse (const char *XmlData, size_t Length, bool IsFinal)
 Parse a XML data stream. More...
 
void set_document_handler (i_xml_parser_event_handler *event_handler)
 Set a document handler. More...
 
i_xml_parser_event_handlerget_document_handler () const
 Returns the currently used document handler or null if no document handler was set before. More...
 

Private Member Functions

void init ()
 
 xml_parser (const xml_parser &)=delete
 
xml_parseroperator= (const xml_parser &)=delete
 

Private Attributes

i_xml_parser_event_handlerdocument_handler_
 
XML_Parser xml_parser_
 

Detailed Description

Definition at line 40 of file xml_parser.hxx.

Constructor & Destructor Documentation

◆ xml_parser() [1/2]

xml_parser::xml_parser ( )

Definition at line 72 of file xml_parser.cxx.

References init().

◆ ~xml_parser()

xml_parser::~xml_parser ( )

Definition at line 79 of file xml_parser.cxx.

References xml_parser_.

◆ xml_parser() [2/2]

xml_parser::xml_parser ( const xml_parser )
privatedelete

Member Function Documentation

◆ get_document_handler()

i_xml_parser_event_handler * xml_parser::get_document_handler ( ) const
inline

Returns the currently used document handler or null if no document handler was set before.

Definition at line 88 of file xml_parser.hxx.

References document_handler_.

Referenced by xml_character_data_handler(), xml_comment_handler(), xml_end_element_handler(), and xml_start_element_handler().

◆ init()

void xml_parser::init ( )
private

◆ operator=()

xml_parser & xml_parser::operator= ( const xml_parser )
privatedelete

◆ parse()

void xml_parser::parse ( const char *  XmlData,
size_t  Length,
bool  IsFinal 
)

Parse a XML data stream.

Parameters
pXmlDataPointer to a buffer containing the xml data
LengthLength of the buffer containing the xml data
IsFinalIndicates whether these are the last xml data of an xml document to parse. For very large xml documents it may be useful to read and parse the document partially.

@precond XmlData must not be null

Exceptions
SaxExceptionIf the used Sax parser returns an error. The SaxException contains detailed information about the error.

Definition at line 175 of file xml_parser.cxx.

References xml_parser_.

◆ set_document_handler()

void xml_parser::set_document_handler ( i_xml_parser_event_handler event_handler)

Set a document handler.

@descr A document handler implements the interface i_xml_parser_event_handler. The document handler receive notifications of various events from the sax parser for instance "start_document".

The client is responsible for the life time management of the given document handler, that means the document handler instance must exist until a new one was set or until the parser no longer exist.

Parameters
SaxDocumentHandlerThe new document handler, may be null if not interested in sax parser events.

@postcond currently used document handler == pSaxDocumentHandler

Definition at line 185 of file xml_parser.cxx.

References document_handler_.

Member Data Documentation

◆ document_handler_

i_xml_parser_event_handler* xml_parser::document_handler_
private

Definition at line 94 of file xml_parser.hxx.

Referenced by get_document_handler(), and set_document_handler().

◆ xml_parser_

XML_Parser xml_parser::xml_parser_
private

Definition at line 95 of file xml_parser.hxx.

Referenced by init(), parse(), and ~xml_parser().


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