summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2012-03-28 22:24:48 +0200
committerLuboš Luňák <l.lunak@suse.cz>2012-03-28 23:00:54 +0200
commit60573363d87bb1335ff8ac0c0623f0ec3e0dc319 (patch)
treecb57d1038568fc606bf6a508478292a3dd52208e /sal
parent8594c4c52a38f34d1ccb4541dae2e29f08546151 (diff)
clean up string literal overloads in OUStringBuffer
Diffstat (limited to 'sal')
-rw-r--r--sal/inc/rtl/ustrbuf.hxx19
1 files changed, 4 insertions, 15 deletions
diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index 15bbe67ad04b..a89d87716fe5 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -52,10 +52,6 @@ namespace rtl
#ifdef RTL_STRING_UNITTEST
#undef rtl
-// helper macro to make functions appear more readable
-#define RTL_STRING_CONST_FUNCTION rtl_string_unittest_const_literal_function = true;
-#else
-#define RTL_STRING_CONST_FUNCTION
#endif
/** A string buffer implements a mutable sequence of characters.
@@ -428,21 +424,15 @@ public:
This function accepts an ASCII string literal as its argument.
@since LibreOffice 3.6
*/
- template< int N >
- OUStringBuffer& append( const char (&literal)[ N ] )
+ template< typename T >
+ typename internal::ConstCharArrayDetector< T, OUStringBuffer& >::Type append( T& literal )
{
- rtl_uStringbuffer_insert_ascii( &pData, &nCapacity, getLength(), literal, N - 1 );
+ rtl_uStringbuffer_insert_ascii( &pData, &nCapacity, getLength(), literal,
+ internal::ConstCharArrayDetector< T, void >::size - 1 );
return *this;
}
/**
- It is an error to call this overload. Strings cannot directly use non-const char[].
- @internal
- */
- template< int N >
- OUStringBuffer& append( char (&literal)[ N ] );
-
- /**
Appends the string representation of the <code>sal_Bool</code>
argument to the string buffer.
@@ -889,7 +879,6 @@ namespace rtl
{
typedef rtlunittest::OUStringBuffer OUStringBuffer;
}
-#undef RTL_STRING_CONST_FUNCTION
#endif
#endif /* _RTL_USTRBUF_HXX_ */