LibreOffice Module xmlsecurity (master) 1
Public Member Functions | Private Attributes | List of all members
SAXHelper Class Referencefinal

This class represents a SAX handler which simply forwards to the corresponding libxml API and translates parameter if necessary. More...

#include <saxhelper.hxx>

Public Member Functions

 SAXHelper ()
 Constructor. More...
 
 ~SAXHelper ()
 Destructor. More...
 
xmlNodePtr getCurrentNode ()
 
void setCurrentNode (const xmlNodePtr pNode)
 
xmlDocPtr getDocument ()
 
void startDocument ()
 XDocumentHandler – start an xml document. More...
 
void endDocument ()
 XDocumentHandler – end an xml document. More...
 
void startElement (std::u16string_view aName, const css::uno::Sequence< css::xml::csax::XMLAttribute > &aAttributes)
 XDocumentHandler – start an xml element. More...
 
void endElement (std::u16string_view aName)
 XDocumentHandler – end an xml element. More...
 
void characters (std::u16string_view aChars)
 XDocumentHandler – an xml element or cdata characters. More...
 
void ignorableWhitespace (std::u16string_view aWhitespaces)
 XDocumentHandler – ignorable xml white space. More...
 
void processingInstruction (std::u16string_view aTarget, std::u16string_view aData)
 XDocumentHandler – preprocessing instruction. More...
 

Private Attributes

xmlParserCtxtPtr m_pParserCtxt
 
xmlSAXHandlerPtr m_pSaxHandler
 

Detailed Description

This class represents a SAX handler which simply forwards to the corresponding libxml API and translates parameter if necessary.

Definition at line 36 of file saxhelper.hxx.

Constructor & Destructor Documentation

◆ SAXHelper()

SAXHelper::SAXHelper ( )

Constructor.

In this constructor, a libxml sax parser context is initialized. a libxml default sax handler is initialized with the context.

Definition at line 110 of file saxhelper.cxx.

References m_pParserCtxt, and m_pSaxHandler.

◆ ~SAXHelper()

SAXHelper::~SAXHelper ( )

Destructor.

In this destructor, a libxml sax parser context is destructed. The XML tree in the context is not deallocated because the tree is bind with a document model by the setTargetDocument method, which delegate the target document to destruct the xml tree.

Definition at line 173 of file saxhelper.cxx.

References m_pParserCtxt, and m_pSaxHandler.

Member Function Documentation

◆ characters()

void SAXHelper::characters ( std::u16string_view  aChars)

XDocumentHandler – an xml element or cdata characters.

Exceptions
css::xml::sax::SAXException
css::uno::RuntimeException

Definition at line 305 of file saxhelper.cxx.

References length, m_pParserCtxt, m_pSaxHandler, and ous_to_nxmlstr().

Referenced by XMLDocumentWrapper_XmlSecImpl::characters().

◆ endDocument()

void SAXHelper::endDocument ( )

XDocumentHandler – end an xml document.

Exceptions
css::xml::sax::SAXException
css::uno::RuntimeException

Definition at line 245 of file saxhelper.cxx.

References m_pParserCtxt, and m_pSaxHandler.

Referenced by XMLDocumentWrapper_XmlSecImpl::~XMLDocumentWrapper_XmlSecImpl().

◆ endElement()

void SAXHelper::endElement ( std::u16string_view  aName)

XDocumentHandler – end an xml element.

Exceptions
css::xml::sax::SAXException
css::uno::RuntimeException

Definition at line 290 of file saxhelper.cxx.

References aName, m_pParserCtxt, m_pSaxHandler, and ous_to_xmlstr().

Referenced by XMLDocumentWrapper_XmlSecImpl::endElement(), and XMLDocumentWrapper_XmlSecImpl::removeCurrentElement().

◆ getCurrentNode()

xmlNodePtr SAXHelper::getCurrentNode ( )
inline

◆ getDocument()

xmlDocPtr SAXHelper::getDocument ( )
inline

Definition at line 48 of file saxhelper.hxx.

References m_pParserCtxt.

Referenced by XMLDocumentWrapper_XmlSecImpl::XMLDocumentWrapper_XmlSecImpl().

◆ ignorableWhitespace()

void SAXHelper::ignorableWhitespace ( std::u16string_view  aWhitespaces)

XDocumentHandler – ignorable xml white space.

Exceptions
css::xml::sax::SAXException
css::uno::RuntimeException

Definition at line 322 of file saxhelper.cxx.

References length, m_pParserCtxt, m_pSaxHandler, and ous_to_nxmlstr().

Referenced by XMLDocumentWrapper_XmlSecImpl::ignorableWhitespace().

◆ processingInstruction()

void SAXHelper::processingInstruction ( std::u16string_view  aTarget,
std::u16string_view  aData 
)

XDocumentHandler – preprocessing instruction.

Exceptions
css::xml::sax::SAXException
css::uno::RuntimeException

Definition at line 339 of file saxhelper.cxx.

References aData, m_pParserCtxt, m_pSaxHandler, and ous_to_xmlstr().

Referenced by XMLDocumentWrapper_XmlSecImpl::processingInstruction().

◆ setCurrentNode()

void SAXHelper::setCurrentNode ( const xmlNodePtr  pNode)

Definition at line 200 of file saxhelper.cxx.

References m_pParserCtxt.

Referenced by XMLDocumentWrapper_XmlSecImpl::setCurrentElement().

◆ startDocument()

void SAXHelper::startDocument ( )

XDocumentHandler – start an xml document.

Exceptions
css::xml::sax::SAXException
css::uno::RuntimeException

Definition at line 217 of file saxhelper.cxx.

References m_pParserCtxt, and m_pSaxHandler.

Referenced by XMLDocumentWrapper_XmlSecImpl::XMLDocumentWrapper_XmlSecImpl().

◆ startElement()

void SAXHelper::startElement ( std::u16string_view  aName,
const css::uno::Sequence< css::xml::csax::XMLAttribute > &  aAttributes 
)

XDocumentHandler – start an xml element.

Exceptions
css::xml::sax::SAXException
css::uno::RuntimeException

Definition at line 253 of file saxhelper.cxx.

References aName, attrlist_to_nxmlstr(), i, m_pParserCtxt, m_pSaxHandler, and ous_to_xmlstr().

Referenced by XMLDocumentWrapper_XmlSecImpl::compressedStartElement(), and XMLDocumentWrapper_XmlSecImpl::XMLDocumentWrapper_XmlSecImpl().

Member Data Documentation

◆ m_pParserCtxt

xmlParserCtxtPtr SAXHelper::m_pParserCtxt
private

◆ m_pSaxHandler

xmlSAXHandlerPtr SAXHelper::m_pSaxHandler
private

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