diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2013-11-19 20:51:35 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2013-11-19 20:52:50 +0000 |
commit | fc25afaa048033940d9e1d22ec8ba31c5b3e9289 (patch) | |
tree | e5368871ba27a66cad29b50f064a819087af60d5 /include | |
parent | 7e77efe8b8f04ba739f731e5a27b5e643fe652fa (diff) |
fastparser: accelerate value tokenisation as well.
Change-Id: I99a39e91c684adb1fc92cdb466477cfa90104961
Diffstat (limited to 'include')
-rw-r--r-- | include/sax/fastattribs.hxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/sax/fastattribs.hxx b/include/sax/fastattribs.hxx index f4a939293cac..c7806039eed4 100644 --- a/include/sax/fastattribs.hxx +++ b/include/sax/fastattribs.hxx @@ -49,6 +49,18 @@ struct UnknownAttribute typedef std::vector< UnknownAttribute > UnknownAttributeList; +/// avoid constantly allocating and freeing sequences. +class SAX_DLLPUBLIC FastTokenLookup +{ + static const int mnUtf8BufferSize = 128; + ::css::uno::Sequence< sal_Int8 > maUtf8Buffer; +public: + FastTokenLookup(); + sal_Int32 getTokenFromChars( + const ::css::uno::Reference< ::css::xml::sax::XFastTokenHandler > &mxTokenHandler, + const char *pStr, size_t nLength = 0 ); +}; + class SAX_DLLPUBLIC FastAttributeList : public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XFastAttributeList > { public: @@ -83,6 +95,7 @@ private: std::vector< sal_Int32 > maAttributeTokens; UnknownAttributeList maUnknownAttributes; ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastTokenHandler > mxTokenHandler; + FastTokenLookup maTokenLookup; }; } |