File indexing completed on 2025-09-18 08:52:49
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_NOWIDE_IOSTREAM_HPP_INCLUDED
0008 #define BOOST_NOWIDE_IOSTREAM_HPP_INCLUDED
0009
0010 #include <boost/nowide/config.hpp>
0011 #ifdef BOOST_WINDOWS
0012 #include <istream>
0013 #include <memory>
0014 #include <ostream>
0015
0016 #include <boost/config/abi_prefix.hpp> // must be the last #include
0017 #else
0018 #include <iostream>
0019 #endif
0020
0021 #ifdef BOOST_MSVC
0022 #pragma warning(push)
0023 #pragma warning(disable : 4251)
0024 #endif
0025
0026 namespace boost {
0027 namespace nowide {
0028 #if !defined(BOOST_WINDOWS) && !defined(BOOST_NOWIDE_DOXYGEN)
0029 using std::cout;
0030 using std::cerr;
0031 using std::cin;
0032 using std::clog;
0033 #else
0034
0035
0036 namespace detail {
0037 class console_output_buffer;
0038 class console_input_buffer;
0039
0040 class BOOST_NOWIDE_DECL winconsole_ostream : public std::ostream
0041 {
0042 public:
0043 enum class target_stream
0044 {
0045 output,
0046 error,
0047 log,
0048 };
0049 winconsole_ostream(target_stream target, bool isBuffered, winconsole_ostream* tieStream);
0050 ~winconsole_ostream();
0051
0052 private:
0053 std::unique_ptr<console_output_buffer> d;
0054
0055 std::ios_base::Init init_;
0056 };
0057
0058 class BOOST_NOWIDE_DECL winconsole_istream : public std::istream
0059 {
0060 public:
0061 explicit winconsole_istream(winconsole_ostream* tieStream);
0062 ~winconsole_istream();
0063
0064 private:
0065 std::unique_ptr<console_input_buffer> d;
0066
0067 std::ios_base::Init init_;
0068 };
0069 }
0070
0071
0072
0073
0074
0075
0076
0077
0078 extern BOOST_NOWIDE_DECL detail::winconsole_istream cin;
0079
0080
0081
0082
0083
0084 extern BOOST_NOWIDE_DECL detail::winconsole_ostream cout;
0085
0086
0087
0088
0089
0090 extern BOOST_NOWIDE_DECL detail::winconsole_ostream cerr;
0091
0092
0093
0094
0095
0096 extern BOOST_NOWIDE_DECL detail::winconsole_ostream clog;
0097
0098 #endif
0099
0100 }
0101 }
0102
0103 #ifdef BOOST_MSVC
0104 #pragma warning(pop)
0105 #endif
0106
0107 #ifdef BOOST_WINDOWS
0108 #include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
0109 #endif
0110
0111 #endif