MXS-2304 Use get_enum() instead of config_get_enum()

This commit is contained in:
Esa Korhonen
2019-01-31 11:03:08 +02:00
parent c8a84cebd0
commit f2d2202ea3
21 changed files with 52 additions and 75 deletions

View File

@ -248,6 +248,17 @@ public:
*/
int64_t get_integer(const std::string& key) const;
/**
* Get a enumeration value.
*
* @param key Parameter name
* @param enum_mapping Enum string->integer mapping
* @return The enumeration value converted to an int or -1 if the parameter was not found
*
* @note The enumeration values should not use -1 so that an undefined parameter is
* detected. If -1 is used, config_get_param() should be used to detect whether
* the parameter exists
*/
int64_t get_enum(const std::string& key, const MXS_ENUM_VALUE* enum_mapping) const;
char* name; /**< The name of the parameter */
@ -404,23 +415,6 @@ uint64_t config_get_size(const MXS_CONFIG_PARAMETER* params, const char* key);
*/
const char* config_get_string(const MXS_CONFIG_PARAMETER* params, const char* key);
/**
* @brief Get a enumeration value
*
* @param params List of configuration parameters
* @param key Parameter name
* @param values All possible enumeration values
*
* @return The enumeration value converted to an int or -1 if the parameter was not found
*
* @note The enumeration values should not use -1 so that an undefined parameter is
* detected. If -1 is used, config_get_param() should be used to detect whether
* the parameter exists
*/
int config_get_enum(const MXS_CONFIG_PARAMETER* params,
const char* key,
const MXS_ENUM_VALUE* values);
/**
* @brief Get a service value
*