![]() |
MySQL 8.0.43
Source Code Documentation
|
A wrapper class for null-terminated constant strings. More...
#include <sql_string.h>
Public Member Functions | |
| 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) | |
| Simple_cstring (const LEX_CSTRING 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 Attributes | |
| const char * | m_str |
| size_t | m_length |
A wrapper class for null-terminated constant strings.
Constructors make sure that the position of the '\0' terminating byte in m_str is always in sync with m_length.
This class must stay as small as possible as we often pass it and its descendants (such as Name_string) into functions using call-by-value evaluation.
Don't add new members or virtual methods to this class!
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Compare to another Simple_cstring.
|
inline |
Check if m_ptr is set.
|
inline |
Return name length.
|
inline |
Return string buffer.
|
inline |
|
inline |
Set to a null-terminated string.
|
inline |
Initialize from a C string whose length is already known.
|
inline |
Copy to the given buffer.
|
private |
|
private |