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;
78  char_type separator;
79  char_type delim_left;
80  char_type delim_right;
81  char_type space;
82  char_type newline;
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 
105  state_type& state_;
106  flags_type flags_;
107  streamsize_type precision_;
108  streamsize_type width_;
109  char_type fill_;
110  locale_type locale_;
111 
112  basic_state_saver& operator=(basic_state_saver const&);
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 
130  basic_format_saver& operator=(basic_format_saver const&);
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"
state_type::char_type char_type
Definition: io.hpp:100
basic_format_saver< wchar_t > wformat_saver
Definition: io.hpp:134
unsigned value
Definition: io.hpp:138
char_type delim_right
Definition: io.hpp:80
char_type newline
Definition: io.hpp:82
FTy const & get_facet(std::basic_ios< CTy, CTr > &)
state_type & state_
Definition: io.hpp:105
char_type separator
Definition: io.hpp:78
static std::locale::id id
Definition: io.hpp:73
::std::streamsize streamsize_type
Definition: io.hpp:102
unsigned precision
Definition: io.hpp:76
std::basic_ostream< CTy, CTr > & operator<<(std::basic_ostream< CTy, CTr > &, precision const &)
order_type
Definition: io.hpp:64
::std::locale const locale_type
Definition: io.hpp:103
::std::ios_base::fmtflags flags_type
Definition: io.hpp:101
basic_state_saver< wchar_t > wstate_saver
Definition: io.hpp:116
basic_format_saver< char > format_saver
Definition: io.hpp:133
order_type value
Definition: io.hpp:160
char_type delim_left
Definition: io.hpp:79
std::basic_ios< CTy, CTr > & unformattet(std::basic_ios< CTy, CTr > &)
unsigned width
Definition: io.hpp:77
format_punct(size_t a=0)
order_type order
Definition: io.hpp:83
streamsize_type precision_
Definition: io.hpp:107
unsigned value
Definition: io.hpp:145
streamsize_type width_
Definition: io.hpp:108
basic_state_saver< char > state_saver
Definition: io.hpp:115
char_type space
Definition: io.hpp:81
#define GLM_FUNC_DECL
Definition: setup.hpp:728
::std::basic_ios< CTy, CTr > state_type
Definition: io.hpp:99
basic_state_saver< CTy > const bss_
Definition: io.hpp:128
locale_type locale_
Definition: io.hpp:110


rtabmap
Author(s): Mathieu Labbe
autogenerated on Wed Jun 5 2019 22:41:31