|
| | dynamic_string_buffer (std::basic_string< Elem, Traits, Allocator > &s, std::size_t maximum_size=(std::numeric_limits< std::size_t >::max)()) ASIO_NOEXCEPT |
| | Construct a dynamic buffer from a string. More...
|
| |
|
| dynamic_string_buffer (const dynamic_string_buffer &other) ASIO_NOEXCEPT |
| | DynamicBuffer_v2: Copy construct a dynamic buffer.
|
| |
| std::size_t | size () const ASIO_NOEXCEPT |
| | DynamicBuffer_v1: Get the size of the input sequence. More...
|
| |
| std::size_t | max_size () const ASIO_NOEXCEPT |
| | Get the maximum size of the dynamic buffer. More...
|
| |
| std::size_t | capacity () const ASIO_NOEXCEPT |
| | Get the maximum size that the buffer may grow to without triggering reallocation. More...
|
| |
| const_buffers_type | data () const ASIO_NOEXCEPT |
| | DynamicBuffer_v1: Get a list of buffers that represents the input sequence. More...
|
| |
| mutable_buffers_type | data (std::size_t pos, std::size_t n) ASIO_NOEXCEPT |
| | DynamicBuffer_v2: Get a sequence of buffers that represents the underlying memory. More...
|
| |
| const_buffers_type | data (std::size_t pos, std::size_t n) const ASIO_NOEXCEPT |
| | DynamicBuffer_v2: Get a sequence of buffers that represents the underlying memory. More...
|
| |
| mutable_buffers_type | prepare (std::size_t n) |
| | DynamicBuffer_v1: Get a list of buffers that represents the output sequence, with the given size. More...
|
| |
| void | commit (std::size_t n) |
| | DynamicBuffer_v1: Move bytes from the output sequence to the input sequence. More...
|
| |
| void | grow (std::size_t n) |
| | DynamicBuffer_v2: Grow the underlying memory by the specified number of bytes. More...
|
| |
| void | shrink (std::size_t n) |
| | DynamicBuffer_v2: Shrink the underlying memory by the specified number of bytes. More...
|
| |
| void | consume (std::size_t n) |
| | DynamicBuffer_v1: Remove characters from the input sequence. More...
|
| |
template<typename Elem, typename Traits, typename Allocator>
class asio::dynamic_string_buffer< Elem, Traits, Allocator >
Adapt a basic_string to the DynamicBuffer requirements.
Requires that sizeof(Elem) == 1.
template<typename Elem, typename Traits, typename Allocator>
DynamicBuffer_v1: Move bytes from the output sequence to the input sequence.
- Parameters
-
| n | The number of bytes to append from the start of the output sequence to the end of the input sequence. The remainder of the output sequence is discarded. |
Requires a preceding call prepare(x) where x >= n, and no intervening operations that modify the input or output sequence.
- Note
- If
n is greater than the size of the output sequence, the entire output sequence is moved to the input sequence and no error is issued.
template<typename Elem, typename Traits, typename Allocator>
DynamicBuffer_v1: Remove characters from the input sequence.
DynamicBuffer_v2: Consume the specified number of bytes from the beginning of the underlying memory. DynamicBuffer_v1: Removes n characters from the beginning of the input sequence.
- Note
- If
n is greater than the size of the input sequence, the entire input sequence is consumed and no error is issued.
DynamicBuffer_v2: Erases n bytes from the beginning of the string. If n is greater than the current size of the string, the string is emptied.
template<typename Elem, typename Traits, typename Allocator>
DynamicBuffer_v1: Get a list of buffers that represents the output sequence, with the given size.
Ensures that the output sequence can accommodate n bytes, resizing the basic_string object as necessary.
- Returns
- An object of type
mutable_buffers_type that satisfies MutableBufferSequence requirements, representing basic_string memory at the start of the output sequence of size n.
- Exceptions
-
- Note
- The returned object is invalidated by any
dynamic_string_buffer or basic_string member function that modifies the input sequence or output sequence.
template<typename Elem, typename Traits, typename Allocator>
DynamicBuffer_v2: Shrink the underlying memory by the specified number of bytes.
Erases n bytes from the end of the string by resizing the basic_string object. If n is greater than the current size of the string, the string is emptied.