src/detail/decoder.hpp

100.0% Lines (1/1) 100.0% List of functions (1/1) -% Branches (0/0)
decoder.hpp
f(x) Functions (1)
Line TLA Hits Source Code
1 //
2 // Copyright (c) 2026 Mohammad Nejati
3 //
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 //
7 // Official repository: https://github.com/cppalliance/burl
8 //
9
10 #ifndef BOOST_BURL_SRC_DETAIL_DECODER_HPP
11 #define BOOST_BURL_SRC_DETAIL_DECODER_HPP
12
13 #include <boost/capy/buffers.hpp>
14 #include <boost/http/metadata.hpp>
15
16 #include <cstddef>
17 #include <memory>
18 #include <system_error>
19
20 namespace boost
21 {
22 namespace burl
23 {
24 namespace detail
25 {
26
27 struct decoder
28 {
29 struct result
30 {
31 std::size_t consumed;
32 std::size_t produced;
33 std::error_code ec;
34 };
35
36 128x virtual ~decoder() = default;
37
38 virtual result
39 process(
40 capy::mutable_buffer out,
41 capy::const_buffer in,
42 bool more) = 0;
43 };
44
45 std::unique_ptr<decoder>
46 make_decoder(http::content_coding coding);
47
48 } // namespace detail
49 } // namespace burl
50 } // namespace boost
51
52 #endif
53