MySQL 9.6.0
Source Code Documentation
mysql::strconv::detail::Representation_ptrsize< Ptr_tp, Size_tp > Class Template Reference

Represent a string as raw pointer to the beginning, and integer size. More...

#include <out_str.h>

Inheritance diagram for mysql::strconv::detail::Representation_ptrsize< Ptr_tp, Size_tp >:
[legend]

Public Member Functions

 Representation_ptrsize (Ptr_tp first, Size_tp &size_arg, Size_tp capacity)
 Construct a new object from the given begin pointer, reference to size, and capacity. More...
 
std::size_t size () const
 After resize, return the value of the size field. More...
 
- Public Member Functions inherited from mysql::strconv::detail::Representation_ptr_base< Representation_ptrsize< Ptr_tp, Size_tp >, Ptr_tp >
 Representation_ptr_base (Ptr_tp first, std::size_t capacity)
 Construct a new object wrapping the buffer at the given position. More...
 
char * data () const
 Return pointer to the data. More...
 
std::size_t initial_capacity () const
 Before resize, return the value of the size field. More...
 
- Public Member Functions inherited from mysql::ranges::Buffer_interface< Self_tp, equality_algorithm_tp, enable_hash_tp >
 operator bool () const
 Return true if size() != 0. More...
 
bool operator! () const
 Return true if size() == 0. More...
 
bool empty () const
 Return true if size() == 0. More...
 
std::ptrdiff_t ssize () const
 Return the size as std::ptrdiff_t. More...
 
auto * udata ()
 Return the data buffer as unsigned char *. More...
 
auto * udata () const
 Return the data buffer as const unsigned char * or unsigned char *, const-ness inherited from Self_t::data() const. More...
 
auto * bdata ()
 Return the data buffer as std::byte *. More...
 
auto * bdata () const
 Return the data buffer as const std::byte * or std::byte *, const-ness inherited from Self_t::data() const. More...
 
std::string_view string_view () const
 
auto * begin ()
 Return the begin as char *. More...
 
auto * begin () const
 Return the begin as const char * or char *, const-ness inherited from Self_t::data() const. More...
 
auto * cbegin () const
 Return the begin as const char * or char *, const-ness inherited from Self_t::data() const. More...
 
auto * ubegin ()
 Return the begin as unsigned char *. More...
 
auto * ubegin () const
 Return the begin as const unsigned char * or unsigned char *, const-ness inherited from Self_t::data() const. More...
 
auto * cubegin () const
 Return the begin as const unsigned char * or unsigned char *, const-ness inherited from Self_t::data() const. More...
 
auto * bbegin ()
 Return the begin as std::byte *. More...
 
auto * bbegin () const
 Return the begin as const std::byte * or std::byte *, const-ness inherited from Self_t::data() const. More...
 
auto * cbbegin () const
 Return the begin as const std::byte * or std::byte *, const-ness inherited from Self_t::data() const. More...
 
auto * end ()
 Return the end as char *. More...
 
auto * end () const
 Return the end as const char * or char *, const-ness inherited from Self_t::data() const. More...
 
auto * cend () const
 Return the end as const char * or char *, const-ness inherited from Self_t::data() const. More...
 
auto * uend ()
 Return the end as unsigned char *. More...
 
auto * uend () const
 Return the end as const unsigned char * or unsigned char *, const-ness inherited from Self_t::data() const. More...
 
auto * cuend () const
 Return the end as const unsigned char * or unsigned char *, const-ness inherited from Self_t::data() const. More...
 
auto * bend ()
 Return the end as std::byte *. More...
 
auto * bend () const
 Return the end as const std::byte * or std::byte *, const-ness inherited from Self_t::data() const. More...
 
auto * cbend () const
 Return the end as const std::byte * or or std::byte *, const-ness inherited from Self_t::data() const. More...
 
char & operator[] (std::ptrdiff_t n)
 Return reference the n'th element. More...
 
char operator[] (std::ptrdiff_t n) const
 Return the n'th element, const-ness inherited from Self_t::data() const. More...
 

Static Public Attributes

static constexpr auto representation_type = Representation_type::ptrsize
 
- Static Public Attributes inherited from mysql::ranges::Buffer_interface< Self_tp, equality_algorithm_tp, enable_hash_tp >
static constexpr auto equality_algorithm = equality_algorithm_tp
 
static constexpr bool equality_enabled
 
static constexpr bool hash_enabled = (enable_hash_tp == Enable_hash::yes)
 

Protected Member Functions

void store_size (std::size_t size_arg) const
 Alter the size field. More...
 

Protected Attributes

Size_tp & m_size
 Reference to integral size. More...
 
- Protected Attributes inherited from mysql::strconv::detail::Representation_ptr_base< Representation_ptrsize< Ptr_tp, Size_tp >, Ptr_tp >
Ptr_tp m_first
 Pointer to first character. More...
 
std::size_t m_initial_capacity
 Initial capacity. More...
 

Private Types

using Base_t = Representation_ptr_base< Representation_ptrsize< Ptr_tp, Size_tp >, Ptr_tp >
 

Detailed Description

template<class Ptr_tp, std::integral Size_tp>
class mysql::strconv::detail::Representation_ptrsize< Ptr_tp, Size_tp >

Represent a string as raw pointer to the beginning, and integer size.

This stores the pointer and integer. The size is always a reference; the beginning is optinally a reference (determined by the template argument).

Template Parameters
Ptr_tpType of char pointer to the beginning: either char *&, if the buffer is resizable, or char *, for fixed-size buffers.
Size_tpType of size field.

Member Typedef Documentation

◆ Base_t

template<class Ptr_tp , std::integral Size_tp>
using mysql::strconv::detail::Representation_ptrsize< Ptr_tp, Size_tp >::Base_t = Representation_ptr_base<Representation_ptrsize<Ptr_tp, Size_tp>, Ptr_tp>
private

Constructor & Destructor Documentation

◆ Representation_ptrsize()

template<class Ptr_tp , std::integral Size_tp>
mysql::strconv::detail::Representation_ptrsize< Ptr_tp, Size_tp >::Representation_ptrsize ( Ptr_tp  first,
Size_tp &  size_arg,
Size_tp  capacity 
)
inlineexplicit

Construct a new object from the given begin pointer, reference to size, and capacity.

Member Function Documentation

◆ size()

template<class Ptr_tp , std::integral Size_tp>
std::size_t mysql::strconv::detail::Representation_ptrsize< Ptr_tp, Size_tp >::size ( ) const
inline

After resize, return the value of the size field.

◆ store_size()

template<class Ptr_tp , std::integral Size_tp>
void mysql::strconv::detail::Representation_ptrsize< Ptr_tp, Size_tp >::store_size ( std::size_t  size_arg) const
inlineprotected

Alter the size field.

Member Data Documentation

◆ m_size

template<class Ptr_tp , std::integral Size_tp>
Size_tp& mysql::strconv::detail::Representation_ptrsize< Ptr_tp, Size_tp >::m_size
protected

Reference to integral size.

◆ representation_type

template<class Ptr_tp , std::integral Size_tp>
constexpr auto mysql::strconv::detail::Representation_ptrsize< Ptr_tp, Size_tp >::representation_type = Representation_type::ptrsize
staticconstexpr

The documentation for this class was generated from the following file: