MySQL 9.1.0
Source Code Documentation
|
Non-owning view of a memory buffer with a fixed size. More...
#include <buffer_view.h>
Public Types | |
using | Char_t = Char_tp |
using | Size_t = std::size_t |
The 'size' type. More... | |
using | Iterator_t = Char_t * |
using | Const_iterator_t = const Char_t * |
Public Member Functions | |
Buffer_view (Char_t *data, Size_t size) | |
Create a new Buffer_view with the specified size and data. More... | |
Buffer_view ()=default | |
Create a new "null Buffer_view": pointer is nullptr and size is 0. More... | |
Buffer_view (const Buffer_view &)=default | |
Shallow copy constructor. More... | |
Buffer_view (Buffer_view &&) noexcept=default | |
Default move constructor. More... | |
Buffer_view & | operator= (const Buffer_view &)=default |
Shallow copy assignment operator. More... | |
Buffer_view & | operator= (Buffer_view &&) noexcept=default |
Default move assignment operator. More... | |
virtual | ~Buffer_view ()=default |
Default delete operator. More... | |
const Char_t * | data () const |
Return const pointer to the data. More... | |
Char_t * | data () |
Return non-const pointer to the data. More... | |
Iterator_t | begin () |
Return pointer to the first character of the data. More... | |
Iterator_t | end () |
Return pointer to one-past-the-last character of the data. More... | |
Const_iterator_t | begin () const |
Return pointer to the first character of the data. More... | |
Const_iterator_t | end () const |
Return pointer to one-past-the-last character of the data. More... | |
Const_iterator_t | cbegin () const |
Return const pointer to the first character of the data. More... | |
Const_iterator_t | cend () const |
Return const pointer to one-past-the-last character of the data. More... | |
Size_t | size () const |
Return the number of bytes. More... | |
template<class Str_char_t = char, class Str_traits_t = std::char_traits<Str_char_t>, class Str_allocator_t = std::allocator<Str_char_t>> | |
std::basic_string< Str_char_t, Str_traits_t, Str_allocator_t > | str (const Str_allocator_t &allocator=Str_allocator_t()) const |
Return a copy of this object as a std::string . More... | |
std::string | debug_string (bool show_contents=false) const |
In debug mode, return a string with debug info. More... | |
Private Attributes | |
Char_t * | m_data {nullptr} |
Pointer to the data. More... | |
Size_t | m_size {0} |
The number of bytes. More... | |
Non-owning view of a memory buffer with a fixed size.
This is a minimal class holding just a pointer and a size. It does not have a read/write position (
using mysql::containers::buffers::Buffer_view< Char_tp >::Char_t = Char_tp |
using mysql::containers::buffers::Buffer_view< Char_tp >::Const_iterator_t = const Char_t * |
using mysql::containers::buffers::Buffer_view< Char_tp >::Iterator_t = Char_t * |
using mysql::containers::buffers::Buffer_view< Char_tp >::Size_t = std::size_t |
The 'size' type.
Keep this equal to Grow_calculator::Size_t
|
inline |
Create a new Buffer_view with the specified size and data.
|
default |
Create a new "null Buffer_view": pointer is nullptr and size is 0.
|
default |
Shallow copy constructor.
|
defaultnoexcept |
Default move constructor.
|
virtualdefault |
Default delete operator.
|
inline |
Return pointer to the first character of the data.
|
inline |
Return pointer to the first character of the data.
|
inline |
Return const pointer to the first character of the data.
|
inline |
Return const pointer to one-past-the-last character of the data.
|
inline |
Return non-const pointer to the data.
|
inline |
Return const pointer to the data.
|
inline |
In debug mode, return a string with debug info.
show_contents | If true, includes the buffer contents. Otherwise, just pointers and sizes. |
|
inline |
Return pointer to one-past-the-last character of the data.
|
inline |
Return pointer to one-past-the-last character of the data.
|
defaultnoexcept |
Default move assignment operator.
|
default |
Shallow copy assignment operator.
|
inline |
Return the number of bytes.
|
inline |
Return a copy of this object as a std::string
.
|
private |
Pointer to the data.
|
private |
The number of bytes.