summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/ConfigUtil.cpp7
-rw-r--r--common/ConfigUtil.hpp5
2 files changed, 10 insertions, 2 deletions
diff --git a/common/ConfigUtil.cpp b/common/ConfigUtil.cpp
index 69a4b608a9..69be2bf3c5 100644
--- a/common/ConfigUtil.cpp
+++ b/common/ConfigUtil.cpp
@@ -35,6 +35,11 @@ void initialize(const std::string& xml)
initialize(XmlConfig);
}
+bool isInitialized()
+{
+ return Config;
+}
+
std::string getString(const std::string& key, const std::string& def)
{
assert(Config && "Config is not initialized.");
@@ -55,4 +60,4 @@ bool isSslEnabled()
return false;
#endif
}
-} // namespace config \ No newline at end of file
+} // namespace config
diff --git a/common/ConfigUtil.hpp b/common/ConfigUtil.hpp
index 44e7663441..54c393505f 100644
--- a/common/ConfigUtil.hpp
+++ b/common/ConfigUtil.hpp
@@ -30,6 +30,9 @@ void initialize(const std::string& xml);
/// Initialize the config given a pointer to a long-lived pointer.
void initialize(const Poco::Util::AbstractConfiguration* config);
+/// Check if the config has been initialized
+bool isInitialized();
+
/// Returns the value of an entry as string or @def if it is not found.
std::string getString(const std::string& key, const std::string& def);
@@ -39,4 +42,4 @@ bool getBool(const std::string& key, const bool def);
/// Return true if SSL is enabled in the config and no fuzzing is enabled.
bool isSslEnabled();
-} // namespace config \ No newline at end of file
+} // namespace config