core_iostream.h
1 /*
2 ** ClanLib SDK
3 ** Copyright (c) 1997-2015 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 namespace clan
35 {
36 
37 class Rect;
38 class Rectf;
39 class Rectd;
40 class Point;
41 class Pointf;
42 class Pointd;
43 class Size;
44 class Sizef;
45 class Sized;
46 
47 std::ostream& operator<<(std::ostream& s, const Rect& rect);
48 std::ostream& operator<<(std::ostream& s, const Rectf& rect);
49 std::ostream& operator<<(std::ostream& s, const Rectd& rect);
50 std::ostream& operator<<(std::ostream& s, const Point& point);
51 std::ostream& operator<<(std::ostream& s, const Pointf& point);
52 std::ostream& operator<<(std::ostream& s, const Pointd& point);
53 std::ostream& operator<<(std::ostream& s, const Size& size);
54 std::ostream& operator<<(std::ostream& s, const Sizef& size);
55 
56 template<typename T>
57 std::ostream& operator<<(std::ostream& s, const Vec2<T>& vec)
58 {
59  s << "["
60  << vec.x << ", "
61  << vec.y << "]";
62  return s;
63 }
64 
65 template<typename T>
66 std::ostream& operator<<(std::ostream& s, const Vec3<T>& vec)
67 {
68  s << "["
69  << vec.x << ", "
70  << vec.y << ", "
71  << vec.z << "]";
72  return s;
73 }
74 
75 template<typename T>
76 std::ostream& operator<<(std::ostream& s, const Vec4<T>& vec)
77 {
78  s << "["
79  << vec.x << ", "
80  << vec.y << ", "
81  << vec.z << ", "
82  << vec.w << "]";
83  return s;
84 }
85 
86 }
Type x
Definition: vec4.h:80
2D (x,y) point structure - Integer
Definition: point.h:63
Type y
Definition: vec2.h:81
2D (left,top,right,bottom) rectangle structure - Integer
Definition: rect.h:471
2D (x,y) point structure - Float
Definition: point.h:73
2D (left,top,right,bottom) rectangle structure - Float
Definition: rect.h:485
std::ostream & operator<<(std::ostream &s, const Rect &rect)
Type x
Definition: vec2.h:80
Type z
Definition: vec4.h:82
2D vector
Definition: line.h:48
Type w
Definition: vec4.h:83
4D vector
Definition: size.h:47
Definition: clanapp.h:36
2D (left,top,right,bottom) rectangle structure - Double
Definition: rect.h:500
Type y
Definition: vec4.h:81
2D (x,y) point structure - Double
Definition: point.h:83
3D vector
Definition: line_ray.h:48
2D (width,height) size structure - Integer
Definition: size.h:157
Type x
Definition: vec3.h:80
2D (width,height) size structure - Float
Definition: size.h:170
Type z
Definition: vec3.h:82
Type y
Definition: vec3.h:81