MySQL  8.0.28
Source Code Documentation
mysqlrouter::sqlstring Class Reference

#include <utils_sqlstring.h>

Classes

struct  sqlstringformat
 

Public Member Functions

 sqlstring ()
 
 sqlstring (const char *format_string, const sqlstringformat format=0)
 
 sqlstring (const sqlstring &copy)
 
sqlstringoperator= (const sqlstring &)=default
 
bool done () const
 
 operator std::string () const
 
std::string str () const
 
sqlstringoperator<< (const sqlstringformat)
 modifies formatting options More...
 
sqlstringoperator<< (const float val)
 replaces a ? in the format string with a float numeric value More...
 
sqlstringoperator<< (const double)
 replaces a ? in the format string with a double numeric value More...
 
sqlstringoperator<< (const std::string &)
 replaces a ? in the format string with a quoted string value or ! with a back-quoted identifier value More...
 
sqlstringoperator<< (const char *)
 replaces a ? in the format string with a quoted string value or ! with a back-quoted identifier value is the value is NULL, ? will be replaced with a NULL. More...
 
sqlstringoperator<< (const sqlstring &)
 replaces a ? or ! with the content of the other string verbatim More...
 
template<typename T >
sqlstringoperator<< (const T value)
 replaces a ? in the format string with any integer numeric value More...
 

Static Public Attributes

static const sqlstring null
 
static const sqlstring end
 

Private Member Functions

std::string consume_until_next_escape ()
 
int next_escape ()
 
sqlstringappend (const std::string &s)
 

Private Attributes

std::string _formatted
 
std::string _format_string_left
 
sqlstringformat _format
 

Constructor & Destructor Documentation

◆ sqlstring() [1/3]

mysqlrouter::sqlstring::sqlstring ( )

◆ sqlstring() [2/3]

mysqlrouter::sqlstring::sqlstring ( const char *  format_string,
const sqlstringformat  format = 0 
)

◆ sqlstring() [3/3]

mysqlrouter::sqlstring::sqlstring ( const sqlstring copy)
default

Member Function Documentation

◆ append()

sqlstring & mysqlrouter::sqlstring::append ( const std::string &  s)
private

◆ consume_until_next_escape()

std::string mysqlrouter::sqlstring::consume_until_next_escape ( )
private

◆ done()

bool mysqlrouter::sqlstring::done ( ) const

◆ next_escape()

int mysqlrouter::sqlstring::next_escape ( )
private

◆ operator std::string()

mysqlrouter::sqlstring::operator std::string ( ) const

◆ operator<<() [1/7]

sqlstring & mysqlrouter::sqlstring::operator<< ( const char *  v)

replaces a ? in the format string with a quoted string value or ! with a back-quoted identifier value is the value is NULL, ? will be replaced with a NULL.

! will raise an exception

◆ operator<<() [2/7]

sqlstring & mysqlrouter::sqlstring::operator<< ( const double  v)

replaces a ? in the format string with a double numeric value

◆ operator<<() [3/7]

sqlstring& mysqlrouter::sqlstring::operator<< ( const float  val)
inline

replaces a ? in the format string with a float numeric value

◆ operator<<() [4/7]

sqlstring & mysqlrouter::sqlstring::operator<< ( const sqlstring v)

replaces a ? or ! with the content of the other string verbatim

◆ operator<<() [5/7]

sqlstring & mysqlrouter::sqlstring::operator<< ( const sqlstringformat  format)

modifies formatting options

◆ operator<<() [6/7]

sqlstring & mysqlrouter::sqlstring::operator<< ( const std::string &  v)

replaces a ? in the format string with a quoted string value or ! with a back-quoted identifier value

◆ operator<<() [7/7]

template<typename T >
sqlstring& mysqlrouter::sqlstring::operator<< ( const T  value)
inline

replaces a ? in the format string with any integer numeric value

◆ operator=()

sqlstring& mysqlrouter::sqlstring::operator= ( const sqlstring )
default

◆ str()

std::string mysqlrouter::sqlstring::str ( ) const

Member Data Documentation

◆ _format

sqlstringformat mysqlrouter::sqlstring::_format
private

◆ _format_string_left

std::string mysqlrouter::sqlstring::_format_string_left
private

◆ _formatted

std::string mysqlrouter::sqlstring::_formatted
private

◆ end

const sqlstring mysqlrouter::sqlstring::end
static

◆ null

const sqlstring mysqlrouter::sqlstring::null
static

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