22#include <com/sun/star/lang/IllegalArgumentException.hpp>
41class InputStreamCloseGuard
44 explicit InputStreamCloseGuard(
const Reference< XInputStream >& rxInStream,
bool bCloseStream );
45 ~InputStreamCloseGuard();
51InputStreamCloseGuard::InputStreamCloseGuard(
const Reference< XInputStream >& rxInStream,
bool bCloseStream ) :
57InputStreamCloseGuard::~InputStreamCloseGuard()
64FastParser::FastParser() :
89 throw IllegalArgumentException();
91 mxParser->registerNamespace( *pNamespaceUrl, nNamespaceId );
95 if(pNamespaceStrictUrl && (*pNamespaceUrl != *pNamespaceStrictUrl))
97 mxParser->registerNamespace( *pNamespaceStrictUrl, nNamespaceId );
105 mxParser->setFastDocumentHandler( rxDocHandler );
112 mxParser->setFastDocumentHandler(
nullptr);
118 InputStreamCloseGuard aGuard( rInputSource.aInputStream, bCloseStream );
121 mxParser->parseStream( rInputSource );
126 InputSource aInputSource;
127 aInputSource.sSystemId = rStreamName;
128 aInputSource.aInputStream = rxInStream;
static const MapType::mapped_type * getMapElement(const MapType &rMap, const typename MapType::key_type &rKey)
Returns the pointer to an existing element of the passed map, or a null pointer, if an element with t...
Base class for storage access implementations.
css::uno::Reference< css::io::XInputStream > openInputStream(const OUString &rStreamName)
Opens and returns the specified input stream from the storage.
void parseStream(const css::xml::sax::InputSource &rInputSource, bool bCloseStream=false)
Parses the passed SAX input source.
void clearDocumentHandler()
void registerNamespace(sal_Int32 nNamespaceId)
Registers an OOXML namespace at the parser.
void setDocumentHandler(const css::uno::Reference< css::xml::sax::XFastDocumentHandler > &rxDocHandler)
Sets the passed document handler that will receive the SAX parser events.
const NamespaceMap & mrNamespaceMap
css::uno::Reference< css::xml::sax::XFastTokenHandler > mxTokenHandler
rtl::Reference< sax_fastparser::FastSaxParser > mxParser
Wrapper implementing the com.sun.star.xml.sax.XFastTokenHandler API interface that provides access to...
Reference< XInputStream > mxInStream
NamespaceMap & StaticNamespaceMap()
Thread-safe singleton of a map of all supported XML namespace URLs.
std::map< sal_Int32, OUString > maStrictNamespaceMap
std::map< sal_Int32, OUString > maTransitionalNamespaceMap