/
usr
/
include
/
boost
/
iostreams
/
/usr/include/boost/iostreams
mkdir
upload
Name
Size
Mode
Actions
detail/
-
0755
rm
device/
-
0755
rm
filter/
-
0755
rm
categories.hpp
4737
0644
edit
dl
rm
chain.hpp
21725
0644
edit
dl
rm
char_traits.hpp
2433
0644
edit
dl
rm
checked_operations.hpp
4899
0644
edit
dl
rm
close.hpp
7012
0644
edit
dl
rm
code_converter.hpp
14429
0644
edit
dl
rm
combine.hpp
8686
0644
edit
dl
rm
compose.hpp
18155
0644
edit
dl
rm
concepts.hpp
3957
0644
edit
dl
rm
constants.hpp
1363
0644
edit
dl
rm
copy.hpp
9430
0644
edit
dl
rm
filtering_stream.hpp
6970
0644
edit
dl
rm
filtering_streambuf.hpp
3081
0644
edit
dl
rm
flush.hpp
3205
0644
edit
dl
rm
get.hpp
545
0644
edit
dl
rm
imbue.hpp
2221
0644
edit
dl
rm
input_sequence.hpp
1991
0644
edit
dl
rm
invert.hpp
5556
0644
edit
dl
rm
operations.hpp
940
0644
edit
dl
rm
operations_fwd.hpp
1036
0644
edit
dl
rm
optimal_buffer_size.hpp
2433
0644
edit
dl
rm
output_sequence.hpp
2005
0644
edit
dl
rm
pipeline.hpp
3646
0644
edit
dl
rm
positioning.hpp
4102
0644
edit
dl
rm
put.hpp
546
0644
edit
dl
rm
putback.hpp
557
0644
edit
dl
rm
read.hpp
7303
0644
edit
dl
rm
restrict.hpp
945
0644
edit
dl
rm
seek.hpp
5457
0644
edit
dl
rm
skip.hpp
3872
0644
edit
dl
rm
slice.hpp
1018
0644
edit
dl
rm
stream.hpp
6133
0644
edit
dl
rm
stream_buffer.hpp
3904
0644
edit
dl
rm
tee.hpp
7495
0644
edit
dl
rm
traits.hpp
11846
0644
edit
dl
rm
traits_fwd.hpp
2020
0644
edit
dl
rm
write.hpp
4856
0644
edit
dl
rm
Edit:
/usr/include/boost/iostreams/read.hpp
(7303B)
// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com) // (C) Copyright 2005-2007 Jonathan Turkanis // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.) // See http://www.boost.org/libs/iostreams for documentation. #ifndef BOOST_IOSTREAMS_READ_HPP_INCLUDED #define BOOST_IOSTREAMS_READ_HPP_INCLUDED #if defined(_MSC_VER) # pragma once #endif #include <boost/config.hpp> // DEDUCED_TYPENAME, MSVC. #include <boost/detail/workaround.hpp> #include <boost/iostreams/char_traits.hpp> #include <boost/iostreams/detail/char_traits.hpp> #include <boost/iostreams/detail/dispatch.hpp> #include <boost/iostreams/detail/ios.hpp> // streamsize. #include <boost/iostreams/detail/streambuf.hpp> #include <boost/iostreams/detail/wrap_unwrap.hpp> #include <boost/iostreams/operations_fwd.hpp> #include <boost/mpl/if.hpp> // Must come last. #include <boost/iostreams/detail/config/disable_warnings.hpp> namespace boost { namespace iostreams { namespace detail { template<typename T> struct read_device_impl; template<typename T> struct read_filter_impl; } // End namespace detail. template<typename T> typename int_type_of<T>::type get(T& t) { return detail::read_device_impl<T>::get(detail::unwrap(t)); } template<typename T> inline std::streamsize read(T& t, typename char_type_of<T>::type* s, std::streamsize n) { return detail::read_device_impl<T>::read(detail::unwrap(t), s, n); } template<typename T, typename Source> std::streamsize read(T& t, Source& src, typename char_type_of<T>::type* s, std::streamsize n) { return detail::read_filter_impl<T>::read(detail::unwrap(t), src, s, n); } template<typename T> bool putback(T& t, typename char_type_of<T>::type c) { return detail::read_device_impl<T>::putback(detail::unwrap(t), c); } //----------------------------------------------------------------------------// namespace detail { // Helper function for adding -1 as EOF indicator. inline std::streamsize check_eof(std::streamsize n) { return n != 0 ? n : -1; } // Helper templates for reading from streambufs. template<bool IsLinked> struct true_eof_impl; template<> struct true_eof_impl<true> { template<typename T> static bool true_eof(T& t) { return t.true_eof(); } }; template<> struct true_eof_impl<false> { template<typename T> static bool true_eof(T&) { return true; } }; template<typename T> inline bool true_eof(T& t) { const bool linked = is_linked<T>::value; return true_eof_impl<linked>::true_eof(t); } //------------------Definition of read_device_impl----------------------------// template<typename T> struct read_device_impl : mpl::if_< detail::is_custom<T>, operations<T>, read_device_impl< BOOST_DEDUCED_TYPENAME detail::dispatch< T, istream_tag, streambuf_tag, input >::type > >::type { }; template<> struct read_device_impl<istream_tag> { template<typename T> static typename int_type_of<T>::type get(T& t) { return t.get(); } template<typename T> static std::streamsize read(T& t, typename char_type_of<T>::type* s, std::streamsize n) { return check_eof(t.rdbuf()->sgetn(s, n)); } template<typename T> static bool putback(T& t, typename char_type_of<T>::type c) { typedef typename char_type_of<T>::type char_type; typedef BOOST_IOSTREAMS_CHAR_TRAITS(char_type) traits_type; return !traits_type::eq_int_type( t.rdbuf()->sputbackc(c), traits_type::eof() ); } }; template<> struct read_device_impl<streambuf_tag> { template<typename T> static typename int_type_of<T>::type get(T& t) { // gcc 2.95 needs namespace qualification for char_traits. typedef typename char_type_of<T>::type char_type; typedef iostreams::char_traits<char_type> traits_type; typename int_type_of<T>::type c; return !traits_type::is_eof(c = t.sbumpc()) || detail::true_eof(t) ? c : traits_type::would_block(); } template<typename T> static std::streamsize read(T& t, typename char_type_of<T>::type* s, std::streamsize n) { std::streamsize amt; return (amt = t.sgetn(s, n)) != 0 ? amt : detail::true_eof(t) ? -1 : 0; } template<typename T> static bool putback(T& t, typename char_type_of<T>::type c) { // gcc 2.95 needs namespace qualification for char_traits. typedef typename char_type_of<T>::type char_type; typedef iostreams::char_traits<char_type> traits_type; return !traits_type::is_eof(t.sputbackc(c)); } }; template<> struct read_device_impl<input> { template<typename T> static typename int_type_of<T>::type get(T& t) { // gcc 2.95 needs namespace qualification for char_traits. typedef typename char_type_of<T>::type char_type; typedef iostreams::char_traits<char_type> traits_type; char_type c; std::streamsize amt; return (amt = t.read(&c, 1)) == 1 ? traits_type::to_int_type(c) : amt == -1 ? traits_type::eof() : traits_type::would_block(); } template<typename T> static std::streamsize read(T& t, typename char_type_of<T>::type* s, std::streamsize n) { return t.read(s, n); } template<typename T> static bool putback(T& t, typename char_type_of<T>::type c) { // T must be Peekable. return t.putback(c); } }; //------------------Definition of read_filter_impl----------------------------// template<typename T> struct read_filter_impl : mpl::if_< detail::is_custom<T>, operations<T>, read_filter_impl< BOOST_DEDUCED_TYPENAME detail::dispatch< T, multichar_tag, any_tag >::type > >::type { }; template<> struct read_filter_impl<multichar_tag> { template<typename T, typename Source> static std::streamsize read (T& t, Source& src, typename char_type_of<T>::type* s, std::streamsize n) { return t.read(src, s, n); } }; template<> struct read_filter_impl<any_tag> { template<typename T, typename Source> static std::streamsize read (T& t, Source& src, typename char_type_of<T>::type* s, std::streamsize n) { // gcc 2.95 needs namespace qualification for char_traits. typedef typename char_type_of<T>::type char_type; typedef iostreams::char_traits<char_type> traits_type; for (std::streamsize off = 0; off < n; ++off) { typename traits_type::int_type c = t.get(src); if (traits_type::is_eof(c)) return check_eof(off); if (traits_type::would_block(c)) return off; s[off] = traits_type::to_char_type(c); } return n; } }; } // End namespace detail. } } // End namespaces iostreams, boost. #include <boost/iostreams/detail/config/enable_warnings.hpp> #endif // #ifndef BOOST_IOSTREAMS_READ_HPP_INCLUDED
Save
cmd:
run