ConfigExt

Application extension to parse configuration files.

This extension is an extension itself, providing new hooks via IConfigExtExtension.

It is also an extension for the ArgumentsExt extension, so if it is registered as such, it will add the --config command line option to specify the configuration file to read. If loose_config_parsing is false, it will also add a --loose-config-parsing option to enable that feature.

Constructors

this
this(bool loose_config_parsing, istring[] default_configs, ConfigParser config)

Constructor.

Members

Functions

atExit
void atExit(IApplication app, istring[] args, int status, ExitException exception)
onExitException
ExitException onExitException(IApplication app, istring[] args, ExitException exception)

Unused IApplicationExtension method.

order
int order()

Extension order. This extension uses -10_000 because it should be called pretty early, but after the ArgumentsExt extension.

postRun
void postRun(IApplication app, istring[] args, int status)

Unused IApplicationExtension method.

preRun
void preRun(IApplication app, istring[] cl_args)

Parse configuration files (Application hook).

preValidateArgs
void preValidateArgs(IApplication app, Arguments args)

Unused IArgumentsExtExtension method.

processArgs
void processArgs(IApplication app, Arguments args)

Process command line arguments (ArgumentsExt hook).

setupArgs
void setupArgs(IApplication app, Arguments args)

Setup command line arguments.

validateArgs
cstring validateArgs(IApplication app, Arguments args)

Do a simple validation over override-config arguments

Mixins

__anonymous
mixin ExtensibleClassMixin!(IConfigExtExtension)

Adds a list of extensions (this.extensions) and methods to handle them. See ExtensibleClassMixin documentation for details.

Variables

config
ConfigParser config;

Configuration parser to use.

default_configs
istring[] default_configs;

Default configuration files to parse.

loose_config_parsing
bool loose_config_parsing;

If true, configuration files will be parsed in a more relaxed way.

Inherited Members

From IApplicationExtension

IApplication
alias IApplication = .IApplication

Alias of IApplication, for use by implementing classes without needing to import ocean.util.app.model.IApplication.

preRun
void preRun(IApplication app, istring[] args)

Function executed before the program runs.

postRun
void postRun(IApplication app, istring[] args, int status)

Function executed after the program runs.

atExit
void atExit(IApplication app, istring[] args, int status, ExitException exception)

Function executed at program exit.

onExitException
ExitException onExitException(IApplication app, istring[] args, ExitException exception)

Function executed if (and only if) an ExitException was thrown.

From IArgumentsExtExtension

setupArgs
void setupArgs(IApplication app, Arguments args)

Function executed when command line arguments are set up (before parsing).

preValidateArgs
void preValidateArgs(IApplication app, Arguments args)

Function executed after parsing of command line args (whether the basic parsing failed or succeeded) but before the call to validateArgs().

validateArgs
cstring validateArgs(IApplication app, Arguments args)

Function executed after parsing the command line arguments.

processArgs
void processArgs(IApplication app, Arguments args)

Function executed after (successfully) validating the command line arguments.

Meta