ConfigParser.getStrict

Alternative form strict config value getter, returning the retrieved value via a reference. (The advantage being that the template type can then be inferred by the compiler.)

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

Usage Example:

Config.parseFile("some-config.ini");
// throws if not found
istring str;
int n;

Config.getStrict(str, "some-cat", "some-key");
Config.getStrict(n, "some-cat", "some-key");
  1. T getStrict(cstring category, cstring key)
  2. void getStrict(T value, cstring category, cstring key)
    class ConfigParser
    void
    getStrict
    (
    T
    )

Parameters

value T

output for config value

category cstring

category to get key from

key cstring

key whose value is to be got

Throws

if the specified key does not exist

TODO: perhaps we should discuss removing the other version of getStrict(), above? It seems a little bit confusing having both methods, and I feel this version is more convenient to use.

Meta