asio C++ library

PrevUpHomeNext

dynamic_string_buffer

Adapt a basic_string to the DynamicBuffer requirements.

template<
    typename Elem,
    typename Traits,
    typename Allocator>
class dynamic_string_buffer
Types

Name

Description

const_buffers_type

The type used to represent a sequence of constant buffers that refers to the underlying memory.

mutable_buffers_type

The type used to represent a sequence of mutable buffers that refers to the underlying memory.

Member Functions

Name

Description

capacity

Get the maximum size that the buffer may grow to without triggering reallocation.

commit

DynamicBuffer_v1: Move bytes from the output sequence to the input sequence.

consume

DynamicBuffer_v1: Remove characters from the input sequence. DynamicBuffer_v2: Consume the specified number of bytes from the beginning of the underlying memory.

data

DynamicBuffer_v1: Get a list of buffers that represents the input sequence.

DynamicBuffer_v2: Get a sequence of buffers that represents the underlying memory.

dynamic_string_buffer

Construct a dynamic buffer from a string.

DynamicBuffer_v2: Copy construct a dynamic buffer.

Move construct a dynamic buffer.

grow

DynamicBuffer_v2: Grow the underlying memory by the specified number of bytes.

max_size

Get the maximum size of the dynamic buffer.

prepare

DynamicBuffer_v1: Get a list of buffers that represents the output sequence, with the given size.

shrink

DynamicBuffer_v2: Shrink the underlying memory by the specified number of bytes.

size

DynamicBuffer_v1: Get the size of the input sequence. DynamicBuffer_v2: Get the current size of the underlying memory.

Requires that sizeof(Elem) == 1.

Requirements

Header: asio/buffer.hpp

Convenience header: asio.hpp


PrevUpHomeNext