#include <cfgmgr.h>
Inheritance diagram for iConfigManager:
Public Types | |
enum | { PriorityMin = -1000000000, PriorityVeryLow = -100, PriorityLow = -50, PriorityMedium = 0, PriorityHigh = +50, PriorityVeryHigh = +100, PriorityMax = +1000000000 } |
enum | { ConfigPriorityPlugin = PriorityVeryLow, ConfigPriorityApplication = PriorityLow, ConfigPriorityUserGlobal = PriorityMedium, ConfigPriorityUserApp = PriorityHigh, ConfigPriorityCmdLine = PriorityVeryHigh } |
Default priority values (you may use other values if you want). | |
Public Methods | |
virtual void | AddDomain (iConfigFile *, int priority)=0 |
add a configuration domain. | |
virtual iConfigFile* | AddDomain (char const *path, iVFS *, int priority)=0 |
Add a configuration domain. More... | |
virtual void | RemoveDomain (iConfigFile *)=0 |
remove a configuration domain. | |
virtual void | RemoveDomain (char const *path)=0 |
remove a configuration domain. | |
virtual iConfigFile* | LookupDomain (char const *path) const=0 |
return a pointer to a single config domain. | |
virtual void | SetDomainPriority (char const *path, int priority)=0 |
set the priority of a config domain. | |
virtual void | SetDomainPriority (iConfigFile *, int priority)=0 |
set the priority of a config domain. | |
virtual int | GetDomainPriority (char const *path) const=0 |
return the priority of a config domain. | |
virtual int | GetDomainPriority (iConfigFile *) const=0 |
return the priority of a config domain. | |
virtual bool | SetDynamicDomain (iConfigFile *)=0 |
Change the dynamic domain. More... | |
virtual iConfigFile* | GetDynamicDomain () const=0 |
return a pointer to the dynamic config domain. | |
virtual void | SetDynamicDomainPriority (int priority)=0 |
set the priority of the dynamic config domain. | |
virtual int | GetDynamicDomainPriority () const=0 |
return the priority of the dynamic config domain. | |
virtual void | FlushRemoved ()=0 |
flush all removed config files (only required in optimize mode). |
To do this, every config file object (also called 'domain') is assigned a priority value. Options from config files with higher priority override options from config files with lower priority. These 'lower' options are not really deleted, so if you access the 'lower' config file directly you will still find their real value. If two config objects use the same priority value, it is not defined which of them takes precedence.
One config object is the so-called 'dynamic' object. When you change something in the global configuration, these changes are applied to the dynamic config object. The changed key is removed from all objects with higher priority. The dynamic object is given to the config manager at construction and cannot be changed later. It has always priority 0 (medium).
Differences in behaviour compared to a normal confguration object are:
|
Add a configuration domain. The new config file is also returned. If you want to store the pointer yourself, you must first IncRef it. Reimplemented in csConfigManager. |
|
Change the dynamic domain. The given config object must already be registered with AddDomain(). Returns false if this is not the case. Reimplemented in csConfigManager. |