Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:54:14

0001 // Copyright Kevlin Henney, 2000-2005.
0002 // Copyright Alexander Nasonov, 2006-2010.
0003 // Copyright Antony Polukhin, 2011-2025.
0004 //
0005 // Distributed under the Boost Software License, Version 1.0. (See
0006 // accompanying file LICENSE_1_0.txt or copy at
0007 // http://www.boost.org/LICENSE_1_0.txt)
0008 
0009 #ifndef BOOST_LEXICAL_CAST_DETAIL_CONVERTER_LEXICAL_BASIC_UNLOCKEDBUF_HPP
0010 #define BOOST_LEXICAL_CAST_DETAIL_CONVERTER_LEXICAL_BASIC_UNLOCKEDBUF_HPP
0011 
0012 #include <boost/config.hpp>
0013 #ifdef BOOST_HAS_PRAGMA_ONCE
0014 #   pragma once
0015 #endif
0016 
0017 
0018 #ifdef BOOST_NO_STRINGSTREAM
0019 #include <strstream>
0020 #else
0021 #include <sstream>
0022 #endif
0023 
0024 #include <boost/detail/basic_pointerbuf.hpp>
0025 #ifndef BOOST_NO_CWCHAR
0026 #   include <cwchar>
0027 #endif
0028 
0029 namespace boost { namespace detail { namespace lcast {
0030 
0031     // acts as a stream buffer which wraps around a pair of pointers
0032     // and gives acces to internals
0033     template <class BufferType, class CharT>
0034     class basic_unlockedbuf : public basic_pointerbuf<CharT, BufferType> {
0035     public:
0036         typedef basic_pointerbuf<CharT, BufferType> base_type;
0037         typedef typename base_type::streamsize streamsize;
0038 
0039         using base_type::pptr;
0040         using base_type::pbase;
0041         using base_type::setbuf;
0042     };
0043 
0044 #if defined(BOOST_NO_STRINGSTREAM)
0045     template <class CharT, class Traits>
0046     using out_stream_t = std::ostream;
0047 
0048     template <class CharT, class Traits>
0049     using stringbuffer_t = basic_unlockedbuf<std::strstreambuf, char>;
0050 #elif defined(BOOST_NO_STD_LOCALE)
0051     template <class CharT, class Traits>
0052     using out_stream_t = std::ostream;
0053 
0054     template <class CharT, class Traits>
0055     using stringbuffer_t = basic_unlockedbuf<std::stringbuf, char>;
0056 
0057     template <class CharT, class Traits>
0058     using buffer_t = basic_unlockedbuf<std::streambuf, char>;
0059 #else
0060     template <class CharT, class Traits>
0061     using out_stream_t = std::basic_ostream<CharT, Traits>;
0062 
0063     template <class CharT, class Traits>
0064     using stringbuffer_t = basic_unlockedbuf<std::basic_stringbuf<CharT, Traits>, CharT>;
0065 
0066     template <class CharT, class Traits>
0067     using buffer_t = basic_unlockedbuf<std::basic_streambuf<CharT, Traits>, CharT>;
0068 #endif
0069 
0070 }}} // namespace boost::detail::lcast
0071 
0072 #endif // BOOST_LEXICAL_CAST_DETAIL_CONVERTER_LEXICAL_BASIC_UNLOCKEDBUF_HPP
0073