ConfigParser.get

Non-strict method to get the value of a config key into the specified output value. If the config key does not exist, the given default value is returned.

Template can be instantiated with integer, float or string (istring) type.

Usage Example:

Config.parseFile("some-config.ini");
auto str = Config.get("some-cat", "some-key", "my_default_value");
int n = Config.get("some-cat", "some-int", 5);
  1. T get(cstring category, cstring key, T default_value)
    class ConfigParser
  2. void get(T value, cstring category, cstring key, T default_value)

Parameters

category cstring

category to get key from

key cstring

key whose value is to be got

default_value T

default value to use if missing in the config

Return Value

Type: T

config value, if existing, otherwise default value

Meta