MySQL 9.0.0
Source Code Documentation
mysql_string_imp Class Reference

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

#include <mysql_string_service_imp.h>

Static Public Member Functions

static CHARSET_INFO_h get_charset_utf8mb4 () noexcept
 
static CHARSET_INFO_h get_charset_by_name (const char *name) noexcept
 
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
 Allocates a string object and converts the character buffer to string and just sets the specified charset_name in the string object. 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 convert_from_buffer_v2 (my_h_string dest_string, const char *src_buffer, uint64 src_length, CHARSET_INFO_h src_charset) noexcept
 
static mysql_service_status_t convert_to_buffer_v2 (my_h_string src_string, char *dest_buffer, uint64 dest_length, CHARSET_INFO_h dest_charset) noexcept
 
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...
 
static mysql_service_status_t get (my_h_string_iterator iter, ulong *out) noexcept
 Retrieves character value at current iterator position. More...
 
static mysql_service_status_t reset (my_h_string s) noexcept
 
static mysql_service_status_t append (my_h_string s1, my_h_string s2) noexcept
 
static mysql_service_status_t substr (my_h_string in_string, uint offset, uint count, my_h_string *out_string) noexcept
 Allocates a string object and sets it value as substring of the input string. More...
 
static mysql_service_status_t compare (my_h_string s1, my_h_string s2, int *cmp) noexcept
 
static mysql_service_status_t get_data (my_h_string s, const char **buffer_pointer, size_t *buffer_length, CHARSET_INFO_h *buffer_charset) noexcept
 

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

◆ append()

mysql_service_status_t mysql_string_imp::append ( my_h_string  s1,
my_h_string  s2 
)
staticnoexcept

◆ compare()

mysql_service_status_t mysql_string_imp::compare ( my_h_string  s1,
my_h_string  s2,
int *  cmp 
)
staticnoexcept

◆ 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

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

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 into string, in bytes, not in character count.
charset_namecharset that is used for conversion.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ convert_from_buffer_v2()

mysql_service_status_t mysql_string_imp::convert_from_buffer_v2 ( my_h_string  dest_string,
const char *  src_buffer,
uint64  src_length,
CHARSET_INFO_h  src_charset 
)
staticnoexcept

◆ 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.

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 conversion.
Returns
Status of performed operation
Return values
falsesuccess
truefailure

◆ convert_to_buffer_v2()

mysql_service_status_t mysql_string_imp::convert_to_buffer_v2 ( my_h_string  src_string,
char *  dest_buffer,
uint64  dest_length,
CHARSET_INFO_h  dest_charset 
)
staticnoexcept

◆ 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.

◆ get()

mysql_service_status_t mysql_string_imp::get ( my_h_string_iterator  iter,
ulong *  out 
)
staticnoexcept

Retrieves character value at current iterator position.

Parameters
iterString iterator object handle
[out]outPointer to long value to store character to
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.

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 unsigned 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

◆ get_charset_by_name()

CHARSET_INFO_h mysql_string_imp::get_charset_by_name ( const char *  name)
staticnoexcept

◆ get_charset_utf8mb4()

CHARSET_INFO_h mysql_string_imp::get_charset_utf8mb4 ( )
staticnoexcept

◆ get_data()

mysql_service_status_t mysql_string_imp::get_data ( my_h_string  s,
const char **  buffer_pointer,
size_t *  buffer_length,
CHARSET_INFO_h buffer_charset 
)
staticnoexcept

◆ 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 to release.

◆ 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

◆ reset()

mysql_service_status_t mysql_string_imp::reset ( my_h_string  s)
staticnoexcept

◆ substr()

mysql_service_status_t mysql_string_imp::substr ( my_h_string  in_string,
uint  offset,
uint  count,
my_h_string out_string 
)
staticnoexcept

Allocates a string object and sets it value as substring of the input string.

Caller must free the allocated string by calling destroy().

Parameters
[in]in_stringString handle to extract substring from.
[in]offsetCharacter offset of the substring.
[in]countNumber of characters of the substring.
[out]out_stringPointer to string handle holding the created result string.
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

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