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