20#ifndef INCLUDED_SAX_SOURCE_TOOLS_FASTSERIALIZER_HXX
21#define INCLUDED_SAX_SOURCE_TOOLS_FASTSERIALIZER_HXX
23#include <com/sun/star/xml/sax/XFastTokenHandler.hpp>
24#include <com/sun/star/io/XOutputStream.hpp>
52 explicit FastSaxSerializer(
const css::uno::Reference< css::io::XOutputStream >& xOutputStream);
55 css::uno::Reference< css::io::XOutputStream >
const &
getOutputStream()
const;
111 void writeId( ::sal_Int32 Element );
112 OString
getId( ::sal_Int32 Element );
114 void write(
double value );
115 void write( std::u16string_view s,
bool bEscape =
false );
116 void write( std::string_view s,
bool bEscape =
false );
117 void write(
const char* pStr, sal_Int32 nLen,
bool bEscape =
false );
187#if OSL_DEBUG_LEVEL > 0
188 virtual void print();
192 virtual void append(
const css::uno::Sequence<sal_Int8> &rWhat )
override;
202 std::map< ::sal_Int32, Int8Sequence >
maData;
218#if OSL_DEBUG_LEVEL > 0
219 virtual void print()
override;
223 virtual void append(
const css::uno::Sequence<sal_Int8> &rWhat )
override;
249 void writeBytes(
const css::uno::Sequence< ::sal_Int8 >& aData );
250 void writeBytes(
const char* pStr,
size_t nLen );
virtual Int8Sequence & getData() override
virtual void prepend(const Int8Sequence &rWhat) override
void setCurrentElement(::sal_Int32 nToken) override
sal_Int32 mnCurrentElement
virtual void append(const css::uno::Sequence< sal_Int8 > &rWhat) override
std::map< ::sal_Int32, Int8Sequence > maData
ForSort(sal_Int32 const nTag, const Int32Sequence &rOrder)
virtual void print() override
Receives notification of sax document events to write into an XOutputStream.
std::stack< std::shared_ptr< ForMerge > > maMarkStack
OString getId(::sal_Int32 Element)
std::stack< sal_Int32 > m_DebugStartedElements
void endDocument()
called by the parser after the last XML element of a stream is processed.
void setAllowXEscape(bool bSet)
void writeFastAttributeList(FastAttributeList const &rAttrList)
void writeTokenValueList()
void startFastElement(::sal_Int32 Element, FastAttributeList const *pAttrList=nullptr)
receives notification of the beginning of an element.
void mergeTopMarks(sal_Int32 nTag, sax_fastparser::MergeMarks eMergeType)
Merge 2 topmost marks.
FastSaxSerializer(const css::uno::Reference< css::io::XOutputStream > &xOutputStream)
void singleFastElement(::sal_Int32 Element, FastAttributeList const *pAttrList=nullptr)
receives notification of the beginning of a single element.
css::uno::Sequence< ::sal_Int8 > Int8Sequence
void endFastElement(::sal_Int32 Element)
receives notification of the end of a known element.
CachedOutputStream maCachedOutputStream
Helper class to cache data and write in chunks to XOutputStream or ForMerge::append.
css::uno::Reference< css::xml::sax::XFastTokenHandler > mxFastTokenHandler
TokenValueList maTokenValues
bool mbXescape
whether to escape invalid XML characters as xHHHH in write(const char*,sal_Int32,true)
TokenValueList & getTokenValueList()
called by FSHelper to put data in for writeTokenValueList
css::uno::Sequence< ::sal_Int32 > Int32Sequence
css::uno::Reference< css::io::XOutputStream > const & getOutputStream() const
void writeBytes(const css::uno::Sequence< ::sal_Int8 > &aData)
Forward the call to the output stream, or write to the stack.
void writeId(::sal_Int32 Element)
void mark(sal_Int32 nTag, const Int32Sequence &rOrder)
From now on, don't write directly to the stream, but to top of a stack.
void startDocument()
called by the parser when parsing of an XML stream is started.
sal_Int32 mnDoubleStrCapacity
std::vector< TokenValue > TokenValueList
TokenValue(sal_Int32 _nToken, const char *_pValue)