Skip to content
Snippets Groups Projects
Commit a8b98cf8 authored by Steven Murray's avatar Steven Murray
Browse files

Added getConfEntString(category, key, defaultValue)

parent 4b910c3f
No related branches found
No related tags found
No related merge requests found
......@@ -132,7 +132,20 @@ castor::common::CastorConfiguration &
}
//------------------------------------------------------------------------------
// getConfEnt
// getConfEntString
//------------------------------------------------------------------------------
const std::string& castor::common::CastorConfiguration::getConfEntString(
const std::string &category, const std::string &key,
const std::string &defaultValue) {
try {
return getConfEntString(category, key);
} catch(castor::exception::NoEntry &ne) {
return defaultValue;
}
}
//------------------------------------------------------------------------------
// getConfEntString
//------------------------------------------------------------------------------
const std::string& castor::common::CastorConfiguration::getConfEntString(
const std::string &category, const std::string &key) {
......
......@@ -88,8 +88,24 @@ namespace castor {
* retrieves a configuration entry
* @param category the category of the entry
* @param key the key of the entry
* @param default value to be return if the configuration entry is not in
* the configuration file
*/
const std::string& getConfEntString(const std::string &category, const std::string &key);
const std::string& getConfEntString(const std::string &category,
const std::string &key, const std::string &defaultValue);
/**
* retrieves a configuration entry
*
* besides other possible exception, this method throws a
* castor::exception::NoEntry exception if the specified configuration
* entry is not in the configuration file
*
* @param category the category of the entry
* @param key the key of the entry
*/
const std::string& getConfEntString(const std::string &category,
const std::string &key);
private:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment