Paho C++
1.0
The Paho MQTT C++ Client Library
|
A reference to a contiguous sequence of items, with no ownership. More...
#include <buffer_view.h>
Public Types | |
using | value_type = T |
The type of items to be held in the queue. More... | |
using | size_type = size_t |
The type used to specify number of items in the container. More... | |
Public Member Functions | |
buffer_view (const value_type *data, size_type n) | |
Constructs a buffer view. More... | |
buffer_view (const std::basic_string< value_type > &str) | |
Constructs a buffer view to a whole string. More... | |
const value_type * | data () const |
Gets a pointer the first item in the view. More... | |
size_type | size () const |
Gets the number of items in the view. More... | |
size_type | length () const |
Gets the number of items in the view. More... | |
const value_type & | operator[] (size_t i) const |
Access an item in the view. More... | |
std::basic_string< value_type > | str () const |
Gets a copy of the view as a string. More... | |
string | to_string () const |
Gets a copy of the view as a string. More... | |
A reference to a contiguous sequence of items, with no ownership.
This simply contains a pointer to a const array of items, and a size. This is a similar, but simplified version of the std::string_view class(es) in the C++17 standard.
using mqtt::buffer_view< T >::size_type = size_t |
The type used to specify number of items in the container.
using mqtt::buffer_view< T >::value_type = T |
The type of items to be held in the queue.
|
inline |
Constructs a buffer view.
data | The data pointer |
n | The number of items |
|
inline |
Constructs a buffer view to a whole string.
This the starting pointer and length of the whole string.
str | The string. |
|
inline |
Gets a pointer the first item in the view.
|
inline |
Gets the number of items in the view.
|
inline |
Access an item in the view.
i | The index of the item. |
|
inline |
Gets the number of items in the view.
|
inline |
Gets a copy of the view as a string.
|
inline |
Gets a copy of the view as a string.