MySQL  8.0.17
Source Code Documentation
Name_string Class Reference

Storage for name strings. More...

#include <item.h>

Inheritance diagram for Name_string:
Simple_cstring Item_name_string

Public Member Functions

 Name_string ()
 
 Name_string (const char *str, size_t length)
 
 Name_string (const LEX_STRING str)
 
 Name_string (const char *str, size_t length, bool is_null_terminated)
 
 Name_string (const LEX_STRING str, bool is_null_terminated)
 
void copy (const char *str, size_t length, const CHARSET_INFO *cs)
 Allocate space using sql_strmake() or sql_strmake_with_convert(). More...
 
void copy (const char *str, size_t length)
 Variants for copy(), for various argument combinations. More...
 
void copy (const char *str)
 
void copy (const LEX_STRING lex)
 
void copy (const LEX_STRING *lex)
 
void copy (const Name_string str)
 
bool eq (const char *str) const
 Compare name to another name in C string, case insensitively. More...
 
bool eq_safe (const char *str) const
 
bool eq (const Name_string name) const
 Compare name to another name in Name_string, case insensitively. More...
 
bool eq_safe (const Name_string name) const
 
- Public Member Functions inherited from Simple_cstring
void set (const char *str_arg, size_t length_arg)
 Initialize from a C string whose length is already known. More...
 
 Simple_cstring ()
 
 Simple_cstring (const char *str_arg, size_t length_arg)
 
 Simple_cstring (const LEX_STRING arg)
 
void reset ()
 
void set (const char *str)
 Set to a null-terminated string. More...
 
const char * ptr () const
 Return string buffer. More...
 
bool is_set () const
 Check if m_ptr is set. More...
 
size_t length () const
 Return name length. More...
 
bool eq_bin (const Simple_cstring other) const
 Compare to another Simple_cstring. More...
 
void strcpy (char *buff) const
 Copy to the given buffer. More...
 

Private Member Functions

void set_or_copy (const char *str, size_t length, bool is_null_terminated)
 

Detailed Description

Storage for name strings.

Enpowers Simple_cstring with allocation routines from the sql_strmake family.

This class must stay as small as possible as we often pass it into functions using call-by-value evaluation.

Don't add new members or virual methods into this class!

Constructor & Destructor Documentation

◆ Name_string() [1/5]

Name_string::Name_string ( )
inline

◆ Name_string() [2/5]

Name_string::Name_string ( const char *  str,
size_t  length 
)
inline

◆ Name_string() [3/5]

Name_string::Name_string ( const LEX_STRING  str)
inline

◆ Name_string() [4/5]

Name_string::Name_string ( const char *  str,
size_t  length,
bool  is_null_terminated 
)
inline

◆ Name_string() [5/5]

Name_string::Name_string ( const LEX_STRING  str,
bool  is_null_terminated 
)
inline

Member Function Documentation

◆ copy() [1/6]

void Name_string::copy ( const char *  str,
size_t  length,
const CHARSET_INFO cs 
)

Allocate space using sql_strmake() or sql_strmake_with_convert().

◆ copy() [2/6]

void Name_string::copy ( const char *  str,
size_t  length 
)
inline

Variants for copy(), for various argument combinations.

◆ copy() [3/6]

void Name_string::copy ( const char *  str)
inline

◆ copy() [4/6]

void Name_string::copy ( const LEX_STRING  lex)
inline

◆ copy() [5/6]

void Name_string::copy ( const LEX_STRING lex)
inline

◆ copy() [6/6]

void Name_string::copy ( const Name_string  str)
inline

◆ eq() [1/2]

bool Name_string::eq ( const char *  str) const
inline

Compare name to another name in C string, case insensitively.

◆ eq() [2/2]

bool Name_string::eq ( const Name_string  name) const
inline

Compare name to another name in Name_string, case insensitively.

◆ eq_safe() [1/2]

bool Name_string::eq_safe ( const char *  str) const
inline

◆ eq_safe() [2/2]

bool Name_string::eq_safe ( const Name_string  name) const
inline

◆ set_or_copy()

void Name_string::set_or_copy ( const char *  str,
size_t  length,
bool  is_null_terminated 
)
inlineprivate

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