io.hpp
Go to the documentation of this file.
1 
43 #pragma once
44 
45 // Dependency:
46 #include "../glm.hpp"
47 #include "../gtx/quaternion.hpp"
48 
49 #if(defined(GLM_MESSAGES) && !defined(glm_ext))
50 # pragma message("GLM: GLM_GTX_io extension included")
51 #endif
52 
53 #include <iosfwd> // std::basic_ostream<> (fwd)
54 #include <locale> // std::locale, std::locale::facet, std::locale::id
55 #include <utility> // std::pair<>
56 
57 namespace glm
58 {
61 
62  namespace io
63  {
65 
66  template <typename CTy>
67  class format_punct : public std::locale::facet
68  {
69  typedef CTy char_type;
70 
71  public:
72 
73  static std::locale::id id;
74 
75  bool formatted;
76  unsigned precision;
77  unsigned width;
84 
85  explicit format_punct(size_t a = 0);
86  explicit format_punct(format_punct const&);
87  };
88 
89  template <typename CTy, typename CTr = std::char_traits<CTy> >
91 
92  public:
93 
94  explicit basic_state_saver(std::basic_ios<CTy,CTr>&);
96 
97  private:
98 
99  typedef ::std::basic_ios<CTy,CTr> state_type;
100  typedef typename state_type::char_type char_type;
101  typedef ::std::ios_base::fmtflags flags_type;
102  typedef ::std::streamsize streamsize_type;
103  typedef ::std::locale const locale_type;
104 
111 
113  };
114 
117 
118  template <typename CTy, typename CTr = std::char_traits<CTy> >
120  {
121  public:
122 
123  explicit basic_format_saver(std::basic_ios<CTy,CTr>&);
125 
126  private:
127 
129 
131  };
132 
135 
136  struct precision
137  {
138  unsigned value;
139 
140  explicit precision(unsigned);
141  };
142 
143  struct width
144  {
145  unsigned value;
146 
147  explicit width(unsigned);
148  };
149 
150  template <typename CTy>
151  struct delimeter
152  {
153  CTy value[3];
154 
155  explicit delimeter(CTy /* left */, CTy /* right */, CTy /* separator */ = ',');
156  };
157 
158  struct order
159  {
161 
162  explicit order(order_type);
163  };
164 
165  // functions, inlined (inline)
166 
167  template <typename FTy, typename CTy, typename CTr>
168  FTy const& get_facet(std::basic_ios<CTy,CTr>&);
169  template <typename FTy, typename CTy, typename CTr>
170  std::basic_ios<CTy,CTr>& formatted(std::basic_ios<CTy,CTr>&);
171  template <typename FTy, typename CTy, typename CTr>
172  std::basic_ios<CTy,CTr>& unformattet(std::basic_ios<CTy,CTr>&);
173 
174  template <typename CTy, typename CTr>
175  std::basic_ostream<CTy, CTr>& operator<<(std::basic_ostream<CTy, CTr>&, precision const&);
176  template <typename CTy, typename CTr>
177  std::basic_ostream<CTy, CTr>& operator<<(std::basic_ostream<CTy, CTr>&, width const&);
178  template <typename CTy, typename CTr>
179  std::basic_ostream<CTy, CTr>& operator<<(std::basic_ostream<CTy, CTr>&, delimeter<CTy> const&);
180  template <typename CTy, typename CTr>
181  std::basic_ostream<CTy, CTr>& operator<<(std::basic_ostream<CTy, CTr>&, order const&);
182  }//namespace io
183 
184  namespace detail
185  {
186  template <typename CTy, typename CTr, typename T, precision P>
187  GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tquat<T,P> const&);
188  template <typename CTy, typename CTr, typename T, precision P>
189  GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tvec2<T,P> const&);
190  template <typename CTy, typename CTr, typename T, precision P>
191  GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tvec3<T,P> const&);
192  template <typename CTy, typename CTr, typename T, precision P>
193  GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tvec4<T,P> const&);
194  template <typename CTy, typename CTr, typename T, precision P>
195  GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat2x2<T,P> const&);
196  template <typename CTy, typename CTr, typename T, precision P>
197  GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat2x3<T,P> const&);
198  template <typename CTy, typename CTr, typename T, precision P>
199  GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat2x4<T,P> const&);
200  template <typename CTy, typename CTr, typename T, precision P>
201  GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat3x2<T,P> const&);
202  template <typename CTy, typename CTr, typename T, precision P>
203  GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat3x3<T,P> const&);
204  template <typename CTy, typename CTr, typename T, precision P>
205  GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat3x4<T,P> const&);
206  template <typename CTy, typename CTr, typename T, precision P>
207  GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat4x2<T,P> const&);
208  template <typename CTy, typename CTr, typename T, precision P>
209  GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat4x3<T,P> const&);
210  template <typename CTy, typename CTr, typename T, precision P>
211  GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat4x4<T,P> const&);
212 
213  template <typename CTy, typename CTr, typename T, precision P>
214  GLM_FUNC_DECL std::basic_ostream<CTy,CTr> & operator<<(
215  std::basic_ostream<CTy,CTr> &,
216  std::pair<tmat4x4<T,P> const,
217  tmat4x4<T,P> const> const &);
218  }//namespace detail
219 
221 }//namespace glm
222 
223 #include "io.inl"
glm::io::basic_format_saver::operator=
basic_format_saver & operator=(basic_format_saver const &)
glm::io::basic_state_saver::char_type
state_type::char_type char_type
Definition: io.hpp:100
glm::io::basic_state_saver::state_type
::std::basic_ios< CTy, CTr > state_type
Definition: io.hpp:99
glm::io::width::width
width(unsigned)
glm::io::basic_state_saver::operator=
basic_state_saver & operator=(basic_state_saver const &)
glm::io::basic_state_saver
Definition: io.hpp:90
glm::io::order::order
order(order_type)
glm::io::format_punct::order
order_type order
Definition: io.hpp:83
glm::io::operator<<
std::basic_ostream< CTy, CTr > & operator<<(std::basic_ostream< CTy, CTr > &, precision const &)
glm::io::format_punct::delim_right
char_type delim_right
Definition: io.hpp:80
glm::io::order::value
order_type value
Definition: io.hpp:160
glm::io::unformattet
std::basic_ios< CTy, CTr > & unformattet(std::basic_ios< CTy, CTr > &)
detail
glm::io::format_punct::id
static std::locale::id id
Definition: io.hpp:73
glm::io::basic_state_saver::~basic_state_saver
~basic_state_saver()
glm::io::format_punct::delim_left
char_type delim_left
Definition: io.hpp:79
glm::io::format_saver
basic_format_saver< char > format_saver
Definition: io.hpp:133
glm::io::format_punct::format_punct
format_punct(size_t a=0)
glm::io::basic_state_saver::locale_
locale_type locale_
Definition: io.hpp:110
glm::io::basic_state_saver::flags_type
::std::ios_base::fmtflags flags_type
Definition: io.hpp:101
glm::io::format_punct::precision
unsigned precision
Definition: io.hpp:76
glm::io::delimeter::delimeter
delimeter(CTy, CTy, CTy=',')
glm::io::format_punct
Definition: io.hpp:67
glm::io::basic_format_saver
Definition: io.hpp:119
glm::io::order_type
order_type
Definition: io.hpp:64
glm::io::width::value
unsigned value
Definition: io.hpp:145
glm::io::precision
Definition: io.hpp:136
glm::io::precision::precision
precision(unsigned)
glm::io::precision::value
unsigned value
Definition: io.hpp:138
glm
Definition: _literals.hpp:31
glm::io::state_saver
basic_state_saver< char > state_saver
Definition: io.hpp:115
glm::io::get_facet
FTy const & get_facet(std::basic_ios< CTy, CTr > &)
glm::io::formatted
std::basic_ios< CTy, CTr > & formatted(std::basic_ios< CTy, CTr > &)
glm::io::format_punct::separator
char_type separator
Definition: io.hpp:78
glm::io::basic_format_saver::~basic_format_saver
~basic_format_saver()
glm::io::format_punct::formatted
bool formatted
Definition: io.hpp:75
glm::io::basic_state_saver::flags_
flags_type flags_
Definition: io.hpp:106
glm::io::basic_state_saver::streamsize_type
::std::streamsize streamsize_type
Definition: io.hpp:102
glm::detail::operator<<
GLM_FUNC_DECL tvec1< T, P > operator<<(tvec1< T, P > const &v, T const &s)
glm::io::delimeter::value
CTy value[3]
Definition: io.hpp:153
glm::io::column_major
@ column_major
Definition: io.hpp:64
glm::io::format_punct::char_type
CTy char_type
Definition: io.hpp:69
glm::io::basic_state_saver::fill_
char_type fill_
Definition: io.hpp:109
glm::io::basic_state_saver::state_
state_type & state_
Definition: io.hpp:105
glm::io::basic_format_saver::bss_
const basic_state_saver< CTy > bss_
Definition: io.hpp:128
glm::io::wformat_saver
basic_format_saver< wchar_t > wformat_saver
Definition: io.hpp:134
glm::io::basic_format_saver::basic_format_saver
basic_format_saver(std::basic_ios< CTy, CTr > &)
glm::io::basic_state_saver::locale_type
const typedef ::std::locale locale_type
Definition: io.hpp:103
glm::io::basic_state_saver::basic_state_saver
basic_state_saver(std::basic_ios< CTy, CTr > &)
glm::io::format_punct::width
unsigned width
Definition: io.hpp:77
glm::io::row_major
@ row_major
Definition: io.hpp:64
glm::io::width
Definition: io.hpp:143
glm::io::basic_state_saver::width_
streamsize_type width_
Definition: io.hpp:108
glm::io::format_punct::newline
char_type newline
Definition: io.hpp:82
glm::io::order
Definition: io.hpp:158
GLM_FUNC_DECL
#define GLM_FUNC_DECL
Definition: setup.hpp:728
glm::io::format_punct::space
char_type space
Definition: io.hpp:81
glm::io::basic_state_saver::precision_
streamsize_type precision_
Definition: io.hpp:107
glm::io::wstate_saver
basic_state_saver< wchar_t > wstate_saver
Definition: io.hpp:116
glm::io::delimeter
Definition: io.hpp:151


rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:11