summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
Diffstat (limited to 'sal')
-rw-r--r--sal/inc/rtl/string.hxx14
-rw-r--r--sal/qa/rtl/strings/test_strings_replace.cxx12
2 files changed, 14 insertions, 12 deletions
diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index a135d4ed400b..e45b837b7fe6 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -1479,6 +1479,20 @@ struct OStringHash
/* ======================================================================= */
+/**
+ Support for rtl::OString in std::ostream (and thus in
+ CPPUNIT_ASSERT or SAL_INFO macros, for example).
+
+ @since LibreOffice 3.7
+ */
+template< typename charT, typename traits > std::basic_ostream<charT, traits> &
+operator <<(
+ std::basic_ostream<charT, traits> & stream, rtl::OString const & string)
+{
+ return stream << string.getStr();
+ // best effort; potentially loses data due to embedded null characters
+}
+
} /* Namespace */
#ifdef RTL_USING
diff --git a/sal/qa/rtl/strings/test_strings_replace.cxx b/sal/qa/rtl/strings/test_strings_replace.cxx
index 5e1b0cfb9c74..a46245f3c0fa 100644
--- a/sal/qa/rtl/strings/test_strings_replace.cxx
+++ b/sal/qa/rtl/strings/test_strings_replace.cxx
@@ -37,18 +37,6 @@
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
-namespace rtl {
-
-template< typename charT, typename traits > std::basic_ostream<charT, traits> &
-operator <<(
- std::basic_ostream<charT, traits> & stream, rtl::OString const & string)
-{
- return stream << string.getStr();
- // best effort; potentially loses data due to embedded null characters
-}
-
-}
-
namespace {
class Test: public CppUnit::TestFixture {