diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-05-17 14:00:15 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-05-17 14:03:26 +0100 |
commit | 5dcf536b69848b56f1199b81e4b7ed87a0a3864d (patch) | |
tree | 86f28d6db1963680549b6111ca99f95ca580f763 /comphelper | |
parent | acd9cda35457f0a839bf9713c261022c39cd8269 (diff) |
merge the 5 ConstAsciiString duplicate classes together
a) merge them together and move it into comphelper
b) turn it into a POD rather than having vast amounts
of destructors registered into the cxa_atexit chain
Change-Id: I04d3b9d7804f8e233013c916df9d617a0f84f96a
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/inc/comphelper/string.hxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/comphelper/inc/comphelper/string.hxx b/comphelper/inc/comphelper/string.hxx index a64bad2cf4e8..dc3620d67307 100644 --- a/comphelper/inc/comphelper/string.hxx +++ b/comphelper/inc/comphelper/string.hxx @@ -439,6 +439,20 @@ COMPHELPER_DLLPUBLIC inline bool isalnumAscii(sal_Unicode c) return isalphaAscii(c) || isdigitAscii(c); } +//============================================================ +//= a helper for static ascii pseudo-unicode strings +//============================================================ +struct COMPHELPER_DLLPUBLIC ConstAsciiString +{ + const sal_Char* ascii; + sal_Int32 length; + + operator rtl::OUString() const + { + return rtl::OUString(ascii, length, RTL_TEXTENCODING_ASCII_US); + } +}; + } } #endif |