Loading...
Searching...
No Matches
istreambuf_view.hpp
Go to the documentation of this file.
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: BSD-3-Clause
#pragma once
#include <iosfwd>
#include <iterator>
#include <ranges>
#include <seqan3/io/stream/concept.hpp>
#include <seqan3/io/stream/detail/fast_istreambuf_iterator.hpp>
namespace seqan3::detail
{
// ============================================================================
// istreambuf_fn (adaptor definition)
// ============================================================================
struct istreambuf_fn
{
template <typename stream_char_t, typename stream_traits_t>
constexpr auto operator()(std::basic_streambuf<stream_char_t, stream_traits_t> & s) const
{
return std::ranges::subrange<detail::fast_istreambuf_iterator<stream_char_t, stream_traits_t>,
std::default_sentinel_t>{
detail::fast_istreambuf_iterator<stream_char_t, stream_traits_t>{s},
std::default_sentinel_t{}};
}
template <input_stream stream_t>
constexpr auto operator()(stream_t & s) const
{
return this->operator()(*s.rdbuf());
}
};
} // namespace seqan3::detail
// ============================================================================
// detail::istreambuf (adaptor instance definition)
// ============================================================================
namespace seqan3::detail
{
inline constexpr auto istreambuf = detail::istreambuf_fn{};
} // namespace seqan3::detail
fast_istreambuf_iterator.hpp
Provides seqan3::detail::fast_istreambuf_iterator.
concept.hpp
Stream concepts.
iosfwd
iterator
Hide me