Function parseConfigString
Parses the config file or string and returns a Config
instance.
ConfigT parseConfigString(ConfigT)
(
string data,
string path,
StrictMode strict = StrictMode .Error
);
ConfigT parseConfigString(ConfigT)
(
string data,
in CLIArgs args,
StrictMode strict = StrictMode .Error
);
Parameters
Name | Description |
---|---|
ConfigT | A struct type used to drive the deserialization and
validation. This type definition is the most important aspect
of how Configy works.
|
args | command-line arguments (containing the path to the config) |
path | When parsing a string, the path corresponding to it |
data | A string containing a valid YAML document to be processed |
strict | Whether the parsing should reject unknown keys in the
document, warn, or ignore them (default: StrictMode ) |
Throws
ConfigException
if deserializing the configuration into ConfigT
failed, or an underlying Exception
if a backend failed (e.g.
path
was not found).
Returns
A valid ConfigT
instance