buffer that has string_view interface This class provides string_view interface. This class hold string_view target's lifetime optionally.
More...
#include <buffer.hpp>
|
constexpr | buffer (string_view sv) |
| string_view constructor
|
|
| buffer (std::string)=delete |
| string constructor (deleted)
|
|
| buffer (string_view sv, any life) |
| string_view and lifetime constructor
|
|
buffer | substr (size_type pos=0, size_type count=npos) const & |
| get substring The returned buffer ragnge is the same as string_view::substr(). In addition the lifetime is shared between returned buffer and this buffer.
|
|
buffer | substr (size_type pos=0, size_type count=npos) && |
| get substring The returned buffer ragnge is the same as string_view::substr(). In addition the lifetime is moved to returned buffer.
|
|
buffer that has string_view interface This class provides string_view interface. This class hold string_view target's lifetime optionally.
◆ buffer() [1/3]
constexpr async_mqtt::buffer::buffer |
( |
string_view | sv | ) |
|
|
inlineexplicitconstexpr |
string_view constructor
- Parameters
-
sv | string_view This constructor doesn't hold the sv target's lifetime. It behaves as string_view. Caller needs to manage the target lifetime. |
◆ buffer() [2/3]
async_mqtt::buffer::buffer |
( |
std::string | | ) |
|
|
explicitdelete |
string constructor (deleted)
- Parameters
-
string | This constructor is intentionally deleted. Consider buffer(std::string("ABC")) , the buffer points to dangling reference. |
◆ buffer() [3/3]
async_mqtt::buffer::buffer |
( |
string_view | sv, |
|
|
any | life ) |
|
inline |
string_view and lifetime constructor
- Parameters
-
sv | string_view |
sp | shared_ptr_array that holds sv target's lifetime If user creates buffer via this constructor, sp's lifetime is held by the buffer. |
◆ substr() [1/2]
buffer async_mqtt::buffer::substr |
( |
size_type | pos = 0, |
|
|
size_type | count = npos ) && |
|
inline |
get substring The returned buffer ragnge is the same as string_view::substr(). In addition the lifetime is moved to returned buffer.
- Parameters
-
offset | offset point of the buffer |
length | length of the buffer, If the length is string_view::npos then the length is from offset to the end of string. |
◆ substr() [2/2]
buffer async_mqtt::buffer::substr |
( |
size_type | pos = 0, |
|
|
size_type | count = npos ) const & |
|
inline |
get substring The returned buffer ragnge is the same as string_view::substr(). In addition the lifetime is shared between returned buffer and this buffer.
- Parameters
-
offset | offset point of the buffer |
length | length of the buffer, If the length is string_view::npos then the length is from offset to the end of string. |
The documentation for this class was generated from the following file:
- /home/kondo/work/async_mqtt/include/async_mqtt/buffer.hpp