SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
istreambuf_view.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
2// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
3// SPDX-License-Identifier: BSD-3-Clause
4
10#pragma once
11
12#include <iosfwd>
13#include <iterator>
14#include <ranges>
15
18
19namespace seqan3::detail
20{
21
22// ============================================================================
23// istreambuf_fn (adaptor definition)
24// ============================================================================
25
29{
36 template <typename stream_char_t, typename stream_traits_t>
38 {
39 return std::ranges::subrange<detail::fast_istreambuf_iterator<stream_char_t, stream_traits_t>,
40 std::default_sentinel_t>{
42 std::default_sentinel_t{}};
43 }
44
50 template <input_stream stream_t>
51 constexpr auto operator()(stream_t & s) const
52 {
53 return this->operator()(*s.rdbuf());
54 }
55};
56
57} // namespace seqan3::detail
58
59// ============================================================================
60// detail::istreambuf (adaptor instance definition)
61// ============================================================================
62
63namespace seqan3::detail
64{
104inline constexpr auto istreambuf = detail::istreambuf_fn{};
105
106} // namespace seqan3::detail
Functionally the same as std::istreambuf_iterator, but faster.
Definition fast_istreambuf_iterator.hpp:37
Provides seqan3::detail::fast_istreambuf_iterator.
constexpr auto istreambuf
A view factory that returns a view over the stream buffer of an input stream.
Definition istreambuf_view.hpp:104
Stream concepts.
The internal SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
View adaptor/factory definition for views::istream.
Definition istreambuf_view.hpp:29
constexpr auto operator()(std::basic_streambuf< stream_char_t, stream_traits_t > &s) const
Return the view object.
Definition istreambuf_view.hpp:37
constexpr auto operator()(stream_t &s) const
Return the view object.
Definition istreambuf_view.hpp:51
Hide me