diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-12-02 22:31:45 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-12-03 18:04:23 +0100 |
commit | d3e763d65c44d1838eeebbc5a581bcdd18040d8e (patch) | |
tree | 3a837cf6bc333b08d517aaaebeeebeb374bacc4d /comphelper/inc | |
parent | d87f5d30879aca73fff271c254589fc41a91fdd0 (diff) |
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
Diffstat (limited to 'comphelper/inc')
-rw-r--r-- | comphelper/inc/comphelper/string.hxx | 16 |
1 files changed, 16 insertions, 0 deletions
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: */ |