summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-04-28 14:09:57 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-04-28 14:09:57 +0200
commit06c1dc4c09ba816affb8b65e8215bcd56a81df91 (patch)
tree914702f335213ba2db6f087673bc09741266dd59
parent04422d7f9f9f76708cd1f36fea5bd9cd50cf6083 (diff)
LIBO_INTERNAL_ONLY: printing of css::uno::Reference/Type
...as will be needed by some upcoming replacements of CPPUNIT_ASSERT with CPPUNIT_ASSERT_EQUAL Change-Id: Ie2b2b982b02f2bf48e2e8be7ba642198029c8698
-rw-r--r--include/com/sun/star/uno/Reference.hxx14
-rw-r--r--include/com/sun/star/uno/Type.hxx13
2 files changed, 27 insertions, 0 deletions
diff --git a/include/com/sun/star/uno/Reference.hxx b/include/com/sun/star/uno/Reference.hxx
index c4708f1956b9..f197007cb8ff 100644
--- a/include/com/sun/star/uno/Reference.hxx
+++ b/include/com/sun/star/uno/Reference.hxx
@@ -22,6 +22,7 @@
#include <sal/config.h>
#include <cstddef>
+#include <ostream>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/RuntimeException.hpp>
@@ -432,6 +433,19 @@ inline bool BaseReference::operator != ( const BaseReference & rRef ) const
return (! operator == ( rRef._pInterface ));
}
+#if defined LIBO_INTERNAL_ONLY
+/**
+ Support for BaseReference in std::ostream (and thus in CPPUNIT_ASSERT or
+ SAL_INFO macros, for example).
+
+ @since LibreOffice 5.4
+*/
+template<typename charT, typename traits> std::basic_ostream<charT, traits> &
+operator <<(
+ std::basic_ostream<charT, traits> & stream, BaseReference const & ref)
+{ return stream << ref.get(); }
+#endif
+
}
}
}
diff --git a/include/com/sun/star/uno/Type.hxx b/include/com/sun/star/uno/Type.hxx
index 36800ce7be78..4a7b86e72c05 100644
--- a/include/com/sun/star/uno/Type.hxx
+++ b/include/com/sun/star/uno/Type.hxx
@@ -22,6 +22,7 @@
#include <sal/config.h>
#include <cstddef>
+#include <ostream>
#include <com/sun/star/uno/Type.h>
#include <cppu/unotype.hxx>
@@ -92,6 +93,18 @@ inline Type & Type::operator = ( const Type & rType )
template< class T >
typelib_TypeDescriptionReference * Array< T >::s_pType = NULL;
+#if defined LIBO_INTERNAL_ONLY
+/**
+ Support for Type in std::ostream (and thus in CPPUNIT_ASSERT or SAL_INFO
+ macros, for example).
+
+ @since LibreOffice 5.4
+*/
+template<typename charT, typename traits> std::basic_ostream<charT, traits> &
+operator <<(std::basic_ostream<charT, traits> & stream, Type const & type)
+{ return stream << type.getTypeName(); }
+#endif
+
}
}
}