summaryrefslogtreecommitdiff
path: root/sal/inc/rtl/stringutils.hxx
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2012-12-07 18:13:31 +0100
committerLuboš Luňák <l.lunak@suse.cz>2012-12-07 19:48:16 +0100
commit49a9d370e6598284c0a337d0f4f7ec329187de53 (patch)
tree4bc861c85a942bb41f62838744c4218da9288992 /sal/inc/rtl/stringutils.hxx
parent1aad4689babec28f47b99666b303ab8bfffc3106 (diff)
add rtl::OUStringBuffer::append(bool)
The same as 563fa900ba22bf83dfa58e67807ed0337f810576 , but this time with extra care to not break anything with pointer->bool conversions. Change-Id: Ifcea840e96da0fbfcf92b54141fb8ef9c5eb94ff
Diffstat (limited to 'sal/inc/rtl/stringutils.hxx')
-rw-r--r--sal/inc/rtl/stringutils.hxx23
1 files changed, 22 insertions, 1 deletions
diff --git a/sal/inc/rtl/stringutils.hxx b/sal/inc/rtl/stringutils.hxx
index e8909327ac2c..c972d83ba3f5 100644
--- a/sal/inc/rtl/stringutils.hxx
+++ b/sal/inc/rtl/stringutils.hxx
@@ -88,19 +88,22 @@ So char[] and const char[] should always be used with their contents specified (
turns them into char[N] or const char[N]), or char* and const char* should be used.
*/
struct Dummy {};
-template< typename T1, typename T2 >
+template< typename T1, typename T2 = void >
struct CharPtrDetector
{
+ static const bool ok = false;
};
template< typename T >
struct CharPtrDetector< const char*, T >
{
typedef T Type;
+ static const bool ok = true;
};
template< typename T >
struct CharPtrDetector< char*, T >
{
typedef T Type;
+ static const bool ok = true;
};
template< typename T1, typename T2 >
@@ -167,6 +170,24 @@ struct ExceptCharArrayDetector< const char[ N ] >
{
};
+template< typename T1, typename T2 = void >
+struct SalUnicodePtrDetector
+{
+ static const bool ok = false;
+};
+template< typename T >
+struct SalUnicodePtrDetector< const sal_Unicode*, T >
+{
+ typedef T Type;
+ static const bool ok = true;
+};
+template< typename T >
+struct SalUnicodePtrDetector< sal_Unicode*, T >
+{
+ typedef T Type;
+ static const bool ok = true;
+};
+
// SFINAE helper class
template< typename T, bool >
struct Enable