Added ConfigSection.hasValue to check if a value is present

This commit is contained in:
bdew committed 2014-01-17 21:41:20 +02:00
1 parent 2698d93444
commit c4dbda8a20
1 file changed
+2
@@ -38,6 +38,8 @@ case class ConfigSection(pfx: String = "") extends CfgEntry with Iterable[(Strin
final val trueVals = Set("y", "true", "yes", "on")
def getBoolean(id: String) = trueVals.contains(getString(id).toLowerCase)
def hasValue(id: String) = raw.isDefinedAt(id)
def getOrAddSection(id: String) = {
if (raw.isDefinedAt(id)) {
rawget(id, classOf[ConfigSection])