MySQL  8.0.19
Source Code Documentation
mysql_string_imp Class Reference

The string functions as a service to the mysql_server component. More...

#include <mysql_string_service.h>

Static Public Member Functions

static mysql_service_status_t create (my_h_string *out_string) noexcept
 Creates a new instance of string object. More...
 
static void destroy (my_h_string string) noexcept
 Destroys specified string object and data contained by it. More...
 
static mysql_service_status_t tolower (my_h_string *out_string, my_h_string in_string) noexcept
 Convert a String pointed by handle to lower case. More...
 
static mysql_service_status_t toupper (my_h_string *out_string, my_h_string in_string) noexcept
 Convert a String pointed by handle to upper case. More...
 
static mysql_service_status_t convert_from_buffer (my_h_string *out_string, const char *in_buffer, uint64 length, const char *charset_name) noexcept
 alocates a string object and converts the character buffer to string of specified charset_name. More...
 
static mysql_service_status_t convert_to_buffer (my_h_string in_string, char *out_buffer, uint64 length, const char *charset_name) noexcept
 converts the mysql_string to the character set specified by charset_name parameter. More...
 
static mysql_service_status_t get_char (my_h_string string, uint index, ulong *out_char) noexcept
 Gets character code of character on specified index position in string to a specified buffer. More...
 
static mysql_service_status_t get_char_length (my_h_string string, uint *out_length) noexcept
 Gets length of specified string expressed as number of characters. More...
 
static mysql_service_status_t get_byte (my_h_string string, uint index, uint *out_char) noexcept
 Gets byte code of string at specified index position to a specified 32-bit buffer. More...
 
static mysql_service_status_t get_byte_length (my_h_string string, uint *out_length) noexcept
 Gets length of specified string expressed as number of bytes. More...
 
static mysql_service_status_t iterator_create (my_h_string string, my_h_string_iterator *out_iterator) noexcept
 Creates an iterator for a specified string to allow iteration through all characters in the string. More...
 
static mysql_service_status_t iterator_get_next (my_h_string_iterator iter, int *out_char) noexcept
 Retrieves character code at current iterator position and advances the iterator. More...
 
static void iterator_destroy (my_h_string_iterator iter) noexcept
 Releases the string iterator object specified. More...
 
static mysql_service_status_t is_upper (my_h_string_iterator iter, bool *out) noexcept
 Checks if character on current position the iterator points to is an upper case. More...
 
static mysql_service_status_t is_lower (my_h_string_iterator iter, bool *out) noexcept
 Checks if character on current position the iterator points to is a lower case. More...
 
static mysql_service_status_t is_digit (my_h_string_iterator iter, bool *out) noexcept
 Checks if character on current position the iterator points to is a digit. More...
 

Detailed Description

The string functions as a service to the mysql_server component.

So, that by default this service is available to all the components register to the server. successful invocations of the underlying String Service Implementation methods.

Member Function Documentation

◆ convert_from_buffer()

mysql_service_status_t mysql_string_imp::convert_from_buffer ( my_h_string out_string,
const char *  in_buffer,
uint64  length,
const char *  charset_name 
)
staticnoexcept

alocates a string object and converts the character buffer to string of specified charset_name.

Allocates a string object and converts the character buffer to string and just sets the specified charset_name in the string object.

please call destroy() api to free the allocated string after this api.

Parameters
[out]out_stringPointer to string object handle to set new string to.
in_bufferPointer to the buffer with data to be interpreted as string.
lengthLength of the buffer to copy into string, in bytes, not in character count.
charset_namecharset that is used for convertion.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

It does not performs the conversion of buffer into the specified character set. Caller must free the allocated string by calling destroy() api.

Parameters
[out]out_stringPointer to string object handle to set new string to.
in_bufferPointer to the buffer with data to be interpreted as string.
lengthLength of the buffer to copy in bytes, not in character count.
charset_nameHandle to charset that is used for convertion.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ convert_to_buffer()

mysql_service_status_t mysql_string_imp::convert_to_buffer ( my_h_string  in_string,
char *  out_buffer,
uint64  length,
const char *  charset_name 
)
staticnoexcept

converts the mysql_string to the character set specified by charset_name parameter.

converts the mysql_string to the character buffer specified by charset_name parameter.

Parameters
in_stringPointer to string object handle to set new string to.
[out]out_bufferPointer to the buffer with data to be interpreted as characters.
lengthLength of the buffer to hold out put in characters.
charset_namecharset that is used for convertion.
Returns
Status of performed operation
Return values
falsesuccess
truefailure
Parameters
[out]out_bufferPointer to char buffer used to hold the converted string.
in_stringpointer to string handle which will be converted to char data.
lengthLength of the buffer to copy in bytes, not in character count.
charset_nameHandle to charset that is used for convertion.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ create()

mysql_service_status_t mysql_string_imp::create ( my_h_string out_string)
staticnoexcept

Creates a new instance of string object.

Parameters
out_stringholds pointer to newly created string object.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ destroy()

void mysql_string_imp::destroy ( my_h_string  string)
staticnoexcept

Destroys specified string object and data contained by it.

Parameters
stringString object handle to release.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ get_byte()

mysql_service_status_t mysql_string_imp::get_byte ( my_h_string  string,
uint  index,
uint out_char 
)
staticnoexcept

Gets byte code of string at specified index position to a specified 32-bit buffer.

Gets byte code of string on specified index position in string to a specified 32-bit buffer.

Parameters
stringString object handle to get character from.
indexIndex, position of character to query.
[out]out_charPointer to 32bit value to store byte to.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ get_byte_length()

mysql_service_status_t mysql_string_imp::get_byte_length ( my_h_string  string,
uint out_length 
)
staticnoexcept

Gets length of specified string expressed as number of bytes.

Parameters
stringString object handle to get length of.
[out]out_lengthPointer to 32bit value to store length of string to.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ get_char()

mysql_service_status_t mysql_string_imp::get_char ( my_h_string  string,
uint  index,
ulong out_char 
)
staticnoexcept

Gets character code of character on specified index position in string to a specified buffer.

Parameters
stringString object handle to get character from.
indexIndex, position of character to query.
[out]out_charPointer to unsinged long value to store character to.
Returns
Status of performed operation
Return values
falsesuccess
truefailure
Parameters
stringString object handle to get character from.
indexIndex, position of character to query.
[out]out_charPointer to long value to store character to.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ get_char_length()

mysql_service_status_t mysql_string_imp::get_char_length ( my_h_string  string,
uint out_length 
)
staticnoexcept

Gets length of specified string expressed as number of characters.

Parameters
stringString object handle to get length of.
[out]out_lengthPointer to 64bit value to store length of string to.
Returns
Status of performed operation
Return values
falsesuccess
truefailure
Parameters
stringString object handle to get length of.
[out]out_lengthPointer to 32bit value to store length of string to.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ is_digit()

mysql_service_status_t mysql_string_imp::is_digit ( my_h_string_iterator  iter,
bool out 
)
staticnoexcept

Checks if character on current position the iterator points to is a digit.

Parameters
iterString iterator object handle to advance.
[out]outPointer to bool value to store if character is a digit.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ is_lower()

mysql_service_status_t mysql_string_imp::is_lower ( my_h_string_iterator  iter,
bool out 
)
staticnoexcept

Checks if character on current position the iterator points to is a lower case.

Parameters
iterString iterator object handle to advance.
[out]outPointer to bool value to store if character is a lower case.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ is_upper()

mysql_service_status_t mysql_string_imp::is_upper ( my_h_string_iterator  iter,
bool out 
)
staticnoexcept

Checks if character on current position the iterator points to is an upper case.

Parameters
iterString iterator object handle to advance.
[out]outPointer to bool value to store if character is an upper case.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ iterator_create()

mysql_service_status_t mysql_string_imp::iterator_create ( my_h_string  string,
my_h_string_iterator out_iterator 
)
staticnoexcept

Creates an iterator for a specified string to allow iteration through all characters in the string.

Parameters
stringString object handle to get iterator to.
[out]out_iteratorPointer to string iterator handle to store result object to.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ iterator_destroy()

void mysql_string_imp::iterator_destroy ( my_h_string_iterator  iter)
staticnoexcept

Releases the string iterator object specified.

Parameters
iterString iterator object handle te release.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ iterator_get_next()

mysql_service_status_t mysql_string_imp::iterator_get_next ( my_h_string_iterator  iter,
int *  out_char 
)
staticnoexcept

Retrieves character code at current iterator position and advances the iterator.

Parameters
iterString iterator object handle to advance.
[out]out_charPointer to 64bit value to store character to. May be NULL to omit retrieval of character and just advance the iterator.
Returns
Status of performed operation
Return values
falsesuccess
truefailure
Parameters
iterString iterator object handle to advance.
[out]out_charPointer to 32bit value to store character to. May be NULL to omit retrieval of character and just advance the iterator.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ tolower()

mysql_service_status_t mysql_string_imp::tolower ( my_h_string out_string,
my_h_string  in_string 
)
staticnoexcept

Convert a String pointed by handle to lower case.

Conversion depends on the client character set info

Parameters
out_stringHolds the converted lower case string object.
in_stringPointer to string object to be converted.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ toupper()

mysql_service_status_t mysql_string_imp::toupper ( my_h_string out_string,
my_h_string  in_string 
)
staticnoexcept

Convert a String pointed by handle to upper case.

Conversion depends on the client character set info

Parameters
out_stringHolds the converted upper case string object.
in_stringPointer to string object to be converted.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

Conversion depends on the client character set info

Parameters
out_stringHolds the converted lower case string object.
in_stringPointer to string object to be converted.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

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