ClanLib  2.3.7
core_iostream.h
Go to the documentation of this file.
1 /*
2 ** ClanLib SDK
3 ** Copyright (c) 1997-2011 The ClanLib Team
4 **
5 ** This software is provided 'as-is', without any express or implied
6 ** warranty. In no event will the authors be held liable for any damages
7 ** arising from the use of this software.
8 **
9 ** Permission is granted to anyone to use this software for any purpose,
10 ** including commercial applications, and to alter it and redistribute it
11 ** freely, subject to the following restrictions:
12 **
13 ** 1. The origin of this software must not be misrepresented; you must not
14 ** claim that you wrote the original software. If you use this software
15 ** in a product, an acknowledgment in the product documentation would be
16 ** appreciated but is not required.
17 ** 2. Altered source versions must be plainly marked as such, and must not be
18 ** misrepresented as being the original software.
19 ** 3. This notice may not be removed or altered from any source distribution.
20 **
21 ** Note: Some of the libraries ClanLib may link to may have additional
22 ** requirements or restrictions.
23 **
24 ** File Author(s):
25 **
26 ** Ingo Ruhnke
27 */
28 
29 #pragma once
30 
31 #include <iosfwd>
32 #include <iostream>
33 
34 class CL_Rect;
35 class CL_Rectf;
36 class CL_Rectd;
37 class CL_Point;
38 class CL_Pointf;
39 class CL_Pointd;
40 class CL_Size;
41 class CL_Sizef;
42 class CL_Sized;
43 
44 CL_API_CORE std::ostream& operator<<(std::ostream& s, const CL_Rect& rect);
45 CL_API_CORE std::ostream& operator<<(std::ostream& s, const CL_Rectf& rect);
46 CL_API_CORE std::ostream& operator<<(std::ostream& s, const CL_Rectd& rect);
47 CL_API_CORE std::ostream& operator<<(std::ostream& s, const CL_Point& point);
48 CL_API_CORE std::ostream& operator<<(std::ostream& s, const CL_Pointf& point);
49 CL_API_CORE std::ostream& operator<<(std::ostream& s, const CL_Pointd& point);
50 CL_API_CORE std::ostream& operator<<(std::ostream& s, const CL_Size& size);
51 CL_API_CORE std::ostream& operator<<(std::ostream& s, const CL_Sizef& size);
52 
53 template<typename T>
54 CL_API_CORE std::ostream& operator<<(std::ostream& s, const CL_Vec1<T>& vec)
55 {
56  s << vec.x;
57  return s;
58 }
59 
60 template<typename T>
61 CL_API_CORE std::ostream& operator<<(std::ostream& s, const CL_Vec2<T>& vec)
62 {
63  s << "["
64  << vec.x << ", "
65  << vec.y << "]";
66  return s;
67 }
68 
69 template<typename T>
70 CL_API_CORE std::ostream& operator<<(std::ostream& s, const CL_Vec3<T>& vec)
71 {
72  s << "["
73  << vec.x << ", "
74  << vec.y << ", "
75  << vec.z << "]";
76  return s;
77 }
78 
79 template<typename T>
80 CL_API_CORE std::ostream& operator<<(std::ostream& s, const CL_Vec4<T>& vec)
81 {
82  s << "["
83  << vec.x << ", "
84  << vec.y << ", "
85  << vec.z << ", "
86  << vec.w << "]";
87  return s;
88 }
89