LibreOffice Module oox (master) 1
Public Member Functions | Private Attributes | List of all members
oox::core::FastParser Class Reference

Wrapper for a fast SAX parser that works on automatically generated OOXML token and namespace identifiers. More...

#include <fastparser.hxx>

Collaboration diagram for oox::core::FastParser:
[legend]

Public Member Functions

 FastParser ()
 
 FastParser (const FastParser &)=delete
 
FastParseroperator= (const FastParser &)=delete
 
 ~FastParser ()
 
void registerNamespace (sal_Int32 nNamespaceId)
 Registers an OOXML namespace at the parser. More...
 
void setDocumentHandler (const css::uno::Reference< css::xml::sax::XFastDocumentHandler > &rxDocHandler)
 Sets the passed document handler that will receive the SAX parser events. More...
 
void clearDocumentHandler ()
 
void parseStream (const css::xml::sax::InputSource &rInputSource, bool bCloseStream=false)
 Parses the passed SAX input source. More...
 
void parseStream (const css::uno::Reference< css::io::XInputStream > &rxInStream, const OUString &rStreamName)
 Parses the passed input stream. More...
 
void parseStream (StorageBase &rStorage, const OUString &rStreamName)
 Parses a stream from the passed storage with the specified name. More...
 
const css::uno::Reference< css::xml::sax::XFastTokenHandler > & getTokenHandler () const
 

Private Attributes

css::uno::Reference< css::xml::sax::XFastTokenHandler > mxTokenHandler
 
const NamespaceMapmrNamespaceMap
 
rtl::Reference< sax_fastparser::FastSaxParsermxParser
 

Detailed Description

Wrapper for a fast SAX parser that works on automatically generated OOXML token and namespace identifiers.

Definition at line 53 of file fastparser.hxx.

Constructor & Destructor Documentation

◆ FastParser() [1/2]

oox::core::FastParser::FastParser ( )
explicit
Exceptions
css::uno::RuntimeException

Definition at line 64 of file fastparser.cxx.

References mxParser, and mxTokenHandler.

◆ FastParser() [2/2]

oox::core::FastParser::FastParser ( const FastParser )
delete

◆ ~FastParser()

oox::core::FastParser::~FastParser ( )

Definition at line 77 of file fastparser.cxx.

Member Function Documentation

◆ clearDocumentHandler()

void oox::core::FastParser::clearDocumentHandler ( )

Definition at line 108 of file fastparser.cxx.

References mxParser.

◆ getTokenHandler()

const css::uno::Reference< css::xml::sax::XFastTokenHandler > & oox::core::FastParser::getTokenHandler ( ) const
inline

Definition at line 105 of file fastparser.hxx.

◆ operator=()

FastParser & oox::core::FastParser::operator= ( const FastParser )
delete

◆ parseStream() [1/3]

void oox::core::FastParser::parseStream ( const css::uno::Reference< css::io::XInputStream > &  rxInStream,
const OUString &  rStreamName 
)

Parses the passed input stream.

Parameters
bCloseStreamTrue = closes the passed stream after parsing.
Exceptions
css::xml::sax::SAXException
css::io::IOException
css::uno::RuntimeException

◆ parseStream() [2/3]

void oox::core::FastParser::parseStream ( const css::xml::sax::InputSource &  rInputSource,
bool  bCloseStream = false 
)

Parses the passed SAX input source.

Parameters
bCloseStreamTrue = closes the stream in the input source after parsing.
Exceptions
css::xml::sax::SAXException
css::io::IOException
css::uno::RuntimeException

Referenced by oox::core::XmlFilterBase::importFragment(), oox::docprop::DocumentPropertiesImport::importProperties(), and parseStream().

◆ parseStream() [3/3]

void oox::core::FastParser::parseStream ( StorageBase rStorage,
const OUString &  rStreamName 
)

Parses a stream from the passed storage with the specified name.

Parameters
bCloseStreamTrue = closes the stream after parsing.
Exceptions
css::xml::sax::SAXException
css::io::IOException
css::uno::RuntimeException

Definition at line 132 of file fastparser.cxx.

References oox::StorageBase::openInputStream(), and parseStream().

◆ registerNamespace()

void oox::core::FastParser::registerNamespace ( sal_Int32  nNamespaceId)

Registers an OOXML namespace at the parser.

Exceptions
css::lang::IllegalArgumentException
css::uno::RuntimeException

Definition at line 81 of file fastparser.cxx.

References oox::ContainerHelper::getMapElement(), oox::NamespaceMap::maStrictNamespaceMap, oox::NamespaceMap::maTransitionalNamespaceMap, mrNamespaceMap, and mxParser.

Referenced by oox::docprop::DocumentPropertiesImport::importProperties().

◆ setDocumentHandler()

void oox::core::FastParser::setDocumentHandler ( const css::uno::Reference< css::xml::sax::XFastDocumentHandler > &  rxDocHandler)

Sets the passed document handler that will receive the SAX parser events.

Exceptions
css::uno::RuntimeException

Definition at line 101 of file fastparser.cxx.

References mxParser.

Referenced by oox::core::XmlFilterBase::importFragment(), and oox::docprop::DocumentPropertiesImport::importProperties().

Member Data Documentation

◆ mrNamespaceMap

const NamespaceMap& oox::core::FastParser::mrNamespaceMap
private

Definition at line 109 of file fastparser.hxx.

Referenced by registerNamespace().

◆ mxParser

rtl::Reference<sax_fastparser::FastSaxParser> oox::core::FastParser::mxParser
private

◆ mxTokenHandler

css::uno::Reference<css::xml::sax::XFastTokenHandler> oox::core::FastParser::mxTokenHandler
private

Definition at line 108 of file fastparser.hxx.

Referenced by FastParser().


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