MXS-2304 Use get_c_str_copy instead of config_copy_string()

Also uses get_string() in core-code when appropriate.
This commit is contained in:
Esa Korhonen
2019-02-04 12:13:12 +02:00
parent 692dd195ec
commit 4132c9bbbc
14 changed files with 67 additions and 73 deletions

View File

@ -240,6 +240,20 @@ public:
*/
const char* get_c_str(const std::string& key) const;
/**
* @brief Get copy of parameter value if it is defined
*
* If a parameter with the name of @c key is defined in @c params, a copy of the
* value of that parameter is returned. The caller must free the returned string.
*
* @param key Parameter name
* @return Pointer to copy of value or NULL if the parameter was not found
*
* @note The use of this function should be avoided after startup as the function
* will abort the process if memory allocation fails.
*/
char* get_c_str_copy(const std::string& key) const;
/**
* Get an integer value. Should be used for both MXS_MODULE_PARAM_INT and MXS_MODULE_PARAM_COUNT
* parameter types.
@ -491,22 +505,6 @@ bool config_get_compiled_regexes(const MXS_CONFIG_PARAMETER* params,
*/
std::vector<std::string> config_break_list_string(const char* list_string);
/**
* @brief Get copy of parameter value if it is defined
*
* If a parameter with the name of @c key is defined in @c params, a copy of the
* value of that parameter is returned. The caller must free the returned string.
*
* @param params List of configuration parameters
* @param key Parameter name
*
* @return Pointer to copy of value or NULL if the parameter was not found
*
* @note The use of this function should be avoided after startup as the function
* will abort the process if memory allocation fails.
*/
char* config_copy_string(const MXS_CONFIG_PARAMETER* params, const char* key);
/**
* @brief Convert string truth value
*