un/formatted() usage to un/formatted
This commit is contained in:
parent
0e3cebf23a
commit
39179ba1ad
@ -138,9 +138,6 @@ namespace glm
|
|||||||
typedef basic_format_saver<char> format_saver;
|
typedef basic_format_saver<char> format_saver;
|
||||||
typedef basic_format_saver<wchar_t> wformat_saver;
|
typedef basic_format_saver<wchar_t> wformat_saver;
|
||||||
|
|
||||||
struct formatted { /* empty */ };
|
|
||||||
struct unformatted { /* empty */ };
|
|
||||||
|
|
||||||
struct precision {
|
struct precision {
|
||||||
|
|
||||||
unsigned value;
|
unsigned value;
|
||||||
@ -178,11 +175,11 @@ namespace glm
|
|||||||
|
|
||||||
template <typename FTy, typename CTy, typename CTr>
|
template <typename FTy, typename CTy, typename CTr>
|
||||||
FTy const& get_facet(std::basic_ios<CTy,CTr>&);
|
FTy const& get_facet(std::basic_ios<CTy,CTr>&);
|
||||||
|
template <typename FTy, typename CTy, typename CTr>
|
||||||
|
std::basic_ios<CTy,CTr>& formatted(std::basic_ios<CTy,CTr>&);
|
||||||
|
template <typename FTy, typename CTy, typename CTr>
|
||||||
|
std::basic_ios<CTy,CTr>& unformattet(std::basic_ios<CTy,CTr>&);
|
||||||
|
|
||||||
template <typename CTy, typename CTr>
|
|
||||||
std::basic_ostream<CTy, CTr>& operator<<(std::basic_ostream<CTy, CTr>&, formatted const&);
|
|
||||||
template <typename CTy, typename CTr>
|
|
||||||
std::basic_ostream<CTy, CTr>& operator<<(std::basic_ostream<CTy, CTr>&, unformatted const&);
|
|
||||||
template <typename CTy, typename CTr>
|
template <typename CTy, typename CTr>
|
||||||
std::basic_ostream<CTy, CTr>& operator<<(std::basic_ostream<CTy, CTr>&, precision const&);
|
std::basic_ostream<CTy, CTr>& operator<<(std::basic_ostream<CTy, CTr>&, precision const&);
|
||||||
template <typename CTy, typename CTr>
|
template <typename CTy, typename CTr>
|
||||||
|
@ -119,21 +119,21 @@ namespace glm
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename CTy, typename CTr>
|
template <typename CTy, typename CTr>
|
||||||
GLM_FUNC_QUALIFIER std::basic_ostream<CTy, CTr>&
|
GLM_FUNC_QUALIFIER std::basic_ios<CTy,CTr>&
|
||||||
operator<<(std::basic_ostream<CTy, CTr>& os, formatted const&)
|
formatted(std::basic_ios<CTy,CTr>& ios)
|
||||||
{
|
{
|
||||||
const_cast<format_punct<CTy>&>(get_facet<format_punct<CTy>>(os)).formatted = true;
|
const_cast<format_punct<CTy>&>(get_facet<format_punct<CTy>>(ios)).formatted = true;
|
||||||
|
|
||||||
return os;
|
return ios;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename CTy, typename CTr>
|
template <typename CTy, typename CTr>
|
||||||
GLM_FUNC_QUALIFIER std::basic_ostream<CTy, CTr>&
|
GLM_FUNC_QUALIFIER std::basic_ios<CTy,CTr>&
|
||||||
operator<<(std::basic_ostream<CTy, CTr>& os, unformatted const&)
|
unformatted(std::basic_ios<CTy,CTr>& ios)
|
||||||
{
|
{
|
||||||
const_cast<format_punct<CTy>&>(get_facet<format_punct<CTy>>(os)).formatted = false;
|
const_cast<format_punct<CTy>&>(get_facet<format_punct<CTy>>(ios)).formatted = false;
|
||||||
|
|
||||||
return os;
|
return ios;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename CTy, typename CTr>
|
template <typename CTy, typename CTr>
|
||||||
|
@ -80,7 +80,7 @@ int test_io_quat(OS& os)
|
|||||||
{
|
{
|
||||||
glm::io::basic_format_saver<typename OS::char_type> const iofs(os);
|
glm::io::basic_format_saver<typename OS::char_type> const iofs(os);
|
||||||
|
|
||||||
os << glm::io::unformatted()
|
os << glm::io::unformatted
|
||||||
<< type_name<T,P>(os, q) << ": " << q << '\n';
|
<< type_name<T,P>(os, q) << ": " << q << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,7 +157,7 @@ int test_io_mat(OS& os)
|
|||||||
<< "mat4x3<" << typeid(T).name() << ',' << P << ">: " << glm::detail::tmat4x3<T,P>(v3_1, v3_2, v3_3, v3_4) << '\n'
|
<< "mat4x3<" << typeid(T).name() << ',' << P << ">: " << glm::detail::tmat4x3<T,P>(v3_1, v3_2, v3_3, v3_4) << '\n'
|
||||||
<< "mat4x4<" << typeid(T).name() << ',' << P << ">: " << glm::detail::tmat4x4<T,P>(v4_1, v4_2, v4_3, v4_4) << '\n';
|
<< "mat4x4<" << typeid(T).name() << ',' << P << ">: " << glm::detail::tmat4x4<T,P>(v4_1, v4_2, v4_3, v4_4) << '\n';
|
||||||
|
|
||||||
os << glm::io::unformatted()
|
os << glm::io::unformatted
|
||||||
<< glm::io::order(glm::io::order_type::column_major)
|
<< glm::io::order(glm::io::order_type::column_major)
|
||||||
<< "mat2x2<" << typeid(T).name() << ',' << P << ">: " << glm::detail::tmat2x2<T,P>(v2_1, v2_2) << '\n'
|
<< "mat2x2<" << typeid(T).name() << ',' << P << ">: " << glm::detail::tmat2x2<T,P>(v2_1, v2_2) << '\n'
|
||||||
<< "mat2x3<" << typeid(T).name() << ',' << P << ">: " << glm::detail::tmat2x3<T,P>(v3_1, v3_2) << '\n'
|
<< "mat2x3<" << typeid(T).name() << ',' << P << ">: " << glm::detail::tmat2x3<T,P>(v3_1, v3_2) << '\n'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user