File indexing completed on 2025-01-18 09:28:30
0001 #ifndef BOOST_ARCHIVE_CODECVT_NULL_HPP
0002 #define BOOST_ARCHIVE_CODECVT_NULL_HPP
0003
0004
0005 #if defined(_MSC_VER)
0006 # pragma once
0007 #endif
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include <locale>
0020 #include <cstddef> // NULL, size_t
0021 #ifndef BOOST_NO_CWCHAR
0022 #include <cwchar> // for mbstate_t
0023 #endif
0024 #include <boost/config.hpp>
0025 #include <boost/serialization/force_include.hpp>
0026 #include <boost/archive/detail/auto_link_archive.hpp>
0027
0028
0029 #if defined(BOOST_NO_STDC_NAMESPACE)
0030 namespace std {
0031
0032
0033 # if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
0034 using ::codecvt;
0035 # endif
0036 using ::mbstate_t;
0037 using ::size_t;
0038 }
0039 #endif
0040
0041 #ifdef BOOST_MSVC
0042 # pragma warning(push)
0043 # pragma warning(disable : 4511 4512)
0044 #endif
0045
0046 namespace boost {
0047 namespace archive {
0048
0049 template<class Ch>
0050 class codecvt_null;
0051
0052 template<>
0053 class codecvt_null<char> : public std::codecvt<char, char, std::mbstate_t>
0054 {
0055 bool do_always_noconv() const BOOST_NOEXCEPT_OR_NOTHROW BOOST_OVERRIDE {
0056 return true;
0057 }
0058 public:
0059 explicit codecvt_null(std::size_t no_locale_manage = 0) :
0060 std::codecvt<char, char, std::mbstate_t>(no_locale_manage)
0061 {}
0062 ~codecvt_null() BOOST_OVERRIDE {}
0063 };
0064
0065 template<>
0066 class BOOST_SYMBOL_VISIBLE codecvt_null<wchar_t> :
0067 public std::codecvt<wchar_t, char, std::mbstate_t>
0068 {
0069 BOOST_SYMBOL_EXPORT std::codecvt_base::result
0070 do_out(
0071 std::mbstate_t & state,
0072 const wchar_t * first1,
0073 const wchar_t * last1,
0074 const wchar_t * & next1,
0075 char * first2,
0076 char * last2,
0077 char * & next2
0078 ) const BOOST_OVERRIDE;
0079
0080 BOOST_SYMBOL_EXPORT std::codecvt_base::result
0081 do_in(
0082 std::mbstate_t & state,
0083 const char * first1,
0084 const char * last1,
0085 const char * & next1,
0086 wchar_t * first2,
0087 wchar_t * last2,
0088 wchar_t * & next2
0089 ) const BOOST_OVERRIDE;
0090
0091 BOOST_SYMBOL_EXPORT int do_encoding( ) const BOOST_NOEXCEPT_OR_NOTHROW BOOST_OVERRIDE {
0092 return sizeof(wchar_t) / sizeof(char);
0093 }
0094
0095 BOOST_SYMBOL_EXPORT bool do_always_noconv() const BOOST_NOEXCEPT_OR_NOTHROW BOOST_OVERRIDE {
0096 return false;
0097 }
0098
0099 BOOST_SYMBOL_EXPORT int do_max_length( ) const BOOST_NOEXCEPT_OR_NOTHROW BOOST_OVERRIDE {
0100 return do_encoding();
0101 }
0102 public:
0103 BOOST_SYMBOL_EXPORT explicit codecvt_null(std::size_t no_locale_manage = 0);
0104
0105 BOOST_SYMBOL_EXPORT ~codecvt_null() BOOST_OVERRIDE ;
0106 };
0107
0108 }
0109 }
0110
0111 #ifdef BOOST_MSVC
0112 # pragma warning(pop)
0113 #endif
0114
0115
0116 #endif