summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/configreader.h4
-rw-r--r--include/modules.h7
2 files changed, 11 insertions, 0 deletions
diff --git a/include/configreader.h b/include/configreader.h
index 3c8a58e64..d814a398e 100644
--- a/include/configreader.h
+++ b/include/configreader.h
@@ -139,6 +139,7 @@ struct InitialConfig
{
char* tag;
char* value;
+ char* default_value;
ValueContainerBase* val;
ConfigDataType datatype;
Validator validation_function;
@@ -570,9 +571,12 @@ class ServerConfig : public Extensible
/** Writes 'length' chars into 'result' as a string
*/
bool ConfValue(ConfigDataHash &target, const char* tag, const char* var, int index, char* result, int length, bool allow_linefeeds = false);
+ bool ConfValue(ConfigDataHash &target, const char* tag, const char* var, const char* default_value, int index, char* result, int length, bool allow_linefeeds = false);
+
/** Writes 'length' chars into 'result' as a string
*/
bool ConfValue(ConfigDataHash &target, const std::string &tag, const std::string &var, int index, std::string &result, bool allow_linefeeds = false);
+ bool ConfValue(ConfigDataHash &target, const std::string &tag, const std::string &var, const std::string &default_value, int index, std::string &result, bool allow_linefeeds = false);
/** Tries to convert the value to an integer and write it to 'result'
*/
diff --git a/include/modules.h b/include/modules.h
index 3c9899ded..8f5462b3a 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -1394,6 +1394,13 @@ class ConfigReader : public classbase
* This method destroys the ConfigReader class.
*/
~ConfigReader();
+
+ /** Retrieves a value from the config file.
+ * This method retrieves a value from the config file. Where multiple copies of the tag
+ * exist in the config file, index indicates which of the values to retrieve. If the
+ * tag is not found the default value is returned instead.
+ */
+ std::string ReadValue(const std::string &tag, const std::string &name, const std::string &default_value, int index, bool allow_linefeeds = false);
/** Retrieves a value from the config file.
* This method retrieves a value from the config file. Where multiple copies of the tag
* exist in the config file, index indicates which of the values to retrieve.