// ratio_io // // (C) Copyright 2010 Vicente J. Botet Escriba // Use, modification and distribution are subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt). // // This code was adapted by Vicente from Howard Hinnant's experimental work // on chrono i/o under lvm/libc++ to Boost #ifndef BOOST_RATIO_RATIO_STATIC_STRING_HPP #define BOOST_RATIO_RATIO_STATIC_STRING_HPP /* ratio_static_string synopsis #include #include namespace boost { template struct ratio_static_string { typedef basic_str short_name; typedef basic_str long_name; }; } // boost */ #include #include #include //#include #if defined(BOOST_NO_UNICODE_LITERALS) || defined(BOOST_NO_CHAR16_T) || defined(BOOST_NO_CHAR32_T) //~ #define BOOST_RATIO_HAS_UNICODE_SUPPORT #else #define BOOST_RATIO_HAS_UNICODE_SUPPORT 1 #endif namespace boost { template struct ratio_static_string; // atto template <> struct ratio_static_string { typedef static_string::str_1<'a'>::type short_name; typedef static_string::str_4<'a','t','t','o'>::type long_name; }; #ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT template <> struct ratio_static_string { typedef static_string::u16str_1::type short_name; typedef static_string::u16str_4::type long_name; }; template <> struct ratio_static_string { typedef static_string::u32str_1::type short_name; typedef static_string::u32str_4::type long_name; }; #endif #ifndef BOOST_NO_STD_WSTRING template <> struct ratio_static_string { typedef static_string::wstr_1::type short_name; typedef static_string::wstr_4::type long_name; }; #endif // femto template <> struct ratio_static_string { typedef static_string::str_1<'f'>::type short_name; typedef static_string::str_5<'f','e','m','t','o'>::type long_name; }; #ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT template <> struct ratio_static_string { typedef static_string::u16str_1::type short_name; typedef static_string::u16str_5::type long_name; }; template <> struct ratio_static_string { typedef static_string::u32str_1::type short_name; typedef static_string::u32str_5::type long_name; }; #endif #ifndef BOOST_NO_STD_WSTRING template <> struct ratio_static_string { typedef static_string::wstr_1::type short_name; typedef static_string::wstr_5::type long_name; }; #endif // pico template <> struct ratio_static_string { typedef static_string::str_1<'p'>::type short_name; typedef static_string::str_4<'p','i','c','o'>::type long_name; }; #ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT template <> struct ratio_static_string { typedef static_string::u16str_1::type short_name; typedef static_string::u16str_4::type long_name; }; template <> struct ratio_static_string { typedef static_string::u32str_1::type short_name; typedef static_string::u32str_4::type long_name; }; #endif #ifndef BOOST_NO_STD_WSTRING template <> struct ratio_static_string { typedef static_string::wstr_1::type short_name; typedef static_string::wstr_4::type long_name; }; #endif // nano template <> struct ratio_static_string { typedef static_string::str_1<'n'>::type short_name; typedef static_string::str_4<'n','a','n','o'>::type long_name; }; #ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT template <> struct ratio_static_string { typedef static_string::u16str_1::type short_name; typedef static_string::u16str_4::type long_name; }; template <> struct ratio_static_string { typedef static_string::u32str_1::type short_name; typedef static_string::u32str_4::type long_name; }; #endif #ifndef BOOST_NO_STD_WSTRING template <> struct ratio_static_string { typedef static_string::wstr_1::type short_name; typedef static_string::wstr_4::type long_name; }; #endif // micro template <> struct ratio_static_string { typedef static_string::str_2<'\xC2','\xB5'>::type short_name; typedef static_string::str_5<'m','i','c','r','o'>::type long_name; }; #ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT template <> struct ratio_static_string { typedef static_string::u16str_1::type short_name; typedef static_string::u16str_5::type long_name; }; template <> struct ratio_static_string { typedef static_string::u32str_1::type short_name; typedef static_string::u32str_5::type long_name; }; #endif #ifndef BOOST_NO_STD_WSTRING template <> struct ratio_static_string { typedef static_string::wstr_1::type short_name; typedef static_string::wstr_5::type long_name; }; #endif // milli template <> struct ratio_static_string { typedef static_string::str_1<'m'>::type short_name; typedef static_string::str_5<'m','i','l','l','i'>::type long_name; }; #ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT template <> struct ratio_static_string { typedef static_string::u16str_1::type short_name; typedef static_string::u16str_5::type long_name; }; template <> struct ratio_static_string { typedef static_string::u32str_1::type short_name; typedef static_string::u32str_5::type long_name; }; #endif #ifndef BOOST_NO_STD_WSTRING template <> struct ratio_static_string { typedef static_string::wstr_1::type short_name; typedef static_string::wstr_5::type long_name; }; #endif // centi template <> struct ratio_static_string { typedef static_string::str_1<'c'>::type short_name; typedef static_string::str_5<'c','e','n','t','i'>::type long_name; }; #ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT template <> struct ratio_static_string { typedef static_string::u16str_1::type short_name; typedef static_string::u16str_5::type long_name; }; template <> struct ratio_static_string { typedef static_string::u32str_1::type short_name; typedef static_string::u32str_5::type long_name; }; #endif #ifndef BOOST_NO_STD_WSTRING template <> struct ratio_static_string { typedef static_string::wstr_1::type short_name; typedef static_string::wstr_5::type long_name; }; #endif // deci template <> struct ratio_static_string { typedef static_string::str_1<'d'>::type short_name; typedef static_string::str_4<'d','e','c','i'>::type long_name; }; #ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT template <> struct ratio_static_string { typedef static_string::u16str_1::type short_name; typedef static_string::u16str_4::type long_name; }; template <> struct ratio_static_string { typedef static_string::u32str_1::type short_name; typedef static_string::u32str_4::type long_name; }; #endif #ifndef BOOST_NO_STD_WSTRING template <> struct ratio_static_string { typedef static_string::wstr_1::type short_name; typedef static_string::wstr_4::type long_name; }; #endif // deca template <> struct ratio_static_string { typedef static_string::str_2<'d','a'>::type short_name; typedef static_string::str_4<'d','e','c','a'>::type long_name; }; #ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT template <> struct ratio_static_string { typedef static_string::u16str_2::type short_name; typedef static_string::u16str_4::type long_name; }; template <> struct ratio_static_string { typedef static_string::u32str_2::type short_name; typedef static_string::u32str_4::type long_name; }; #endif #ifndef BOOST_NO_STD_WSTRING template <> struct ratio_static_string { typedef static_string::wstr_2::type short_name; typedef static_string::wstr_4::type long_name; }; #endif // hecto template <> struct ratio_static_string { typedef static_string::str_1<'h'>::type short_name; typedef static_string::str_5<'h','e','c','t','o'>::type long_name; }; #ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT template <> struct ratio_static_string { typedef static_string::u16str_1::type short_name; typedef static_string::u16str_5::type long_name; }; template <> struct ratio_static_string { typedef static_string::u32str_1::type short_name; typedef static_string::u32str_5::type long_name; }; #endif #ifndef BOOST_NO_STD_WSTRING template <> struct ratio_static_string { typedef static_string::wstr_1::type short_name; typedef static_string::wstr_5::type long_name; }; #endif // kilo template <> struct ratio_static_string { typedef static_string::str_1<'k'>::type short_name; typedef static_string::str_4<'k','i','l','o'>::type long_name; }; #ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT template <> struct ratio_static_string { typedef static_string::u16str_1::type short_name; typedef static_string::u16str_4::type long_name; }; template <> struct ratio_static_string { typedef static_string::u32str_1::type short_name; typedef static_string::u32str_4::type long_name; }; #endif #ifndef BOOST_NO_STD_WSTRING template <> struct ratio_static_string { typedef static_string::wstr_1::type short_name; typedef static_string::wstr_4::type long_name; }; #endif // mega template <> struct ratio_static_string { typedef static_string::str_1<'M'>::type short_name; typedef static_string::str_4<'m','e','g','a'>::type long_name; }; #ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT template <> struct ratio_static_string { typedef static_string::u16str_1::type short_name; typedef static_string::u16str_4::type long_name; }; template <> struct ratio_static_string { typedef static_string::u32str_1::type short_name; typedef static_string::u32str_4::type long_name; }; #endif #ifndef BOOST_NO_STD_WSTRING template <> struct ratio_static_string { typedef static_string::wstr_1::type short_name; typedef static_string::wstr_4::type long_name; }; #endif // giga template <> struct ratio_static_string { typedef static_string::str_1<'G'>::type short_name; typedef static_string::str_4<'g','i','g','a'>::type long_name; }; #ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT template <> struct ratio_static_string { typedef static_string::u16str_1::type short_name; typedef static_string::u16str_4::type long_name; }; template <> struct ratio_static_string { typedef static_string::u32str_1::type short_name; typedef static_string::u32str_4::type long_name; }; #endif #ifndef BOOST_NO_STD_WSTRING template <> struct ratio_static_string { typedef static_string::wstr_1::type short_name; typedef static_string::wstr_4::type long_name; }; #endif // tera template <> struct ratio_static_string { typedef static_string::str_1<'T'>::type short_name; typedef static_string::str_4<'t','e','r','a'>::type long_name; }; #ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT template <> struct ratio_static_string { typedef static_string::u16str_1::type short_name; typedef static_string::u16str_4::type long_name; }; template <> struct ratio_static_string { typedef static_string::u32str_1::type short_name; typedef static_string::u32str_4::type long_name; }; #endif #ifndef BOOST_NO_STD_WSTRING template <> struct ratio_static_string { typedef static_string::wstr_1::type short_name; typedef static_string::wstr_4::type long_name; }; #endif // peta template <> struct ratio_static_string { typedef static_string::str_1<'P'>::type short_name; typedef static_string::str_4<'p','e','t','a'>::type long_name; }; #ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT template <> struct ratio_static_string { typedef static_string::u16str_1::type short_name; typedef static_string::u16str_4::type long_name; }; template <> struct ratio_static_string { typedef static_string::u32str_1::type short_name; typedef static_string::u32str_4::type long_name; }; #endif #ifndef BOOST_NO_STD_WSTRING template <> struct ratio_static_string { typedef static_string::wstr_1::type short_name; typedef static_string::wstr_4::type long_name; }; #endif // exa template <> struct ratio_static_string { typedef static_string::str_1<'E'>::type short_name; typedef static_string::str_3<'e','x','a'>::type long_name; }; #ifdef BOOST_RATIO_HAS_UNICODE_SUPPORT template <> struct ratio_static_string { typedef static_string::u16str_1::type short_name; typedef static_string::u16str_3::type long_name; }; template <> struct ratio_static_string { typedef static_string::u32str_1::type short_name; typedef static_string::u32str_3::type long_name; }; #endif #ifndef BOOST_NO_STD_WSTRING template <> struct ratio_static_string { typedef static_string::wstr_1::type short_name; typedef static_string::wstr_3::type long_name; }; #endif } #endif // BOOST_RATIO_RATIO_STATIC_STRING_HPP