ゴミ箱
|
#include <chunk_encode.hpp>
Public Types | |
using | value_type = typename view_type::value_type |
Required for ConstBufferSequence. More... | |
using | const_iterator = typename view_type::const_iterator |
Required for ConstBufferSequence. More... | |
Public Member Functions | |
chunk_header (std::size_t size) | |
chunk_header (std::size_t size, string_view extensions) | |
template<class ChunkExtensions , class = typename std::enable_if< detail::is_chunk_extensions< ChunkExtensions>::value>::type> | |
chunk_header (std::size_t size, ChunkExtensions &&extensions) | |
template<class ChunkExtensions , class Allocator , class = typename std::enable_if< detail::is_chunk_extensions< ChunkExtensions>::value>::type> | |
chunk_header (std::size_t size, ChunkExtensions &&extensions, Allocator const &allocator) | |
chunk_header (chunk_header const &)=default | |
Required for ConstBufferSequence. More... | |
const_iterator | begin () const |
Required for ConstBufferSequence. More... | |
const_iterator | end () const |
Required for ConstBufferSequence. More... | |
A chunk header
This implements a ConstBufferSequence representing the header of a chunk. The serialized format is as follows:
The chunk extension is optional. After the header and chunk body have been serialized, it is the callers responsibility to also serialize the final CRLF ("\\r\\n"
).
This class allows the caller to emit piecewise chunk bodies, by first serializing the chunk header using this class and then serializing the chunk body in a series of one or more calls to a stream write operation.
To use this class, pass an instance of it to a stream algorithm as the buffer sequence:
using boost::beast::http::chunk_header::const_iterator = typename view_type::const_iterator |
Required for ConstBufferSequence.
using boost::beast::http::chunk_header::value_type = typename view_type::value_type |
Required for ConstBufferSequence.
|
inlineexplicit |
Constructor
This constructs a buffer sequence representing a chunked-body size and terminating CRLF ("\\r\\n"
) with no chunk extensions.
size | The size of the chunk body that follows. The value must be greater than zero. |
|
inline |
Constructor
This constructs a buffer sequence representing a chunked-body size and terminating CRLF ("\\r\\n"
) with provided chunk extensions.
size | The size of the chunk body that follows. The value must be greater than zero. |
extensions | The chunk extensions string. This string must be formatted correctly as per rfc7230, using this BNF syntax: chunk-ext = *( ";" chunk-ext-name [ "=" chunk-ext-val ] ) chunk-ext-name = token chunk-ext-val = token / quoted-string |
boost::beast::http::chunk_header::chunk_header | ( | std::size_t | size, |
ChunkExtensions && | extensions | ||
) |
Constructor
This constructs a buffer sequence representing a chunked-body size and terminating CRLF ("\\r\\n"
) with provided chunk extensions. The default allocator is used to provide storage for the extensions object.
size | The size of the chunk body that follows. The value must be greater than zero. |
extensions | The chunk extensions object. The expression extensions.str() must be valid, and the return type must be convertible to string_view. This object will be copied or moved as needed to ensure that the chunk header object retains ownership of the buffers provided by the chunk extensions object. |
boost::beast::http::chunk_header::chunk_header | ( | std::size_t | size, |
ChunkExtensions && | extensions, | ||
Allocator const & | allocator | ||
) |
Constructor
This constructs a buffer sequence representing a chunked-body size and terminating CRLF ("\\r\\n"
) with provided chunk extensions. The specified allocator is used to provide storage for the extensions object.
size | The size of the chunk body that follows. The value be greater than zero. |
extensions | The chunk extensions object. The expression extensions.str() must be valid, and the return type must be convertible to string_view. This object will be copied or moved as needed to ensure that the chunk header object retains ownership of the buffers provided by the chunk extensions object. |
allocator | The allocator to provide storage for the moved or copied extensions object. |
|
default |
Required for ConstBufferSequence.
|
inline |
Required for ConstBufferSequence.
|
inline |
Required for ConstBufferSequence.