|root_dir||Pseudo root directory where to read and write configuration files. Configuration directory specified in model or with config_dir option is appended to this root directory|
|config_dir||Directory to read or write configuration file. This parameter must be supplied if not provided by the configuration model.|
|backend||Specify which backend to use. See write_back ( ... ) for details|
|skip_read||When set, configuration files will not be read when creating configuration tree.|
|check||yes, skip or no|
|on_change_cb||Call back this function whenever notify_change is called. Called with arguments: name => <root node element name>, index => <index_value>|
|on_message_cb||Call back this function when show_message is called. By default, messages will be displayed on STDOUT.|
|error_paths||Returns a list of tree items that currently have an error.|
|error_messages||Returns a list of error messages from the tree content.|
If you need to load configuration data that are not correct, you can use force_load => 1. Then, wrong data will be discarded (equivalent to check = no> ).
name()Returns the instance name.
config_root()Returns the root object of the configuration tree.
read_check()Returns how to check read files.
Display the message on STDOUT unless a custom function was passed to on_message_cb parameter.
Destroy current configuration tree (with data) and returns a new tree with data (and annotations) loaded from disk.
config_model()Returns the model (Config::Model object) of the configuration tree.
annotation_saver()Returns the object loading and saving annotations. See Config::Model::Annotation for details.
All values stored in preset mode are shown to the user as default values. This feature is useful to enter configuration data entered by an automatic process (like hardware scan)
Stop preset mode
Get preset mode
preset_clear()Clear all preset values stored.
All values stored in layered mode are shown to the user as default values. This feature is useful to enter configuration data entered by an automatic process (like hardware scan)
Stop layered mode
Get layered mode
layered_clear()Clear all layered values stored.
Returns normal or preset or layered. Does not take into account initial_load.
Stop initial_load mode. Instance is built with initial_load as 1. Read backend will clear this value once the first read is done.
Get initial_load mode
The data method provide a way to store some arbitrary data in the instance object.
Load configuration tree with configuration data. See Config::Model::Loader for more details
Returns an object dedicated to search an element in the configuration model (respecting privilege level).
Deprecated. Call iterator instead.
Usually, a program based on config model must first create the configuration model, then load all configuration data.
This feature enables you to declare with the model a way to load configuration data (and to write it back). See Config::Model::BackendMgr for details.
backend()Get the preferred backend method for this instance (as passed to the constructor).
root_dir()Returns root directory where configuration data is read from or written to.
Register a node path that will be called back with write_back method.
Notify that some data has changed in the tree. See notify_change(...) in Config::Model::AnyThing for more details.
Try to run all subroutines registered with register_write_back to write the configuration information until one succeeds (returns true). (See Config::Model::BackendMgr for details).
You can specify here a pseudo root directory or another config directory to write configuration data back with root and config_dir parameters. This will override the model specifications.
You can force to use a backend by specifying backend => xxx. For instance, backend => augeas or backend => custom.
You can force to use all backend to write the files by specifying backend => all.
write_back will croak if no write call-back are known.
Scan the tree and apply fixes that are attached to warning specifications. See warn_if_match or warn_unless_match in "" in Config::Model::Value.
Returns 1 (or more) if the instance contains data that needs to be saved. I.e some change were done in the tree that needs to be saved.
In list context, returns a array ref of strings describing the changes. In scalar context, returns a big string. Useful to print.
Print all changes on STDOUT and return the list of changes.
Returns the number of warning found in the elements of this configuration instance.
update( quiet => (0|1), CW%args )Try to run update command on all nodes of the configuration tree. Node without update method are ignored. update will say a message otherwise (unless quiet is true).
Dominique Dumont, (ddumont at cpan dot org)
Config::Model, Config::Model::Node, Config::Model::Loader, Config::Model::Searcher, Config::Model::Value,
This software is Copyright (c) 2005-2016 by Dominique Dumont.
This is free software, licensed under:
The GNU Lesser General Public License, Version 2.1, February 1999
|perl v5.20.3||CONFIG::MODEL::INSTANCE (3)||2016-04-03|