Chris@16
|
1 // (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
|
Chris@16
|
2 // (C) Copyright 2003-2007 Jonathan Turkanis
|
Chris@16
|
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Chris@16
|
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
|
Chris@16
|
5
|
Chris@16
|
6 // See http://www.boost.org/libs/iostreams for documentation.
|
Chris@16
|
7
|
Chris@16
|
8 #ifndef BOOST_IOSTREAMS_DETAIL_IOS_HPP_INCLUDED
|
Chris@16
|
9 #define BOOST_IOSTREAMS_DETAIL_IOS_HPP_INCLUDED
|
Chris@16
|
10
|
Chris@16
|
11 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
Chris@16
|
12 # pragma once
|
Chris@16
|
13 #endif
|
Chris@16
|
14
|
Chris@16
|
15 #include <boost/config.hpp> // BOOST_MSVC.
|
Chris@16
|
16 #include <boost/detail/workaround.hpp>
|
Chris@16
|
17 #include <boost/iostreams/detail/config/wide_streams.hpp>
|
Chris@16
|
18 #ifndef BOOST_IOSTREAMS_NO_STREAM_TEMPLATES
|
Chris@16
|
19 # if !BOOST_WORKAROUND(__MWERKS__, <= 0x3003)
|
Chris@16
|
20 # include <ios>
|
Chris@16
|
21 # else
|
Chris@16
|
22 # include <istream>
|
Chris@16
|
23 # include <ostream>
|
Chris@16
|
24 # endif
|
Chris@16
|
25 #else
|
Chris@16
|
26 # include <exception>
|
Chris@16
|
27 # include <iosfwd>
|
Chris@16
|
28 #endif
|
Chris@16
|
29
|
Chris@16
|
30 namespace boost { namespace iostreams { namespace detail {
|
Chris@16
|
31
|
Chris@16
|
32 #ifndef BOOST_IOSTREAMS_NO_STREAM_TEMPLATES //--------------------------------//
|
Chris@16
|
33 # define BOOST_IOSTREAMS_BASIC_IOS(ch, tr) std::basic_ios< ch, tr >
|
Chris@16
|
34 # if !BOOST_WORKAROUND(__MWERKS__, <= 0x3003) && \
|
Chris@16
|
35 !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && \
|
Chris@16
|
36 !BOOST_WORKAROUND(BOOST_MSVC, < 1300) \
|
Chris@16
|
37 /**/
|
Chris@16
|
38
|
Chris@16
|
39 #define BOOST_IOS std::ios
|
Chris@16
|
40 #define BOOST_IOSTREAMS_FAILURE std::ios::failure
|
Chris@16
|
41
|
Chris@16
|
42 # else
|
Chris@16
|
43
|
Chris@16
|
44 #define BOOST_IOS std::ios_base
|
Chris@16
|
45 #define BOOST_IOSTREAMS_FAILURE std::ios_base::failure
|
Chris@16
|
46
|
Chris@16
|
47 # endif
|
Chris@16
|
48 #else // #ifndef BOOST_IOSTREAMS_NO_STREAM_TEMPLATES //-----------------------//
|
Chris@16
|
49
|
Chris@16
|
50 #define BOOST_IOS std::ios
|
Chris@16
|
51 #define BOOST_IOSTREAMS_BASIC_IOS(ch, tr) std::ios
|
Chris@16
|
52 #define BOOST_IOSTREAMS_FAILURE boost::iostreams::detail::failure
|
Chris@16
|
53
|
Chris@16
|
54 class failure : std::exception {
|
Chris@16
|
55 public:
|
Chris@16
|
56 explicit failure(const std::string& what_arg) : what_(what_arg) { }
|
Chris@16
|
57 const char* what() const { return what_.c_str(); }
|
Chris@16
|
58 private:
|
Chris@16
|
59 std::string what_;
|
Chris@16
|
60 };
|
Chris@16
|
61
|
Chris@16
|
62 #endif // #ifndef BOOST_IOSTREAMS_NO_STREAM_TEMPLATES //----------------------//
|
Chris@16
|
63
|
Chris@16
|
64 } } } // End namespace failure, iostreams, boost.
|
Chris@16
|
65
|
Chris@16
|
66 #endif // #ifndef BOOST_IOSTREAMS_DETAIL_IOS_HPP_INCLUDED
|