Blame view

3rdparty/boost_1_81_0/boost/archive/codecvt_null.hpp 3.23 KB
63e88f80   Hu Chunming   提交三方库
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
  #ifndef BOOST_ARCHIVE_CODECVT_NULL_HPP
  #define BOOST_ARCHIVE_CODECVT_NULL_HPP
  
  // MS compatible compilers support #pragma once
  #if defined(_MSC_VER)
  # pragma once
  #endif
  
  /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
  // codecvt_null.hpp:
  
  // (C) Copyright 2004 Robert Ramey - http://www.rrsd.com .
  // Use, modification and distribution is 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)
  
  //  See http://www.boost.org for updates, documentation, and revision history.
  
  #include <locale>
  #include <cstddef> // NULL, size_t
  #ifndef BOOST_NO_CWCHAR
  #include <cwchar>   // for mbstate_t
  #endif
  #include <boost/config.hpp>
  #include <boost/serialization/force_include.hpp>
  #include <boost/archive/detail/auto_link_archive.hpp>
  //#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
  
  #if defined(BOOST_NO_STDC_NAMESPACE)
  namespace std {
  // For STLport on WinCE, BOOST_NO_STDC_NAMESPACE can get defined if STLport is putting symbols in its own namespace.
  // In the case of codecvt, however, this does not mean that codecvt is in the global namespace (it will be in STLport's namespace)
  #  if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
      using ::codecvt;
  #  endif
      using ::mbstate_t;
      using ::size_t;
  } // namespace
  #endif
  
  #ifdef BOOST_MSVC
  #  pragma warning(push)
  #  pragma warning(disable : 4511 4512)
  #endif
  
  namespace boost {
  namespace archive {
  
  template<class Ch>
  class codecvt_null;
  
  template<>
  class codecvt_null<char> : public std::codecvt<char, char, std::mbstate_t>
  {
      bool do_always_noconv() const throw() BOOST_OVERRIDE {
          return true;
      }
  public:
      explicit codecvt_null(std::size_t no_locale_manage = 0) :
          std::codecvt<char, char, std::mbstate_t>(no_locale_manage)
      {}
      ~codecvt_null() BOOST_OVERRIDE {}
  };
  
  template<>
  class BOOST_SYMBOL_VISIBLE codecvt_null<wchar_t> :
      public std::codecvt<wchar_t, char, std::mbstate_t>
  {
      BOOST_SYMBOL_EXPORT std::codecvt_base::result
      do_out(
          std::mbstate_t & state,
          const wchar_t * first1,
          const wchar_t * last1,
          const wchar_t * & next1,
          char * first2,
          char * last2,
          char * & next2
      ) const BOOST_OVERRIDE;
  
      BOOST_SYMBOL_EXPORT std::codecvt_base::result
      do_in(
          std::mbstate_t & state,
          const char * first1,
          const char * last1,
          const char * & next1,
          wchar_t * first2,
          wchar_t * last2,
          wchar_t * & next2
      ) const BOOST_OVERRIDE;
  
      BOOST_SYMBOL_EXPORT int do_encoding( ) const throw( ) BOOST_OVERRIDE {
          return sizeof(wchar_t) / sizeof(char);
      }
  
      BOOST_SYMBOL_EXPORT bool do_always_noconv() const throw() BOOST_OVERRIDE {
          return false;
      }
  
      BOOST_SYMBOL_EXPORT int do_max_length( ) const throw( ) BOOST_OVERRIDE {
          return do_encoding();
      }
  public:
      BOOST_SYMBOL_EXPORT explicit codecvt_null(std::size_t no_locale_manage = 0);
  
      BOOST_SYMBOL_EXPORT ~codecvt_null() BOOST_OVERRIDE ;
  };
  
  } // namespace archive
  } // namespace boost
  
  #ifdef BOOST_MSVC
  #  pragma warning(pop)
  #endif
  //#include <boost/archive/detail/abi_suffix.hpp> // pop pragmas
  
  #endif //BOOST_ARCHIVE_CODECVT_NULL_HPP