Back to Mame

0.9.8: io.hpp Source File

3rdparty/glm/doc/api/a00048_source.html

latest7.7 KB
Original Source

| | 0.9.8 |

io.hpp

Go to the documentation of this file.

1

20 #pragma once

21

22 // Dependency:

23 #include "../glm.hpp"

24 #include "../gtx/quaternion.hpp"

25

26 #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)

27 # pragma message("GLM: GLM_GTX_io extension included")

28 #endif

29

30 #include <iosfwd>// std::basic_ostream<> (fwd)

31 #include <locale>// std::locale, std::locale::facet, std::locale::id

32 #include <utility> // std::pair<>

33

34 namespace glm

35 {

38

39namespace io

40 {

41enum order_type { column_major, row_major};

42

43template <typename CTy>

44class format_punct : public std::locale::facet

45 {

46typedef CTy char_type;

47

48public:

49

50static std::locale::id id;

51

52bool formatted;

53unsigned precision;

54unsigned width;

55 char_type separator;

56 char_type delim_left;

57 char_type delim_right;

58 char_type space;

59 char_type newline;

60 order_type order;

61

62 GLM_FUNC_DECL explicit format_punct(size_t a = 0);

63 GLM_FUNC_DECL explicit format_punct(format_punct const&);

64 };

65

66template <typename CTy, typename CTr = std::char_traits<CTy> >

67class basic_state_saver {

68

69public:

70

71 GLM_FUNC_DECL explicit basic_state_saver(std::basic_ios<CTy,CTr>&);

72 GLM_FUNC_DECL ~basic_state_saver();

73

74private:

75

76 typedef ::std::basic_ios<CTy,CTr> state_type;

77typedef typename state_type::char_type char_type;

78 typedef ::std::ios_base::fmtflags flags_type;

79 typedef ::std::streamsize streamsize_type;

80 typedef ::std::locale const locale_type;

81

82 state_type& state_;

83 flags_type flags_;

84 streamsize_type precision_;

85 streamsize_type width_;

86 char_type fill_;

87 locale_type locale_;

88

89 GLM_FUNC_DECL basic_state_saver& operator=(basic_state_saver const&);

90 };

91

92typedef basic_state_saver<char> state_saver;

93typedef basic_state_saver<wchar_t> wstate_saver;

94

95template <typename CTy, typename CTr = std::char_traits<CTy> >

96class basic_format_saver

97 {

98public:

99

100 GLM_FUNC_DECL explicit basic_format_saver(std::basic_ios<CTy,CTr>&);

101 GLM_FUNC_DECL ~basic_format_saver();

102

103private:

104

105 basic_state_saver<CTy> const bss_;

106

107 GLM_FUNC_DECL basic_format_saver& operator=(basic_format_saver const&);

108 };

109

110typedef basic_format_saver<char> format_saver;

111typedef basic_format_saver<wchar_t> wformat_saver;

112

113struct precision

114 {

115unsigned value;

116

117 GLM_FUNC_DECL explicit precision(unsigned);

118 };

119

120struct width

121 {

122unsigned value;

123

124 GLM_FUNC_DECL explicit width(unsigned);

125 };

126

127template <typename CTy>

128struct delimeter

129 {

130 CTy value[3];

131

132 GLM_FUNC_DECL explicit delimeter(CTy /* left */, CTy /* right */, CTy /* separator */ = ',');

133 };

134

135struct order

136 {

137 order_type value;

138

139 GLM_FUNC_DECL explicit order(order_type);

140 };

141

142// functions, inlined (inline)

143

144template <typename FTy, typename CTy, typename CTr>

145 FTy const& get_facet(std::basic_ios<CTy,CTr>&);

146template <typename FTy, typename CTy, typename CTr>

147 std::basic_ios<CTy,CTr>& formatted(std::basic_ios<CTy,CTr>&);

148template <typename FTy, typename CTy, typename CTr>

149 std::basic_ios<CTy,CTr>& unformattet(std::basic_ios<CTy,CTr>&);

150

151template <typename CTy, typename CTr>

152 std::basic_ostream<CTy, CTr>& operator<<(std::basic_ostream<CTy, CTr>&, precision const&);

153template <typename CTy, typename CTr>

154 std::basic_ostream<CTy, CTr>& operator<<(std::basic_ostream<CTy, CTr>&, width const&);

155template <typename CTy, typename CTr>

156 std::basic_ostream<CTy, CTr>& operator<<(std::basic_ostream<CTy, CTr>&, delimeter<CTy> const&);

157template <typename CTy, typename CTr>

158 std::basic_ostream<CTy, CTr>& operator<<(std::basic_ostream<CTy, CTr>&, order const&);

159 }//namespace io

160

161template <typename CTy, typename CTr, typename T, precision P>

162 GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tquat<T,P> const&);

163template <typename CTy, typename CTr, typename T, precision P>

164 GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tvec1<T,P> const&);

165template <typename CTy, typename CTr, typename T, precision P>

166 GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tvec2<T,P> const&);

167template <typename CTy, typename CTr, typename T, precision P>

168 GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tvec3<T,P> const&);

169template <typename CTy, typename CTr, typename T, precision P>

170 GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tvec4<T,P> const&);

171template <typename CTy, typename CTr, typename T, precision P>

172 GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat2x2<T,P> const&);

173template <typename CTy, typename CTr, typename T, precision P>

174 GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat2x3<T,P> const&);

175template <typename CTy, typename CTr, typename T, precision P>

176 GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat2x4<T,P> const&);

177template <typename CTy, typename CTr, typename T, precision P>

178 GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat3x2<T,P> const&);

179template <typename CTy, typename CTr, typename T, precision P>

180 GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat3x3<T,P> const&);

181template <typename CTy, typename CTr, typename T, precision P>

182 GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat3x4<T,P> const&);

183template <typename CTy, typename CTr, typename T, precision P>

184 GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat4x2<T,P> const&);

185template <typename CTy, typename CTr, typename T, precision P>

186 GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat4x3<T,P> const&);

187template <typename CTy, typename CTr, typename T, precision P>

188 GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tmat4x4<T,P> const&);

189

190template <typename CTy, typename CTr, typename T, precision P>

191 GLM_FUNC_DECL std::basic_ostream<CTy,CTr> & operator<<(std::basic_ostream<CTy,CTr> &,

192 std::pair<tmat4x4<T,P> const, tmat4x4<T,P> const> const &);

193

195 }//namespace glm

196

197 #include "io.inl"

glm

Definition: _noise.hpp:11


Generated by 1.8.10