summaryrefslogtreecommitdiff
path: root/xmlreader
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-02-19 15:36:44 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-02-19 15:42:16 +0000
commit826cb27cc80ae843927d68e0337ad2caffa9f023 (patch)
treec46f7045d9ad571b4f557e91533a2a62704ec91b /xmlreader
parent138e5a051805ca8a3b7e9626742cc475e3577cc4 (diff)
reuse the ConstCharArrayDetector in Span
Change-Id: I33bc390aaa8f6e3cc2505632670970038140eb3c
Diffstat (limited to 'xmlreader')
-rw-r--r--xmlreader/inc/xmlreader/span.hxx16
1 files changed, 15 insertions, 1 deletions
diff --git a/xmlreader/inc/xmlreader/span.hxx b/xmlreader/inc/xmlreader/span.hxx
index 58266e9262d7..f7cd157b0348 100644
--- a/xmlreader/inc/xmlreader/span.hxx
+++ b/xmlreader/inc/xmlreader/span.hxx
@@ -22,7 +22,8 @@
#include "sal/config.h"
-#include "rtl/string.h"
+#include "rtl/string.hxx"
+#include "rtl/stringutils.hxx"
#include "sal/types.h"
#include "xmlreader/detail/xmlreaderdllapi.hxx"
@@ -58,6 +59,19 @@ struct OOO_DLLPUBLIC_XMLREADER Span {
begin, length, text.getStr(), text.getLength()) == 0;
}
+#ifdef RTL_FAST_STRING
+ /**
+ @overload
+ This function accepts an ASCII string literal as its argument.
+ */
+ template< typename T > bool
+ equals( T& literal, typename rtl::internal::ConstCharArrayDetector< T, rtl::internal::Dummy >::Type = rtl::internal::Dummy() ) SAL_THROW(())
+ {
+ assert( strlen( literal ) == rtl::internal::ConstCharArrayDetector< T >::size - 1 );
+ return rtl_str_compare_WithLength( begin, length, literal, rtl::internal::ConstCharArrayDetector< T, void >::size - 1 );
+ }
+#endif
+
rtl::OUString convertFromUtf8() const;
};