|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The configuration manager is used to make a number of iConfigFile object appear like a single object. To do this, each iConfigFile object (also called a 'domain') is assigned a priority value. Options from config files with higher priority override or shadow options from configuration objects with lower priority. The lower priority options are still present, so if you access the lower priority iConfigFile directly you will still find their real values. If two iConfigFile objects use the same priority value, then one will shadow the other (but it is not possible to predict which will be the victor). One iConfigFile object is the so-called 'dynamic' domain. When you alter a setting in the configuration manager, the change is applied to the dynamic iConfigFile object. As a side-effect, the changed key is also removed from all objects with higher priority. The dynamic domain has always priority 0 (medium). Differences in behaviour compared to a normal confguration object are: * Deleting a key will not always remove the key from the configuration completely. It will only remove the key from the dyamic iConfigFile object and all higher-priority objects; and will thus reveal a value in a lower priority domain, if present. This also applies to the Clear() method. * The Load() and Save() methods will load or save the configuration of the dynamic domain. The other domains are not affected by Load(); and Save() will not write any keys from other domains. (In the unlikely event that you need to load or save one of the other domains, simply access the iConfigFile object for that domain directly and invoke its Load() and Save() methods rather than the methods of iConfigManager.) * Iterators: If you change an option after an iterator has passed the option, it may appear again, this time with the new value. If you change the option while the iterator looks at it, you may even read it twice after this change, once with the old and once with the new value. In general it is a bad idea to change something while an iterator exists.
Field Summary | |
static int |
ConfigPriorityApplication
|
static int |
ConfigPriorityCmdLine
|
static int |
ConfigPriorityPlugin
|
static int |
ConfigPriorityUserApp
|
static int |
ConfigPriorityUserGlobal
|
static int |
PriorityHigh
|
static int |
PriorityLow
|
static int |
PriorityMax
|
static int |
PriorityMedium
|
static int |
PriorityMin
|
static int |
PriorityVeryHigh
|
static int |
PriorityVeryLow
|
Method Summary | |
void |
addDomain(iConfigFile config,
int priority)
Add a configuration domain. |
iConfigFile |
addDomain(java.lang.String path,
iVFS vfs,
int priority)
Add a configuration domain by loading it from a file. |
void |
flushRemoved()
Flush all removed configuration files (only required in optimize mode);. |
int |
getDomainPriority(iConfigFile config)
Return the priority of a configuration domain. |
int |
getDomainPriority(java.lang.String path)
Return the priority of a configuration domain. |
iConfigFile |
getDynamicDomain()
Return a pointer to the dynamic configuration domain. |
int |
getDynamicDomainPriority()
Return the priority of the dynamic configuration domain. |
iConfigFile |
lookupDomain(java.lang.String path)
Find the iConfigFile object for a registered domain. |
void |
removeDomain(iConfigFile config)
Remove a configuration domain. |
void |
removeDomain(java.lang.String path)
Remove a configuration domain. |
void |
setDomainPriority(iConfigFile config,
int priority)
Set the priority of a registered configuration domain. |
void |
setDomainPriority(java.lang.String path,
int priority)
Set the priority of a configuration domain. |
boolean |
setDynamicDomain(iConfigFile config)
Change the dynamic domain. |
void |
setDynamicDomainPriority(int priority)
Set the priority of the dynamic configuration domain. |
Methods inherited from interface crystalspace.jbind.interfaces.iutil.cfgfile.iConfigFile |
clear, deleteKey, enumerate, enumerate, getBool, getBool, getComment, getEOFComment, getFileName, getFloat, getFloat, getInt, getInt, getStr, getStr, getVFS, keyExists, load, load, load, load, save, save, save, setBool, setComment, setEOFComment, setFileName, setFloat, setInt, setStr, subsectionExists |
Methods inherited from interface crystalspace.jbind.interfaces.iutil.scf.iBase |
decRef, getName, getRefCount, getVersion, incRef, queryInterface, queryInterfaceSafe |
Methods inherited from interface crystalspace.jbind.interfaces.iPointer |
changePointer, getPointer, isMemoryOwner, setMemoryOwner |
Field Detail |
public static final int PriorityMin
public static final int PriorityVeryLow
public static final int PriorityLow
public static final int PriorityMedium
public static final int PriorityHigh
public static final int PriorityVeryHigh
public static final int PriorityMax
public static final int ConfigPriorityPlugin
public static final int ConfigPriorityApplication
public static final int ConfigPriorityUserGlobal
public static final int ConfigPriorityUserApp
public static final int ConfigPriorityCmdLine
Method Detail |
public iConfigFile addDomain(java.lang.String path, iVFS vfs, int priority)
path
- vfs
- priority
-
public void addDomain(iConfigFile config, int priority)
config
- priority
- public void flushRemoved()
public int getDomainPriority(iConfigFile config)
config
-
public int getDomainPriority(java.lang.String path)
path
-
public iConfigFile getDynamicDomain()
public int getDynamicDomainPriority()
public iConfigFile lookupDomain(java.lang.String path)
path
-
public void removeDomain(java.lang.String path)
path
- public void removeDomain(iConfigFile config)
config
- public void setDomainPriority(iConfigFile config, int priority)
config
- priority
- public void setDomainPriority(java.lang.String path, int priority)
path
- priority
- public boolean setDynamicDomain(iConfigFile config)
config
-
public void setDynamicDomainPriority(int priority)
priority
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |