Configuration file API - loading, parsing and access to variables.

Methods

get (key:String):String

Returns configuration variable value as String.

Parameters:

key

Configuration variable name.

Returns:

Configuration variable value. Returns null, if variable not found.

getArray (key:String):Array<String>

Returns configuration variable value as an array of Strings. The variable should be a comma-separated string.

Parameters:

key

Configuration variable name.

Returns:

Array of values. Returns null, if variable not found.

getBool (key:String):Bool

Returns configuration variable value as Bool.

Parameters:

key

Configuration variable name.

Returns:

Configuration variable value. Returns false, if variable not found.

getInt (key:String):Int

Returns configuration variable value as Int.

Parameters:

key

Configuration variable name.

Returns:

Configuration variable value. Returns 0, if variable not found.

inline getList ():Map<String, String>

Returns full configuration key-value map.

Returns:

Map of configuration variables.

load (fileName:String):Void

Loads a configuration file.

Parameters:

fileName

File name.

set (key:String, val:String):Void

Sets configuration variable to a given value. This will not be saved to configuration file.

Parameters:

key

Configuration variable name.

val

Configuration variable value.