sl@0: #ifndef BOOST_ARCHIVE_CODECVT_NULL_HPP sl@0: #define BOOST_ARCHIVE_CODECVT_NULL_HPP sl@0: sl@0: // MS compatible compilers support #pragma once sl@0: #if defined(_MSC_VER) && (_MSC_VER >= 1020) sl@0: # pragma once sl@0: #endif sl@0: sl@0: /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 sl@0: // codecvt_null.hpp: sl@0: sl@0: // (C) Copyright 2004 Robert Ramey - http://www.rrsd.com . sl@0: // Use, modification and distribution is subject to the Boost Software sl@0: // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at sl@0: // http://www.boost.org/LICENSE_1_0.txt) sl@0: sl@0: // See http://www.boost.org for updates, documentation, and revision history. sl@0: sl@0: #include sl@0: #include sl@0: sl@0: #include sl@0: sl@0: namespace std{ sl@0: #if defined(__LIBCOMO__) sl@0: using ::mbstate_t; sl@0: #elif defined(__QNXNTO__) sl@0: using std::mbstate_t; sl@0: #elif defined(BOOST_DINKUMWARE_STDLIB) && BOOST_DINKUMWARE_STDLIB == 1 sl@0: using ::mbstate_t; sl@0: #elif defined(__SGI_STL_PORT) sl@0: #elif defined(BOOST_NO_STDC_NAMESPACE) sl@0: using ::codecvt; sl@0: using ::mbstate_t; sl@0: #endif sl@0: } // namespace std sl@0: sl@0: namespace boost { sl@0: namespace archive { sl@0: sl@0: template sl@0: class codecvt_null; sl@0: sl@0: template<> sl@0: class codecvt_null : public std::codecvt sl@0: { sl@0: virtual bool do_always_noconv() const throw() { sl@0: return true; sl@0: } sl@0: public: sl@0: explicit codecvt_null(std::size_t no_locale_manage = 0) : sl@0: std::codecvt(no_locale_manage) sl@0: {} sl@0: }; sl@0: sl@0: template<> sl@0: class codecvt_null : public std::codecvt sl@0: { sl@0: virtual std::codecvt_base::result sl@0: do_out( sl@0: std::mbstate_t & state, sl@0: const wchar_t * first1, sl@0: const wchar_t * last1, sl@0: const wchar_t * & next1, sl@0: char * first2, sl@0: char * last2, sl@0: char * & next2 sl@0: ) const; sl@0: virtual std::codecvt_base::result sl@0: do_in( sl@0: std::mbstate_t & state, sl@0: const char * first1, sl@0: const char * last1, sl@0: const char * & next1, sl@0: wchar_t * first2, sl@0: wchar_t * last2, sl@0: wchar_t * & next2 sl@0: ) const; sl@0: virtual int do_encoding( ) const throw( ){ sl@0: return sizeof(wchar_t) / sizeof(char); sl@0: } sl@0: virtual int do_max_length( ) const throw( ){ sl@0: return do_encoding(); sl@0: } sl@0: }; sl@0: sl@0: } // namespace archive sl@0: } // namespace boost sl@0: sl@0: #endif //BOOST_ARCHIVE_CODECVT_NULL_HPP