mirror of
https://github.com/GTNewHorizons/bdlib.git
synced 2026-11-16 18:54:43 +00:00
Added ConfigSection.hasValue to check if a value is present
This commit is contained in:
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])
|
||||
|
||||
Reference in new issue
Block a user