ゴミ箱
Public Types | Public Member Functions | List of all members
boost::beast::http::chunk_body< ConstBufferSequence > Class Template Reference

#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_body (ConstBufferSequence const &buffers)
 
 chunk_body (ConstBufferSequence const &buffers, string_view extensions)
 
template<class ChunkExtensions , class = typename std::enable_if< ! std::is_convertible<typename std::decay< ChunkExtensions>::type, string_view>::value>::type>
 chunk_body (ConstBufferSequence const &buffers, ChunkExtensions &&extensions)
 
template<class ChunkExtensions , class Allocator , class = typename std::enable_if< ! std::is_convertible<typename std::decay< ChunkExtensions>::type, string_view>::value>::type>
 chunk_body (ConstBufferSequence const &buffers, ChunkExtensions &&extensions, Allocator const &allocator)
 
const_iterator begin () const
 Required for ConstBufferSequence. More...
 
const_iterator end () const
 Required for ConstBufferSequence. More...
 

Detailed Description

template<class ConstBufferSequence>
class boost::beast::http::chunk_body< ConstBufferSequence >

A chunk

This implements a ConstBufferSequence representing a chunk. The serialized format is as follows:

chunk = chunk-size [ chunk-ext ] CRLF chunk-data CRLF
chunk-size = 1*HEXDIG
chunk-ext = *( ";" chunk-ext-name [ "=" chunk-ext-val ] )
chunk-ext-name = token
chunk-ext-val = token / quoted-string
chunk-data = 1*OCTET ; a sequence of chunk-size octets

The chunk extension is optional.

To use this class, pass an instance of it to a stream algorithm as the buffer sequence.

See also
https://tools.ietf.org/html/rfc7230#section-4.1

Member Typedef Documentation

template<class ConstBufferSequence>
using boost::beast::http::chunk_body< ConstBufferSequence >::const_iterator = typename view_type::const_iterator

Required for ConstBufferSequence.

template<class ConstBufferSequence>
using boost::beast::http::chunk_body< ConstBufferSequence >::value_type = typename view_type::value_type

Required for ConstBufferSequence.

Constructor & Destructor Documentation

template<class ConstBufferSequence >
boost::beast::http::chunk_body< ConstBufferSequence >::chunk_body ( ConstBufferSequence const &  buffers)
explicit

Constructor

This constructs buffers representing a complete chunk with no chunk extensions and having the size and contents of the specified buffer sequence.

Parameters
buffersA buffer sequence representing the chunk body. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid while this object is in use.
See also
https://tools.ietf.org/html/rfc7230#section-4.1
template<class ConstBufferSequence >
boost::beast::http::chunk_body< ConstBufferSequence >::chunk_body ( ConstBufferSequence const &  buffers,
string_view  extensions 
)

Constructor

This constructs buffers representing a complete chunk with the passed chunk extensions and having the size and contents of the specified buffer sequence.

Parameters
buffersA buffer sequence representing the chunk body. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid while this object is in use.
extensionsThe 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
The data pointed to by this string view must remain valid for the lifetime of any operations performed on the object.
See also
https://tools.ietf.org/html/rfc7230#section-4.1.1
template<class ConstBufferSequence >
template<class ChunkExtensions , class >
boost::beast::http::chunk_body< ConstBufferSequence >::chunk_body ( ConstBufferSequence const &  buffers,
ChunkExtensions &&  extensions 
)

Constructor

This constructs buffers representing a complete chunk with the passed chunk extensions and having the size and contents of the specified buffer sequence. The default allocator is used to provide storage for the extensions object.

Parameters
buffersA buffer sequence representing the chunk body. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid while this object is in use.
extensionsThe 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.
Note
This function participates in overload resolution only if ChunkExtensions meets the requirements stated above.
See also
https://tools.ietf.org/html/rfc7230#section-4.1
template<class ConstBufferSequence >
template<class ChunkExtensions , class Allocator , class >
boost::beast::http::chunk_body< ConstBufferSequence >::chunk_body ( ConstBufferSequence const &  buffers,
ChunkExtensions &&  extensions,
Allocator const &  allocator 
)

Constructor

This constructs buffers representing a complete chunk with the passed chunk extensions and having the size and contents of the specified buffer sequence. The specified allocator is used to provide storage for the extensions object.

Parameters
buffersA buffer sequence representing the chunk body. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid while this object is in use.
extensionsThe 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.
allocatorThe allocator to provide storage for the moved or copied extensions object.
Note
This function participates in overload resolution only if ChunkExtensions meets the requirements stated above.
See also
https://tools.ietf.org/html/rfc7230#section-4.1

Member Function Documentation

template<class ConstBufferSequence>
const_iterator boost::beast::http::chunk_body< ConstBufferSequence >::begin ( ) const
inline

Required for ConstBufferSequence.

template<class ConstBufferSequence>
const_iterator boost::beast::http::chunk_body< ConstBufferSequence >::end ( ) const
inline

Required for ConstBufferSequence.


The documentation for this class was generated from the following files: