Line |
Branch |
Exec |
Source |
1 |
|
|
// |
2 |
|
|
// Copyright (c) 2021 Vinnie Falco (vinnie dot falco at gmail dot com) |
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/http_proto |
8 |
|
|
// |
9 |
|
|
|
10 |
|
|
#ifndef BOOST_HTTP_PROTO_ENCODER_HPP |
11 |
|
|
#define BOOST_HTTP_PROTO_ENCODER_HPP |
12 |
|
|
|
13 |
|
|
#include <boost/http_proto/detail/config.hpp> |
14 |
|
|
#include <boost/http_proto/context.hpp> |
15 |
|
|
#include <boost/http_proto/error.hpp> |
16 |
|
|
#include <cstdint> |
17 |
|
|
#include <memory> |
18 |
|
|
|
19 |
|
|
namespace boost { |
20 |
|
|
namespace http_proto { |
21 |
|
|
|
22 |
|
|
class BOOST_SYMBOL_VISIBLE |
23 |
|
✗ |
encoder |
24 |
|
|
{ |
25 |
|
|
public: |
26 |
|
|
struct buffers |
27 |
|
|
{ |
28 |
|
|
char const* input; // in/out |
29 |
|
|
std::size_t input_avail; // in/out |
30 |
|
|
char* output; // in/out |
31 |
|
|
std::size_t output_avail; // in/out |
32 |
|
|
|
33 |
|
|
std::size_t input_used; // out |
34 |
|
|
std::size_t output_used; // out |
35 |
|
|
}; |
36 |
|
|
|
37 |
|
|
virtual ~encoder() = 0; |
38 |
|
|
|
39 |
|
|
virtual void exchange( |
40 |
|
|
buffers& b, error_code& ec) = 0; |
41 |
|
|
}; |
42 |
|
|
|
43 |
|
|
//------------------------------------------------ |
44 |
|
|
|
45 |
|
|
class BOOST_SYMBOL_VISIBLE |
46 |
|
|
encoder_type |
47 |
|
|
{ |
48 |
|
|
public: |
49 |
|
|
virtual |
50 |
|
|
std::unique_ptr<encoder> |
51 |
|
|
make_encoder() = 0; |
52 |
|
|
}; |
53 |
|
|
|
54 |
|
|
} // http_proto |
55 |
|
|
} // boost |
56 |
|
|
|
57 |
|
|
#endif |
58 |
|
|
|