Back to home page

EIC code displayed by LXR

 
 

    


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 // MS compatible compilers support #pragma once
0005 #if defined(_MSC_VER)
0006 # pragma once
0007 #endif
0008 
0009 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
0010 // codecvt_null.hpp:
0011 
0012 // (C) Copyright 2004 Robert Ramey - http://www.rrsd.com .
0013 // Use, modification and distribution is subject to the Boost Software
0014 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0015 // http://www.boost.org/LICENSE_1_0.txt)
0016 
0017 //  See http://www.boost.org for updates, documentation, and revision history.
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 //#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
0028 
0029 #if defined(BOOST_NO_STDC_NAMESPACE)
0030 namespace std {
0031 // For STLport on WinCE, BOOST_NO_STDC_NAMESPACE can get defined if STLport is putting symbols in its own namespace.
0032 // In the case of codecvt, however, this does not mean that codecvt is in the global namespace (it will be in STLport's namespace)
0033 #  if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
0034     using ::codecvt;
0035 #  endif
0036     using ::mbstate_t;
0037     using ::size_t;
0038 } // namespace
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 } // namespace archive
0109 } // namespace boost
0110 
0111 #ifdef BOOST_MSVC
0112 #  pragma warning(pop)
0113 #endif
0114 //#include <boost/archive/detail/abi_suffix.hpp> // pop pragmas
0115 
0116 #endif //BOOST_ARCHIVE_CODECVT_NULL_HPP