22#include <com/sun/star/xml/sax/SAXException.hpp>
52 pAttrib->Name = OStringToOUString(
maName, RTL_TEXTENCODING_UTF8 );
54 pAttrib->Value = OStringToOUString(
maValue, RTL_TEXTENCODING_UTF8 );
59: mpTokenHandler( pTokenHandler )
71 mpChunk =
static_cast<char *
>(malloc( rOther.mnChunkLength ));
73 memcpy(
mpChunk, rOther.mpChunk, rOther.mnChunkLength);
108 auto p =
static_cast<char*
>(realloc(
mpChunk, newLen));
110 throw std::bad_alloc();
127 sal_Int32 nCombinedToken = (nNamespaceToken << 16) |
nToken;
128 add( nCombinedToken, rValue );
132 std::u16string_view sValue)
134 sal_Int32 nCombinedToken = (nNamespaceToken << 16) |
nToken;
135 add(nCombinedToken, sValue);
180 throw SAXException(
"FastAttributeList::getValueToken: unknown token " + OUString::number(Token),
nullptr,
Any());
239 throw SAXException(
"FastAttributeList::getValue: unknown token " + OUString::number(Token),
nullptr,
Any());
255 Sequence< Attribute >
aSeq( nSize );
258 rAttr.FillAttribute( pAttr++ );
264 FastAttribute* pAttr =
aSeq.getArray();
284 std::string_view token )
Use for fast iteration and conversion of attributes.
virtual css::uno::Sequence< css::xml::Attribute > SAL_CALL getUnknownAttributes() override
FastAttributeList(FastTokenHandlerBase *pTokenHandler)
std::vector< sal_Int32 > maAttributeValues
FastAttributeIter find(sal_Int32 nToken) const
void add(const FastAttributeList &)
std::vector< UnknownAttribute > maUnknownAttributes
virtual ::sal_Int32 SAL_CALL getOptionalValueToken(::sal_Int32 Token, ::sal_Int32 Default) override
virtual ::css::uno::Reference< ::css::util::XCloneable > SAL_CALL createClone() override
OUString getValueByIndex(sal_Int32 nTokenIndex) const
std::string_view getAsViewByIndex(sal_Int32 nTokenIndex) const
bool getAsView(sal_Int32 nToken, std::string_view &rPos) const
char * mpChunk
buffer to store all attribute values - null terminated strings
bool getAsDouble(sal_Int32 nToken, double &rDouble) const
bool getAsInteger(sal_Int32 nToken, sal_Int32 &rInt) const
virtual ::sal_Int32 SAL_CALL getValueToken(::sal_Int32 Token) override
std::vector< sal_Int32 > maAttributeTokens
virtual ~FastAttributeList() override
virtual css::uno::Sequence< css::xml::FastAttribute > SAL_CALL getFastAttributes() override
FastAttributeIter end() const
sal_Int32 getAsIntegerByIndex(sal_Int32 nTokenIndex) const
virtual OUString SAL_CALL getOptionalValue(::sal_Int32 Token) override
sal_Int32 mnChunkLength
size of allocated memory for mpChunk
virtual OUString SAL_CALL getValue(::sal_Int32 Token) override
virtual sal_Bool SAL_CALL hasAttribute(::sal_Int32 Token) override
void addUnknown(const OUString &rNamespaceURL, const OString &rQName, const OString &value)
FastTokenHandlerBase * mpTokenHandler
void addNS(sal_Int32 nNamespaceToken, sal_Int32 nToken, std::string_view sValue)
A native C++ interface to tokenisation.
static sal_Int32 getTokenFromChars(const FastTokenHandlerBase *pTokenHandler, std::string_view str)
Client method to attempt the use of this interface if possible.
virtual sal_Int32 getTokenDirect(const char *pToken, sal_Int32 nLength) const =0
virtual ~FastTokenHandlerBase()
Sequence< sal_Int8 > aSeq
double toDouble(std::u16string_view str)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
void FillAttribute(css::xml::Attribute *pAttrib) const
UnknownAttribute(OUString sNamespaceURL, OString aName, OString value)