os/ossrv/ossrv_pub/boost_apis/boost/archive/codecvt_null.hpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/archive/codecvt_null.hpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,90 @@
     1.4 +#ifndef BOOST_ARCHIVE_CODECVT_NULL_HPP
     1.5 +#define BOOST_ARCHIVE_CODECVT_NULL_HPP
     1.6 +
     1.7 +// MS compatible compilers support #pragma once
     1.8 +#if defined(_MSC_VER) && (_MSC_VER >= 1020)
     1.9 +# pragma once
    1.10 +#endif
    1.11 +
    1.12 +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
    1.13 +// codecvt_null.hpp:
    1.14 +
    1.15 +// (C) Copyright 2004 Robert Ramey - http://www.rrsd.com .
    1.16 +// Use, modification and distribution is subject to the Boost Software
    1.17 +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
    1.18 +// http://www.boost.org/LICENSE_1_0.txt)
    1.19 +
    1.20 +//  See http://www.boost.org for updates, documentation, and revision history.
    1.21 +
    1.22 +#include <locale>
    1.23 +#include <cstddef>
    1.24 +
    1.25 +#include <boost/config.hpp>
    1.26 +
    1.27 +namespace std{
    1.28 +    #if defined(__LIBCOMO__)
    1.29 +        using ::mbstate_t;
    1.30 +    #elif defined(__QNXNTO__)
    1.31 +        using std::mbstate_t;
    1.32 +    #elif defined(BOOST_DINKUMWARE_STDLIB) && BOOST_DINKUMWARE_STDLIB == 1
    1.33 +        using ::mbstate_t;
    1.34 +    #elif defined(__SGI_STL_PORT)
    1.35 +    #elif defined(BOOST_NO_STDC_NAMESPACE)
    1.36 +        using ::codecvt;
    1.37 +        using ::mbstate_t;
    1.38 +    #endif
    1.39 +} // namespace std
    1.40 +
    1.41 +namespace boost {
    1.42 +namespace archive {
    1.43 +
    1.44 +template<class Ch>
    1.45 +class codecvt_null;
    1.46 +
    1.47 +template<>
    1.48 +class codecvt_null<char> : public std::codecvt<char, char, std::mbstate_t>
    1.49 +{
    1.50 +    virtual bool do_always_noconv() const throw() {
    1.51 +        return true;
    1.52 +    }
    1.53 +public:
    1.54 +    explicit codecvt_null(std::size_t no_locale_manage = 0) :
    1.55 +        std::codecvt<char, char, std::mbstate_t>(no_locale_manage)
    1.56 +    {}
    1.57 +};
    1.58 +
    1.59 +template<>
    1.60 +class codecvt_null<wchar_t> : public std::codecvt<wchar_t, char, std::mbstate_t>
    1.61 +{
    1.62 +    virtual std::codecvt_base::result
    1.63 +    do_out(
    1.64 +        std::mbstate_t & state,
    1.65 +        const wchar_t * first1,
    1.66 +        const wchar_t * last1,
    1.67 +        const wchar_t * & next1,
    1.68 +        char * first2,
    1.69 +        char * last2,
    1.70 +        char * & next2
    1.71 +    ) const;
    1.72 +    virtual std::codecvt_base::result
    1.73 +    do_in(
    1.74 +        std::mbstate_t & state,
    1.75 +        const char * first1,
    1.76 +        const char * last1,
    1.77 +        const char * & next1,
    1.78 +        wchar_t * first2,
    1.79 +        wchar_t * last2,
    1.80 +        wchar_t * & next2
    1.81 +    ) const;
    1.82 +    virtual int do_encoding( ) const throw( ){
    1.83 +        return sizeof(wchar_t) / sizeof(char);
    1.84 +    }
    1.85 +    virtual int do_max_length( ) const throw( ){
    1.86 +        return do_encoding();
    1.87 +    }
    1.88 +};
    1.89 +
    1.90 +} // namespace archive
    1.91 +} // namespace boost
    1.92 +
    1.93 +#endif //BOOST_ARCHIVE_CODECVT_NULL_HPP