Boost.UI
User Interface Boost library
coord_io.hpp
Go to the documentation of this file.
1 // Copyright (c) 2017 Kolya Kosenko
2 
3 // Distributed under the Boost Software License, Version 1.0.
4 // See http://www.boost.org/LICENSE_1_0.txt
5 
7 
8 #ifndef BOOST_UI_COORD_IO_HPP
9 #define BOOST_UI_COORD_IO_HPP
10 
11 #include <boost/ui/config.hpp>
12 
13 #ifdef BOOST_HAS_PRAGMA_ONCE
14 #pragma once
15 #endif
16 
17 #include <ostream>
18 #include <sstream>
19 
20 namespace boost {
21 namespace ui {
22 
25 template <class T, class CharT, class Traits>
26 std::basic_ostream<CharT, Traits>&
27 operator<<(std::basic_ostream<CharT, Traits>& os, const basic_size<T>& p)
28 {
29  return os << '(' << p.width() << ',' << p.height() << ')';
30 }
31 
34 template <class T, class CharT, class Traits>
35 std::basic_ostream<CharT, Traits>&
36 operator<<(std::basic_ostream<CharT, Traits>& os, const basic_point<T>& p)
37 {
38  return os << '(' << p.x() << ',' << p.y() << ')';
39 }
40 
43 template <class T, class CharT, class Traits>
44 std::basic_ostream<CharT, Traits>&
45 operator<<(std::basic_ostream<CharT, Traits>& os, const basic_rect<T>& r)
46 {
47  return os << '(' << r.x() << ',' << r.y() << ',' << r.width() << ',' << r.height() << ')';
48 }
49 
50 } // namespace ui
51 } // namespace boost
52 
53 #endif // BOOST_UI_COORD_IO_HPP
boost::ui::basic_point::y
T y() const
Returns y coordinate.
Definition: coord.hpp:179
boost::ui::basic_point
2D point data structure with custom coordinates type
Definition: coord.hpp:119
config.hpp
Configuration options.
boost::ui::basic_rect::width
T width() const
Returns width.
Definition: coord.hpp:372
boost
Boost C++ libraries namespace.
Definition: window.hpp:19
boost::ui::operator<<
std::basic_ostream< char, Traits > & operator<<(std::basic_ostream< char, Traits > &os, const uistring &str)
Writes string into the stream.
Definition: string_io.hpp:31
boost::ui::basic_rect::height
T height() const
Returns height.
Definition: coord.hpp:383
boost::ui::basic_point::x
T x() const
Returns x coordinate.
Definition: coord.hpp:171
boost::ui::basic_rect::x
T x() const
Returns x coordinate.
Definition: coord.hpp:352
boost::ui::basic_size::height
const T & height() const
Retruns height.
Definition: coord.hpp:74
boost::ui::basic_size::width
const T & width() const
Retruns width.
Definition: coord.hpp:71
boost::ui::basic_size
2D size of object data structure with custom coordinates type
Definition: coord.hpp:48
boost::ui::basic_rect::y
T y() const
Returns y coordinate.
Definition: coord.hpp:362
boost::ui::basic_rect
2D rectangle plane figure data structure with custom coordinates type
Definition: coord.hpp:259