MySQL 9.6.0
Source Code Documentation
mysql::strconv::detail::Representation_string< String_tp > Class Template Reference

Represent a string as an object, typically std::string. More...

#include <out_str.h>

Inheritance diagram for mysql::strconv::detail::Representation_string< String_tp >:
[legend]

Public Member Functions

 Representation_string (String_tp &str)
 Construct a new object wrapping the given str object. More...
 
char * data () const
 Return a raw pointer to the data. More...
 
std::size_t initial_capacity () const
 Before resize, return the capacity of the string. More...
 
std::size_t size () const
 After resize, return the size of the string. More...
 
- Public Member Functions inherited from mysql::ranges::Buffer_interface< Representation_string< String_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::string
 
- Static Public Attributes inherited from mysql::ranges::Buffer_interface< Representation_string< String_tp > >
static constexpr auto equality_algorithm
 
static constexpr bool equality_enabled
 
static constexpr bool hash_enabled
 

Protected Member Functions

void store_size (std::size_t size_arg) const
 Store the string size. More...
 

Protected Attributes

String_tp & m_str
 Reference to string storage. More...
 

Detailed Description

template<class String_tp>
class mysql::strconv::detail::Representation_string< String_tp >

Represent a string as an object, typically std::string.

This stores a reference to the object. The object can be a specialization of std::string, or any other class implementing data, size, and resize members.

Constructor & Destructor Documentation

◆ Representation_string()

template<class String_tp >
mysql::strconv::detail::Representation_string< String_tp >::Representation_string ( String_tp &  str)
inlineexplicit

Construct a new object wrapping the given str object.

Member Function Documentation

◆ data()

template<class String_tp >
char * mysql::strconv::detail::Representation_string< String_tp >::data ( ) const
inline

Return a raw pointer to the data.

◆ initial_capacity()

template<class String_tp >
std::size_t mysql::strconv::detail::Representation_string< String_tp >::initial_capacity ( ) const
inline

Before resize, return the capacity of the string.

◆ size()

template<class String_tp >
std::size_t mysql::strconv::detail::Representation_string< String_tp >::size ( ) const
inline

After resize, return the size of the string.

◆ store_size()

template<class String_tp >
void mysql::strconv::detail::Representation_string< String_tp >::store_size ( std::size_t  size_arg) const
inlineprotected

Store the string size.

Member Data Documentation

◆ m_str

template<class String_tp >
String_tp& mysql::strconv::detail::Representation_string< String_tp >::m_str
protected

Reference to string storage.

◆ representation_type

template<class String_tp >
constexpr auto mysql::strconv::detail::Representation_string< String_tp >::representation_type = Representation_type::string
staticconstexpr

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