![]() |
MySQL 9.5.0
Source Code Documentation
|
Namespaces | |
| namespace | anonymous_namespace{jit_executor_value.cc} |
| namespace | anonymous_namespace{utils_encoding.cc} |
| namespace | anonymous_namespace{utils_json.cc} |
| namespace | anonymous_namespace{utils_string.cc} |
| namespace | internal |
| Checks whether a string has another as a prefix. | |
| namespace | json |
| namespace | path |
| namespace | polyglot |
| namespace | profiling |
| This namespace provides the functions required to perform profiling of specific sections of code. | |
| namespace | utils |
Classes | |
| struct | Case_comparator |
| struct | Case_insensitive_comparator |
| struct | Case_sensitive_comparator |
| class | JSON_dumper |
| struct | Lexicographical_comparator |
| class | Parser_error |
| struct | string_hash |
| Transparent hashing function, enables heterogeneous lookup in unordered containers. More... | |
| class | Type_error |
| struct | Value |
| Pointer to a function that may be implemented in any language. More... | |
Typedefs | |
| using | Argument_list = std::vector< Value > |
| typedef Value::Map_type_ref | Dictionary_t |
| typedef Value::Array_type_ref | Array_t |
| template<typename Key , typename T > | |
| using | heterogeneous_map = std::unordered_map< Key, T, string_hash, std::equal_to<> > |
| template<typename Key > | |
| using | heterogeneous_set = std::unordered_set< Key, string_hash, std::equal_to<> > |
Enumerations | |
| enum | Value_type { Undefined , Null , Bool , String , Integer , UInteger , Float , Object , ObjectBridge , Array , Map , Binary } |
| Basic types that can be passed around code in different languages. More... | |
Functions | |
| bool | is_compatible_type (Value_type source_type, Value_type target_type) |
| Dictionary_t JIT_EXECUTOR_PLUGIN_EXPORT | make_dict () |
| Array_t | make_array () |
| template<typename... Arg> | |
| Array_t | make_array (Arg &&...args) |
| template<template< typename... > class C, typename T > | |
| Array_t | make_array (const C< T > &container) |
| template<template< typename... > class C, typename T > | |
| Array_t | make_array (C< T > &&container) |
| std::string | type_name (Value_type type) |
| std::string | type_description (Value_type type) |
| Type_error | type_conversion_error (Value_type from, Value_type expected) |
| Type_error | type_range_error (Value_type from, Value_type expected) |
| bool | decode_base64 (std::string_view source, std::string *target) |
| Decodes a base64 encoded string. More... | |
| bool | encode_base64 (const unsigned char *source, std::size_t source_length, std::string *encoded) |
| bool | encode_base64 (std::string_view source, std::string *encoded) |
| bool | decode_base64url (std::string_view source, std::string *target) |
| bool | encode_base64url (const unsigned char *source, std::size_t source_length, std::string *encoded) |
| Replaces '+' with '-' and '/' with '_', trims any '=' (RFC 7515, Section 2 and RFC 4648, Section 5). More... | |
| bool | encode_base64url (std::string_view source, std::string *encoded) |
| void | clear_buffer (char *buffer, size_t size) |
| void | clear_buffer (std::string &buffer) |
| std::string_view | str_strip_view (std::string_view s, std::string_view chars=" \r\n\t") |
| Strip a string out of blank chars. More... | |
| std::string_view | str_lstrip_view (std::string_view s, std::string_view chars) |
| std::string_view | str_rstrip_view (std::string_view s, std::string_view chars) |
| std::string | str_strip (std::string_view s, std::string_view chars) |
| std::string | str_lstrip (std::string_view s, std::string_view chars) |
| std::string | str_rstrip (std::string_view s, std::string_view chars) |
| std::string | str_format (const char *formats,...) |
| Return a formatted a string. More... | |
| std::string | str_replace (std::string_view s, std::string_view from, std::string_view to) |
| std::string | bits_to_string (uint64_t bits, int nbits) |
| std::pair< uint64_t, int > | string_to_bits (std::string_view s) |
| std::string | bits_to_string_hex (uint64_t bits, int nbits) |
| size_t | bits_to_string_hex_size (int nbits) |
| std::string | string_to_hex (std::string_view s, bool prefix) |
| std::string | quote_string (const std::string &s, char quote) |
Escape quote and \ chars. More... | |
| std::string | unquote_string (std::string_view s, char quote) |
| Inverse of quote_string(). More... | |
| std::vector< std::string > | str_break_into_lines (const std::string &line, std::size_t line_width) |
| Breaks string into lines of specified width without breaking words. More... | |
| std::pair< std::string::size_type, std::string::size_type > | get_quote_span (const char quote_char, const std::string &str) |
| Auxiliary function to get the quotes span (i.e., start and end positions) for the given string. More... | |
| std::string | str_subvars (std::string_view s, const std::function< std::string(std::string_view)> &subvar, std::string_view var_begin, std::string_view var_end) |
| std::wstring | utf8_to_wide (const std::string &utf8) |
| Convert UTF-8 string to UTF-16/UTF-32 (platform dependent) string. More... | |
| std::wstring | utf8_to_wide (const char *utf8) |
| Convert UTF-8 string to UTF-16/UTF-32 (platform dependent) string. More... | |
| std::string | wide_to_utf8 (const std::wstring &wide) |
| Convert UTF-16/UTF-32 (platform dependent) string to UTF-8 string. More... | |
| std::string | wide_to_utf8 (const wchar_t *wide) |
| Convert UTF-16/UTF-32 (platform dependent) string to UTF-8 string. More... | |
| std::wstring | utf8_to_wide (const char *utf8, const size_t utf8_length) |
| Convert UTF-8 string to UTF-16/UTF-32 (platform dependent) string. More... | |
| std::string | wide_to_utf8 (const wchar_t *wide, const size_t wide_length) |
| Convert UTF-16/UTF-32 (platform dependent) string to UTF-8 string. More... | |
| std::string | truncate (const std::string &str, const size_t max_length) |
| Truncates the given string to max_length code points. More... | |
| std::string | truncate (const char *str, const size_t length, const size_t max_length) |
| Truncates the given string to max_length code points. More... | |
| std::wstring | truncate (const std::wstring &str, const size_t max_length) |
| Truncates the given string to max_length code points. More... | |
| std::wstring | truncate (const wchar_t *str, const size_t length, const size_t max_length) |
| Truncates the given string to max_length code points. More... | |
| bool | is_valid_utf8 (std::string_view s) |
| Checks if the given string contains only valid UTF-8 code points. More... | |
| std::string | pctencode (std::string_view s) |
| Generates a percent encoded string based on RFC-3986, only unreserved characters are not encoded. More... | |
| std::string | pctdecode (std::string_view s) |
| Decodes a string that is percent encoded based on RFC-3986. More... | |
| std::string | get_random_string (size_t size, const char *source) |
| Returns a string of the given size created with random characters from the provided source. More... | |
| const char * | str_casestr (const char *haystack, const char *needle) |
| std::string | str_upper (std::string_view s) |
| Convert a copy of an ASCII string to uppercase and return. More... | |
| std::wstring | str_upper (std::wstring_view s) |
| std::string | str_lower (std::string_view s) |
| Convert a copy of an ASCII string to lowercase and return. More... | |
| std::wstring | str_lower (std::wstring_view s) |
| int | str_casecmp (const char *a, const char *b) |
| Compares 2 strings case insensitive (for ascii) More... | |
| int | str_casecmp (const wchar_t *a, const wchar_t *b) |
| int | str_casecmp (const char *a, const char *b, size_t n) |
| int | str_casecmp (const wchar_t *a, const wchar_t *b, size_t n) |
| template<typename... T> | |
| bool | str_caseeq (std::string_view a, std::string_view token, T &&...tokens) |
| template<typename... T> | |
| bool | str_caseeq (std::wstring_view a, std::wstring_view token, T &&...tokens) |
| template<typename... T> | |
| bool | str_beginswith (std::string_view s, std::string_view prefix, T &&...prefixes) |
| template<typename... T> | |
| bool | str_beginswith (std::wstring_view s, std::wstring_view prefix, T &&...prefixes) |
| template<typename... T> | |
| bool | str_ibeginswith (std::string_view s, std::string_view prefix, T &&...prefixes) |
| template<typename... T> | |
| bool | str_ibeginswith (std::wstring_view s, std::wstring_view prefix, T &&...prefixes) |
| template<typename... T> | |
| bool | str_endswith (std::string_view s, std::string_view suffix, T &&...suffixes) |
| template<typename... T> | |
| bool | str_endswith (std::wstring_view s, std::wstring_view suffix, T &&...suffixes) |
| template<typename... T> | |
| bool | str_iendswith (std::string_view s, std::string_view suffix, T &&...suffixes) |
| template<typename... T> | |
| bool | str_iendswith (std::wstring_view s, std::wstring_view suffix, T &&...suffixes) |
| size_t | str_span (const std::string &s1, const std::string &s2) |
| Return position of the first difference in the strings or npos if they're the same. More... | |
| template<class TOutput = std::string> | |
| std::pair< TOutput, TOutput > | str_partition (std::string_view s, std::string_view sep, bool *found_sep=nullptr) |
| Partition a string in 2 at a separator, if present. More... | |
| template<class TOutput = std::string> | |
| std::pair< TOutput, TOutput > | str_partition_after (std::string_view s, std::string_view sep) |
| Partition a string in 2 after separator, in place, if present. More... | |
| std::string | str_partition_after_inpl (std::string *s, const std::string &sep) |
| Partition a string in 2 after separator, in place, if present. More... | |
| std::vector< std::string > | str_split (std::string_view input, std::string_view separator_chars=" \r\n\t", int maxsplit=-1, bool compress=false) |
| Splits string based on each of the individual characters of the separator string. More... | |
| template<class TCallback > | |
| bool | str_itersplit (std::string_view input, TCallback &&f, std::string_view separator_chars=" \r\n\t", int maxsplit=-1, bool compress=false) |
| Split the given input string and call the functor for each token. More... | |
| std::string | str_ljust (const std::string &s, size_t width, char pad=' ') |
| std::string | str_rjust (const std::string &s, size_t width, char pad=' ') |
| template<typename Iter > | |
| std::string | str_join (Iter begin, Iter end, std::string_view sep) |
| template<typename Iter , typename CTransform > | |
| std::string | str_join (Iter begin, Iter end, std::string_view sep, CTransform &&f) |
| template<typename C > | |
| std::string | str_join (const C &container, std::string_view sep) |
| template<typename C , typename CTransform > | |
| std::string | str_join (const C &container, std::string_view sep, CTransform &&f) |
| template<typename... Args> | |
| std::string JIT_EXECUTOR_PLUGIN_EXPORT | str_replace (std::string_view s, std::string_view from, std::string_view to, const Args &...rest) |
| std::string | utf8_upper (std::string_view s) |
| std::string | utf8_lower (std::string_view s) |
| uint64_t | getPhysicalMemorySize () |
| Returns the amount of physical memory in megabytes or 0 if fails retrieving the value. More... | |
| using shcore::Argument_list = typedef std::vector<Value> |
| typedef Value::Array_type_ref shcore::Array_t |
| using shcore::heterogeneous_map = typedef std::unordered_map<Key, T, string_hash, std::equal_to<> > |
| using shcore::heterogeneous_set = typedef std::unordered_set<Key, string_hash, std::equal_to<> > |
| enum shcore::Value_type |
Basic types that can be passed around code in different languages.
With the exception of Native and Function, all types can be serialized to JSON.
| std::string shcore::bits_to_string | ( | uint64_t | bits, |
| int | nbits | ||
| ) |
| std::string shcore::bits_to_string_hex | ( | uint64_t | bits, |
| int | nbits | ||
| ) |
| size_t shcore::bits_to_string_hex_size | ( | int | nbits | ) |
| void shcore::clear_buffer | ( | char * | buffer, |
| size_t | size | ||
| ) |
| void shcore::clear_buffer | ( | std::string & | buffer | ) |
| bool shcore::decode_base64 | ( | std::string_view | source, |
| std::string * | target | ||
| ) |
Decodes a base64 encoded string.
| source | the base64 string to be decoded |
| target | a string pointer where the decoded string will be stored. |
| bool shcore::decode_base64url | ( | std::string_view | source, |
| std::string * | target | ||
| ) |
| bool shcore::encode_base64 | ( | const unsigned char * | source, |
| std::size_t | source_length, | ||
| std::string * | encoded | ||
| ) |
| bool shcore::encode_base64 | ( | std::string_view | source, |
| std::string * | encoded | ||
| ) |
| bool shcore::encode_base64url | ( | const unsigned char * | source, |
| std::size_t | source_length, | ||
| std::string * | encoded | ||
| ) |
Replaces '+' with '-' and '/' with '_', trims any '=' (RFC 7515, Section 2 and RFC 4648, Section 5).
| bool shcore::encode_base64url | ( | std::string_view | source, |
| std::string * | encoded | ||
| ) |
| std::pair< std::string::size_type, std::string::size_type > shcore::get_quote_span | ( | const char | quote_char, |
| const std::string & | str | ||
| ) |
Auxiliary function to get the quotes span (i.e., start and end positions) for the given string.
If not quote is found then std::string::npos is returned for both elements in the pair. If only one quote is found (no ending quote) then std::string::npos is returned for the second position of the pair.
| quote_char | character with the quote to look for. |
| str | target string to get the start and end quote position. |
| std::string shcore::get_random_string | ( | size_t | size, |
| const char * | source | ||
| ) |
Returns a string of the given size created with random characters from the provided source.
| uint64_t shcore::getPhysicalMemorySize | ( | ) |
Returns the amount of physical memory in megabytes or 0 if fails retrieving the value.
| bool shcore::is_compatible_type | ( | Value_type | source_type, |
| Value_type | target_type | ||
| ) |
| bool shcore::is_valid_utf8 | ( | std::string_view | s | ) |
Checks if the given string contains only valid UTF-8 code points.
| s | String to be checked. |
|
inline |
|
inline |
|
inline |
|
inline |
| Dictionary_t shcore::make_dict | ( | ) |
| std::string shcore::pctdecode | ( | std::string_view | s | ) |
Decodes a string that is percent encoded based on RFC-3986.
| std::string shcore::pctencode | ( | std::string_view | s | ) |
Generates a percent encoded string based on RFC-3986, only unreserved characters are not encoded.
| std::string shcore::quote_string | ( | const std::string & | s, |
| char | quote | ||
| ) |
Escape quote and \ chars.
| s | String to escape. |
| quote | ‘’"` |
|
inline |
|
inline |
| std::vector< std::string > shcore::str_break_into_lines | ( | const std::string & | line, |
| std::size_t | line_width | ||
| ) |
Breaks string into lines of specified width without breaking words.
| line | long string to break. |
| line_width | maximum line width |
|
inline |
Compares 2 strings case insensitive (for ascii)
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| const char * shcore::str_casestr | ( | const char * | haystack, |
| const char * | needle | ||
| ) |
|
inline |
|
inline |
| std::string shcore::str_format | ( | const char * | formats, |
| ... | |||
| ) |
Return a formatted a string.
Throws invalid_argument on encoding error
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Split the given input string and call the functor for each token.
| input | the string to be split |
| f | a functor called once for each split string. If its return value is false, the splitting is interrupted. |
| separator_chars | String containing characters wherein the input string is split on any of the characters |
| maxsplit | max number of times to split or -1 for no limit |
| compress | Boolean value which when true ensures consecutive separators do not generate new elements in the split, but they're still counted towards maxsplit. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Convert a copy of an ASCII string to lowercase and return.
|
inline |
| std::string shcore::str_lstrip | ( | std::string_view | s, |
| std::string_view | chars | ||
| ) |
| std::string_view shcore::str_lstrip_view | ( | std::string_view | s, |
| std::string_view | chars | ||
| ) |
|
inline |
Partition a string in 2 at a separator, if present.
|
inline |
Partition a string in 2 after separator, in place, if present.
|
inline |
Partition a string in 2 after separator, in place, if present.
| std::string JIT_EXECUTOR_PLUGIN_EXPORT shcore::str_replace | ( | std::string_view | s, |
| std::string_view | from, | ||
| std::string_view | to | ||
| ) |
|
inline |
|
inline |
| std::string shcore::str_rstrip | ( | std::string_view | s, |
| std::string_view | chars | ||
| ) |
| std::string_view shcore::str_rstrip_view | ( | std::string_view | s, |
| std::string_view | chars | ||
| ) |
|
inline |
Return position of the first difference in the strings or npos if they're the same.
|
inline |
Splits string based on each of the individual characters of the separator string.
| input | The string to be split |
| separator_chars | String containing characters wherein the input string is split on any of the characters |
| maxsplit | max number of times to split or -1 for no limit |
| compress | Boolean value which when true ensures consecutive separators do not generate new elements in the split, but they're still counted towards maxsplit. |
| std::string shcore::str_strip | ( | std::string_view | s, |
| std::string_view | chars | ||
| ) |
| std::string_view shcore::str_strip_view | ( | std::string_view | s, |
| std::string_view | chars | ||
| ) |
Strip a string out of blank chars.
| std::string shcore::str_subvars | ( | std::string_view | s, |
| const std::function< std::string(std::string_view)> & | subvar, | ||
| std::string_view | var_begin, | ||
| std::string_view | var_end | ||
| ) |
|
inline |
Convert a copy of an ASCII string to uppercase and return.
|
inline |
| std::pair< uint64_t, int > shcore::string_to_bits | ( | std::string_view | s | ) |
| std::string shcore::string_to_hex | ( | std::string_view | s, |
| bool | prefix | ||
| ) |
| std::string shcore::truncate | ( | const char * | str, |
| const size_t | length, | ||
| const size_t | max_length | ||
| ) |
Truncates the given string to max_length code points.
| str | UTF-8 string to be truncated. |
| length | Length of string in bytes. |
| max_length | Maximum number of code points. |
| std::string shcore::truncate | ( | const std::string & | str, |
| const size_t | max_length | ||
| ) |
Truncates the given string to max_length code points.
| str | UTF-8 string to be truncated. |
| max_length | Maximum number of code points. |
| std::wstring shcore::truncate | ( | const std::wstring & | str, |
| const size_t | max_length | ||
| ) |
Truncates the given string to max_length code points.
| str | UTF-16/UTF-32 string to be truncated. |
| max_length | Maximum number of code points. |
| std::wstring shcore::truncate | ( | const wchar_t * | str, |
| const size_t | length, | ||
| const size_t | max_length | ||
| ) |
Truncates the given string to max_length code points.
| str | UTF-16/UTF-32 string to be truncated. |
| length | Length of string in bytes. |
| max_length | Maximum number of code points. |
|
inline |
| std::string shcore::type_description | ( | Value_type | type | ) |
| std::string shcore::type_name | ( | Value_type | type | ) |
|
inline |
| std::string shcore::unquote_string | ( | std::string_view | s, |
| char | quote | ||
| ) |
Inverse of quote_string().
If the first and the last characters in the given strings match quote they are removed as well.
| s | String to be processed. |
| quote | The quote character (‘’,"`) |
|
inline |
| std::wstring shcore::utf8_to_wide | ( | const char * | utf8 | ) |
Convert UTF-8 string to UTF-16/UTF-32 (platform dependent) string.
| utf8 | Pointer to UTF-8 encoded string. |
| std::wstring shcore::utf8_to_wide | ( | const char * | utf8, |
| const size_t | utf8_length | ||
| ) |
Convert UTF-8 string to UTF-16/UTF-32 (platform dependent) string.
| utf8 | Pointer to UTF-8 encoded string. |
| utf8_length | Length of UTF-8 string in bytes. |
| std::wstring shcore::utf8_to_wide | ( | const std::string & | utf8 | ) |
Convert UTF-8 string to UTF-16/UTF-32 (platform dependent) string.
| utf8 | UTF-8 encoded string. |
|
inline |
| std::string shcore::wide_to_utf8 | ( | const std::wstring & | wide | ) |
Convert UTF-16/UTF-32 (platform dependent) string to UTF-8 string.
| wide | UTF-16/UTF-32 (platform dependent) encoded string. |
| std::string shcore::wide_to_utf8 | ( | const wchar_t * | wide | ) |
Convert UTF-16/UTF-32 (platform dependent) string to UTF-8 string.
| wide | Pointer to UTF-16/UTF-32 (platform dependent) encoded string. |
| std::string shcore::wide_to_utf8 | ( | const wchar_t * | wide, |
| const size_t | wide_length | ||
| ) |
Convert UTF-16/UTF-32 (platform dependent) string to UTF-8 string.
| wide | Pointer to UTF-16/UTF-32 (platform dependent) encoded string. |
| wide_length | Length of UTF-16/UTF-32 string in bytes. |