summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-04-28 14:18:54 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-04-28 14:18:54 +0200
commitcc18a06a5abca3f336d2263fc8248368c08635e4 (patch)
treefa2c57f6a53d5f6696d86ca545c38bf38cd680fa
parentcd7cd5342248354ab322c3722c100d2cfb525bd8 (diff)
Printing of some more basegfx types
...as will be needed by some upcoming replacements of CPPUNIT_ASSERT with CPPUNIT_ASSERT_EQUAL Change-Id: I24ede3cc287bcc3b5e73eb400e4044c469657659
-rw-r--r--include/basegfx/color/bcolor.hxx13
-rw-r--r--include/basegfx/matrix/b2dhommatrix.hxx16
2 files changed, 29 insertions, 0 deletions
diff --git a/include/basegfx/color/bcolor.hxx b/include/basegfx/color/bcolor.hxx
index d0854e63a579..300f8db81e81 100644
--- a/include/basegfx/color/bcolor.hxx
+++ b/include/basegfx/color/bcolor.hxx
@@ -20,6 +20,10 @@
#ifndef INCLUDED_BASEGFX_COLOR_BCOLOR_HXX
#define INCLUDED_BASEGFX_COLOR_BCOLOR_HXX
+#include <sal/config.h>
+
+#include <ostream>
+
#include <basegfx/tuple/b3dtuple.hxx>
#include <vector>
#include <basegfx/basegfxdllapi.h>
@@ -173,6 +177,15 @@ namespace basegfx
}
};
+
+ template<typename charT, typename traits>
+ std::basic_ostream<charT, traits> & operator <<(
+ std::basic_ostream<charT, traits> & stream, BColor const & color)
+ {
+ return stream
+ << '[' << color.getRed() << ", " << color.getGreen() << ", "
+ << color.getBlue() << ']';
+ }
} // end of namespace basegfx
#endif // INCLUDED_BASEGFX_COLOR_BCOLOR_HXX
diff --git a/include/basegfx/matrix/b2dhommatrix.hxx b/include/basegfx/matrix/b2dhommatrix.hxx
index 524be07bcfae..a7ab0c3f5917 100644
--- a/include/basegfx/matrix/b2dhommatrix.hxx
+++ b/include/basegfx/matrix/b2dhommatrix.hxx
@@ -20,6 +20,10 @@
#ifndef INCLUDED_BASEGFX_MATRIX_B2DHOMMATRIX_HXX
#define INCLUDED_BASEGFX_MATRIX_B2DHOMMATRIX_HXX
+#include <sal/config.h>
+
+#include <ostream>
+
#include <sal/types.h>
#include <o3tl/cow_wrapper.hxx>
#include <basegfx/basegfxdllapi.h>
@@ -104,6 +108,18 @@ namespace basegfx
aMul *= rMatA;
return aMul;
}
+
+ template<typename charT, typename traits>
+ std::basic_ostream<charT, traits> & operator <<(
+ std::basic_ostream<charT, traits> & stream, B2DHomMatrix const & matrix)
+ {
+ return stream
+ << '[' << matrix.get(0, 0) << ' ' << matrix.get(0, 1) << ' '
+ << matrix.get(0, 2) << "; " << matrix.get(1, 0) << ' '
+ << matrix.get(1, 1) << ' ' << matrix.get(1, 2) << "; "
+ << matrix.get(2, 0) << ' ' << matrix.get(2, 1) << ' '
+ << matrix.get(2, 2) << ']';
+ }
} // end of namespace basegfx
#endif // INCLUDED_BASEGFX_MATRIX_B2DHOMMATRIX_HXX