crystalspace.jbind.interfaces.iutil.cfgfile
Interface iConfigFile
- All Superinterfaces:
- iBase, iPointer
- All Known Subinterfaces:
- iConfigManager
- All Known Implementing Classes:
- csConfigFile, csConfigManager
- public interface iConfigFile
- extends iBase
Configuration file interface.
- Author:
- Java wrapper - Quentin Anciaux, c++ version -
http://crystal.sourceforge.net/docs/online/devapi/structiConfigFile.php
Method Summary |
void |
clear()
Delete all options and rewind all iterators. |
void |
deleteKey(java.lang.String Key)
Delete a key and its value and comment. |
iConfigIterator |
enumerate()
Enumerate selected keys. |
iConfigIterator |
enumerate(java.lang.String Subsection)
Enumerate selected keys. |
boolean |
getBool(java.lang.String Key)
Get a booleanean value from the configuration. |
boolean |
getBool(java.lang.String Key,
boolean Def)
Get a booleanean value from the configuration. |
java.lang.String |
getComment(java.lang.String Key)
Get the comment of the given key, or 0 if no comment exists. |
java.lang.String |
getEOFComment()
return the final comment at the end of the configuration file Implemented
in csWin32RegistryConfig, csConfigFile, csConfigManager, and
csDefaultsConfig. |
java.lang.String |
getFileName()
Get configuration file name. |
float |
getFloat(java.lang.String Key)
Get a float value from the configuration. |
float |
getFloat(java.lang.String Key,
float Def)
Get a float value from the configuration. |
int |
getInt(java.lang.String Key)
Get an integer value from the configuration. |
int |
getInt(java.lang.String Key,
int Def)
Get an integer value from the configuration. |
java.lang.String |
getStr(java.lang.String Key)
Get a string value from the configuration. |
java.lang.String |
getStr(java.lang.String Key,
java.lang.String Def)
Get a string value from the configuration. |
iVFS |
getVFS()
Get the VFS object on which this file is stored (if any);. |
boolean |
keyExists(java.lang.String Key)
Test if a key exists. |
boolean |
load(java.lang.String iFileName)
Load a configuration file. |
boolean |
load(java.lang.String iFileName,
iVFS vfs)
Load a configuration file. |
boolean |
load(java.lang.String iFileName,
iVFS vfs,
boolean Merge)
Load a configuration file. |
boolean |
load(java.lang.String iFileName,
iVFS vfs,
boolean Merge,
boolean NewWins)
Load a configuration file. |
boolean |
save()
Save configuration to the same place from which it was loaded. |
boolean |
save(java.lang.String iFileName)
Save configuration into the given file (on VFS or on the physical
filesystem);. |
boolean |
save(java.lang.String iFileName,
iVFS vfs)
Save configuration into the given file (on VFS or on the physical
filesystem);. |
void |
setBool(java.lang.String Key,
boolean Value)
Set a booleanean value. |
void |
setComment(java.lang.String Key,
java.lang.String Text)
Set the comment for given key. |
void |
setEOFComment(java.lang.String Text)
set the final comment at the end of the configuration file Implemented in
csWin32RegistryConfig, csConfigFile, csConfigManager, and
csDefaultsConfig. |
void |
setFileName(java.lang.String Name,
iVFS vfs)
Set config file name. |
void |
setFloat(java.lang.String Key,
float Value)
Set a floating-point value. |
void |
setInt(java.lang.String Key,
int Value)
Set an integer value. |
void |
setStr(java.lang.String Key,
java.lang.String Val)
Set an string value. |
boolean |
subsectionExists(java.lang.String Subsection)
Test if at least one key exists with the given Subsection prefix.
|
clear
public void clear()
- Delete all options and rewind all iterators. Implemented in
csWin32RegistryConfig, csConfigFile, csConfigManager, and
csDefaultsConfig.
deleteKey
public void deleteKey(java.lang.String Key)
- Delete a key and its value and comment. Implemented in
csWin32RegistryConfig, csConfigFile, csConfigManager, and
csDefaultsConfig.
- Parameters:
Key
-
enumerate
public iConfigIterator enumerate()
- Enumerate selected keys. If a subsection is given, only those keys which
are prefixed by the subsection string will be enumerated. The returned
iterator does not yet point to a valid key. You must call Next(); to set
it to the first key. Implemented in csWin32RegistryConfig, csConfigFile,
csConfigManager, and csDefaultsConfig.
- Returns:
enumerate
public iConfigIterator enumerate(java.lang.String Subsection)
- Enumerate selected keys. If a subsection is given, only those keys which
are prefixed by the subsection string will be enumerated. The returned
iterator does not yet point to a valid key. You must call Next(); to set
it to the first key. Implemented in csWin32RegistryConfig, csConfigFile,
csConfigManager, and csDefaultsConfig.
- Parameters:
Subsection
-
- Returns:
getBool
public boolean getBool(java.lang.String Key)
- Get a booleanean value from the configuration. The optional default value
(Def parameter); will be used if the key was not found. Implemented in
csWin32RegistryConfig, csConfigFile, csConfigManager, and
csDefaultsConfig.
- Parameters:
Key
-
- Returns:
getBool
public boolean getBool(java.lang.String Key,
boolean Def)
- Get a booleanean value from the configuration. The optional default value
(Def parameter); will be used if the key was not found. Implemented in
csWin32RegistryConfig, csConfigFile, csConfigManager, and
csDefaultsConfig.
- Parameters:
Key
- Def
-
- Returns:
getComment
public java.lang.String getComment(java.lang.String Key)
- Get the comment of the given key, or 0 if no comment exists. Implemented
in csWin32RegistryConfig, csConfigFile, csConfigManager, and
csDefaultsConfig.
- Parameters:
Key
-
- Returns:
getEOFComment
public java.lang.String getEOFComment()
- return the final comment at the end of the configuration file Implemented
in csWin32RegistryConfig, csConfigFile, csConfigManager, and
csDefaultsConfig.
- Returns:
getFileName
public java.lang.String getFileName()
- Get configuration file name. Implemented in csWin32RegistryConfig,
csConfigFile, csConfigManager, csPrefixConfig, and csDefaultsConfig.
- Returns:
getFloat
public float getFloat(java.lang.String Key)
- Get a float value from the configuration. The optional default value (Def
parameter); will be used if the key was not found. Implemented in
csWin32RegistryConfig, csConfigFile, csConfigManager, and
csDefaultsConfig.
- Parameters:
Key
-
- Returns:
getFloat
public float getFloat(java.lang.String Key,
float Def)
- Get a float value from the configuration. The optional default value (Def
parameter); will be used if the key was not found. Implemented in
csWin32RegistryConfig, csConfigFile, csConfigManager, and
csDefaultsConfig.
- Parameters:
Key
- Def
-
- Returns:
getInt
public int getInt(java.lang.String Key)
- Get an integer value from the configuration. The optional default value
(Def parameter); will be used if the key was not found. Implemented in
csWin32RegistryConfig, csConfigFile, csConfigManager, and
csDefaultsConfig.
- Parameters:
Key
-
- Returns:
getInt
public int getInt(java.lang.String Key,
int Def)
- Get an integer value from the configuration. The optional default value
(Def parameter); will be used if the key was not found. Implemented in
csWin32RegistryConfig, csConfigFile, csConfigManager, and
csDefaultsConfig.
- Parameters:
Key
- Def
-
- Returns:
getStr
public java.lang.String getStr(java.lang.String Key)
- Get a string value from the configuration. The optional default value (Def
parameter); will be used if the key was not found. Implemented in
csWin32RegistryConfig, csConfigFile, csConfigManager, and
csDefaultsConfig.
- Parameters:
Key
-
- Returns:
getStr
public java.lang.String getStr(java.lang.String Key,
java.lang.String Def)
- Get a string value from the configuration. The optional default value (Def
parameter); will be used if the key was not found. Implemented in
csWin32RegistryConfig, csConfigFile, csConfigManager, and
csDefaultsConfig.
- Parameters:
Key
- Def
-
- Returns:
getVFS
public iVFS getVFS()
- Get the VFS object on which this file is stored (if any);. Returns 0 if
this file resides within the real (non-VFS); filesystem. Implemented in
csWin32RegistryConfig, csConfigFile, csConfigManager, and
csDefaultsConfig.
- Returns:
keyExists
public boolean keyExists(java.lang.String Key)
- Test if a key exists. Implemented in csWin32RegistryConfig, csConfigFile,
csConfigManager, and csDefaultsConfig.
- Parameters:
Key
-
- Returns:
load
public boolean load(java.lang.String iFileName)
- Load a configuration file. If the file resides in a real filesystem,
rather than a VFS filesystem, then pass 0 for the VFS argument. You can
set the Merge flag to merge the newly loaded configuration information
into the existing information. If you do so, nothing will happen if the
named file doesn't exist. The NewWins flag determines the behavior in case
of configuration key conflicts. If true, then the new configuration value
replaces the old for that key. If false, then the old value is kept, and
the new value is ignored. The recorded file name will be set to the name
of the newly loaded file if the Merge flag is false; otherwise it will
retain the old name. Implemented in csWin32RegistryConfig, csConfigFile,
csConfigManager, and csDefaultsConfig.
- Parameters:
iFileName
-
- Returns:
load
public boolean load(java.lang.String iFileName,
iVFS vfs)
- Load a configuration file. If the file resides in a real filesystem,
rather than a VFS filesystem, then pass 0 for the VFS argument. You can
set the Merge flag to merge the newly loaded configuration information
into the existing information. If you do so, nothing will happen if the
named file doesn't exist. The NewWins flag determines the behavior in case
of configuration key conflicts. If true, then the new configuration value
replaces the old for that key. If false, then the old value is kept, and
the new value is ignored. The recorded file name will be set to the name
of the newly loaded file if the Merge flag is false; otherwise it will
retain the old name. Implemented in csWin32RegistryConfig, csConfigFile,
csConfigManager, and csDefaultsConfig.
- Parameters:
iFileName
- vfs
-
- Returns:
load
public boolean load(java.lang.String iFileName,
iVFS vfs,
boolean Merge)
- Load a configuration file. If the file resides in a real filesystem,
rather than a VFS filesystem, then pass 0 for the VFS argument. You can
set the Merge flag to merge the newly loaded configuration information
into the existing information. If you do so, nothing will happen if the
named file doesn't exist. The NewWins flag determines the behavior in case
of configuration key conflicts. If true, then the new configuration value
replaces the old for that key. If false, then the old value is kept, and
the new value is ignored. The recorded file name will be set to the name
of the newly loaded file if the Merge flag is false; otherwise it will
retain the old name. Implemented in csWin32RegistryConfig, csConfigFile,
csConfigManager, and csDefaultsConfig.
- Parameters:
iFileName
- vfs
- Merge
-
- Returns:
load
public boolean load(java.lang.String iFileName,
iVFS vfs,
boolean Merge,
boolean NewWins)
- Load a configuration file. If the file resides in a real filesystem,
rather than a VFS filesystem, then pass 0 for the VFS argument. You can
set the Merge flag to merge the newly loaded configuration information
into the existing information. If you do so, nothing will happen if the
named file doesn't exist. The NewWins flag determines the behavior in case
of configuration key conflicts. If true, then the new configuration value
replaces the old for that key. If false, then the old value is kept, and
the new value is ignored. The recorded file name will be set to the name
of the newly loaded file if the Merge flag is false; otherwise it will
retain the old name. Implemented in csWin32RegistryConfig, csConfigFile,
csConfigManager, and csDefaultsConfig.
- Parameters:
iFileName
- vfs
- Merge
- NewWins
-
- Returns:
save
public boolean save(java.lang.String iFileName)
- Save configuration into the given file (on VFS or on the physical
filesystem);. If the second parameter is skipped, the file will be written
to the physical filesystem, otherwise it is stored on given VFS
filesystem. This method does not change the internally stored file name.
Implemented in csWin32RegistryConfig, csConfigFile, csConfigManager, and
csDefaultsConfig.
- Parameters:
iFileName
-
- Returns:
save
public boolean save(java.lang.String iFileName,
iVFS vfs)
- Save configuration into the given file (on VFS or on the physical
filesystem);. If the second parameter is skipped, the file will be written
to the physical filesystem, otherwise it is stored on given VFS
filesystem. This method does not change the internally stored file name.
Implemented in csWin32RegistryConfig, csConfigFile, csConfigManager, and
csDefaultsConfig.
- Parameters:
iFileName
- vfs
-
- Returns:
save
public boolean save()
- Save configuration to the same place from which it was loaded. Returns
true if the save operation succeeded. Implemented in
csWin32RegistryConfig, csConfigFile, csConfigManager, and
csDefaultsConfig.
- Returns:
setBool
public void setBool(java.lang.String Key,
boolean Value)
- Set a booleanean value. Implemented in csWin32RegistryConfig,
csConfigFile, csConfigManager, and csDefaultsConfig.
- Parameters:
Key
- Value
-
setComment
public void setComment(java.lang.String Key,
java.lang.String Text)
- Set the comment for given key. In addition to an actual comment, you can
use "" for Text to place an empty comment line before this key, or 0 to
remove the comment entirely. The comment may contain newline characters.
Returns false if the key does not exist. Implemented in
csWin32RegistryConfig, csConfigFile, csConfigManager, and
csDefaultsConfig.
- Parameters:
Key
- Text
-
setEOFComment
public void setEOFComment(java.lang.String Text)
- set the final comment at the end of the configuration file Implemented in
csWin32RegistryConfig, csConfigFile, csConfigManager, and
csDefaultsConfig.
- Parameters:
Text
-
setFileName
public void setFileName(java.lang.String Name,
iVFS vfs)
- Set config file name. You can use this if you want Save(); to write to
another file. This will set the dirty flag. Implemented in
csWin32RegistryConfig, csConfigFile, csConfigManager, and
csDefaultsConfig.
- Parameters:
Name
- vfs
-
setFloat
public void setFloat(java.lang.String Key,
float Value)
- Set a floating-point value. Implemented in csWin32RegistryConfig,
csConfigFile, csConfigManager, and csDefaultsConfig.
- Parameters:
Key
- Value
-
setInt
public void setInt(java.lang.String Key,
int Value)
- Set an integer value. Implemented in csWin32RegistryConfig, csConfigFile,
csConfigManager, and csDefaultsConfig.
- Parameters:
Key
- Value
-
setStr
public void setStr(java.lang.String Key,
java.lang.String Val)
- Set an string value. Implemented in csWin32RegistryConfig, csConfigFile,
csConfigManager, and csDefaultsConfig.
- Parameters:
Key
- Val
-
subsectionExists
public boolean subsectionExists(java.lang.String Subsection)
- Test if at least one key exists with the given Subsection prefix.
Implemented in csWin32RegistryConfig, csConfigFile, csConfigManager, and
csDefaultsConfig.
- Parameters:
Subsection
-
- Returns: