readConfigInto

Reads a configuration file and applies the settings therein to passed objects.

More than one object can be supplied; invalid ones for which there are no settings in the configuration file will be silently ignored with no errors. Orphan settings in the configuration file for which no appropriate object was passed will be saved to invalidEntries.

  1. void readConfigInto(string configFile, string[][string] missingEntries, string[][string] invalidEntries, T things)
    void
    readConfigInto
    (
    T...
    )
    (
    const string configFile
    ,
    ref string[][string] missingEntries
    ,
    ref string[][string] invalidEntries
    ,
    ref T things
    )
    if (
    allSatisfy!(isStruct, T)
    )
  2. void readConfigInto(string configFile, T things)

Parameters

configFile string

Filename of file to read from.

missingEntries string[][string]

Reference to an associative array of string arrays of expected configuration entries that were missing.

invalidEntries string[][string]

Reference to an associative array of string arrays of unexpected configuration entries that did not belong.

things T

Reference variadic list of things to set values of, according to the text in the configuration file.

Examples

IRCClient client;
IRCServer server;
string[][string] missingEntries;
string[][string] invalidEntries;

"kameloso.conf".readConfigInto(missingEntries, invalidEntries, client, server);