MXS-2304 Add contains() to test if a parameter exists

Replaces uses of config_get_param() in modules either with contains()
or get_string(). The config_get_param() is moved to internal headers,
as it allows seeing inside a config setting.
This commit is contained in:
Esa Korhonen
2019-02-01 18:34:27 +02:00
parent 8e563bd0b6
commit 5ab7734e9d
11 changed files with 75 additions and 64 deletions

View File

@ -318,6 +318,14 @@ public:
*/
SERVER* get_server(const std::string& key) const;
/**
* Check if a key exists.
*
* @param key Parameter name
* @return True if key was found
*/
bool contains(const std::string& key) const;
char* name; /**< The name of the parameter */
char* value; /**< The value of the parameter */
MXS_CONFIG_PARAMETER* next; /**< Next pointer in the linked list */
@ -396,15 +404,6 @@ struct MXS_CONFIG
*/
MXS_CONFIG* config_get_global_options();
/**
* @brief Get a configuration parameter
*
* @param params List of parameters
* @param name Name of parameter to get
* @return The parameter or NULL if the parameter was not found
*/
MXS_CONFIG_PARAMETER* config_get_param(MXS_CONFIG_PARAMETER* params, const char* name);
/**
* @brief Helper function for checking SSL parameters
*