From d3e763d65c44d1838eeebbc5a581bcdd18040d8e Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Sun, 2 Dec 2012 22:31:45 +0100 Subject: comphelper::string::ConstAsciiString support for fast operator+ Although an ever better option seems to be replace this overblown const char[] wannabe with the real const char[] thing. Change-Id: Ibdf5e498585d9e2fb589a49800f7ceee1545fc30 --- comphelper/inc/comphelper/string.hxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'comphelper/inc') diff --git a/comphelper/inc/comphelper/string.hxx b/comphelper/inc/comphelper/string.hxx index 170d50fdca85..693703d5ca3c 100644 --- a/comphelper/inc/comphelper/string.hxx +++ b/comphelper/inc/comphelper/string.hxx @@ -479,6 +479,22 @@ struct COMPHELPER_DLLPUBLIC ConstAsciiString } } +#ifdef RTL_FAST_STRING +// TODO The whole ConstAsciiString class should probably be dumped +// and replaced with plain 'const char[]'. +namespace rtl +{ +template<> +struct ToStringHelper< comphelper::string::ConstAsciiString > + { + static int length( const comphelper::string::ConstAsciiString& str ) { return str.length; } + static sal_Unicode* addData( sal_Unicode* buffer, const comphelper::string::ConstAsciiString& str ) { return addDataLiteral( buffer, str.ascii, str.length ); } + static const bool allowOStringConcat = false; + static const bool allowOUStringConcat = true; + }; +} +#endif + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit