MySQL 8.0.40
Source Code Documentation
|
Classes | |
struct | result |
Struct for storing the parsing result. More... | |
Enumerations | |
enum class | parser_status { OK , MISSING_SEPARATOR , MORE_THAN_ONE_SEPARATOR , SEQUENTIAL_SEPARATORS , SEQUENTIAL_DELIMITERS , STARTS_WITH_INVALID_CHARACTER , ENDS_WITH_INVALID_CHARACTER , DUPLICATE_KEY } |
Functions | |
result | parse_options_string (String *str, char delimiter, char key_value_separator, std::map< std::string, std::string > *options) |
Parses the options string into keys and values. More... | |
bool | resolve_parser_result (result result, const char *function_name) |
Determines result of parsing operation, raises error if parsing was unsuccessful. More... | |
bool | parse_string (String *str, std::map< std::string, std::string > *map, const char *func_name) |
Parses options string into a map of keys and values, raises an error if parsing is unsuccessful. More... | |
|
strong |
result options_parser::parse_options_string | ( | String * | str, |
char | delimiter, | ||
char | key_value_separator, | ||
std::map< std::string, std::string > * | options | ||
) |
Parses the options string into keys and values.
Parses an options string into a set of keys and values, and stores the result in an an std::map pointer. The string is split based on a delimiter and a key-value separator, and might look something like: "key1=value1, key2=value2, key3=value3...".
str | unparsed options string |
delimiter | character to split the options string into several substrings |
key_value_separator | value which separates string into key and value |
options | pointer to an std::map |
bool options_parser::parse_string | ( | String * | str, |
std::map< std::string, std::string > * | map, | ||
const char * | func_name | ||
) |
Parses options string into a map of keys and values, raises an error if parsing is unsuccessful.
str | unparsed options string |
map | map to fill with keys and values |
func_name | function name used in error reporting |
false | parsing was successful |
true | parsing was successful |
bool options_parser::resolve_parser_result | ( | result | result, |
const char * | function_name | ||
) |
Determines result of parsing operation, raises error if parsing was unsuccessful.
Determines the result of parsing operation by looking at the status field of the result struct, and raises an appropriate error if the parsing operation is unsuccessful.
result | struct returned from parsing function |
function_name | name of function that uses parsing function |
false | parsing was successful |
true | parsing was ununsuccessful |