public interface Config
Core is initialized using two Config, one default| Modifier and Type | Method and Description |
|---|---|
void |
cleanEntry(java.lang.String section,
java.lang.String key)
Removes entries for key,value in a section.
|
void |
cleanSection(java.lang.String section)
Removes every pair of key,value in a section and remove the section.
|
java.lang.String |
dump()
Dumps the
Config as INI into a buffer. |
java.lang.String |
dumpAsXml()
Dumps the
Config as XML into a buffer. |
boolean |
getBool(java.lang.String section,
java.lang.String key,
boolean defaultValue)
Retrieves a configuration item as a boolean, given its section, key, and
default value. |
float |
getDefaultFloat(java.lang.String section,
java.lang.String key,
float defaultValue)
Retrieves a default configuration item as a float, given its section, key, and
default value. |
int |
getDefaultInt(java.lang.String section,
java.lang.String key,
int defaultValue)
Retrieves a default configuration item as an integer, given its section, key,
and default value. |
int |
getDefaultInt64(java.lang.String section,
java.lang.String key,
int defaultValue)
Retrieves a default configuration item as a 64 bit integer, given its section,
key, and default value. |
java.lang.String |
getDefaultString(java.lang.String section,
java.lang.String key,
java.lang.String defaultValue)
Retrieves a default configuration item as a string, given its section, key, and
default value. |
float |
getFloat(java.lang.String section,
java.lang.String key,
float defaultValue)
Retrieves a configuration item as a float, given its section, key, and default
value. |
int |
getInt(java.lang.String section,
java.lang.String key,
int defaultValue)
Retrieves a configuration item as an integer, given its section, key, and
default value. |
int |
getInt64(java.lang.String section,
java.lang.String key,
int defaultValue)
Retrieves a configuration item as a 64 bit integer, given its section, key, and
default value. |
java.lang.String[] |
getKeysNamesList(java.lang.String section)
Returns the list of keys' names for a section in the LinphoneConfig.
|
long |
getNativePointer()
Gets the native pointer used by this class to make native method calls.
|
boolean |
getOverwriteFlagForEntry(java.lang.String section,
java.lang.String key)
Retrieves the overwrite flag for a config item.
|
boolean |
getOverwriteFlagForSection(java.lang.String section)
Retrieves the overwrite flag for a config section.
|
java.lang.String |
getSectionParamString(java.lang.String section,
java.lang.String key,
java.lang.String defaultValue)
Retrieves a section parameter item as a string, given its section and key.
|
java.lang.String[] |
getSectionsNamesList()
Returns the list of sections' names in the LinphoneConfig.
|
boolean |
getSkipFlagForEntry(java.lang.String section,
java.lang.String key)
Retrieves the skip flag for a config item.
|
boolean |
getSkipFlagForSection(java.lang.String section)
Retrieves the skip flag for a config section.
|
java.lang.String |
getString(java.lang.String section,
java.lang.String key,
java.lang.String defaultString)
Retrieves a configuration item as a string, given its section, key, and default
value. |
java.lang.String[] |
getStringList(java.lang.String section,
java.lang.String key,
java.lang.String[] defaultList)
Retrieves a configuration item as a list of strings, given its section, key,
and default value. |
java.lang.Object |
getUserData()
Gets the object stored in this object user's data
|
int |
hasEntry(java.lang.String section,
java.lang.String key)
Returns if a given section with a given key is present in the configuration.
|
int |
hasSection(java.lang.String section)
Returns if a given section is present in the configuration.
|
java.lang.String |
loadFromXmlFile(java.lang.String filename)
Reads a xml config file and fill the
Config with the read configdynamic values. |
int |
loadFromXmlString(java.lang.String buffer)
Reads a xml config string and fill the
Config with the read configdynamic values. |
Config |
newFromBuffer(java.lang.String buffer)
Instantiates a
Config object from a user provided buffer. |
Config |
newWithFactory(java.lang.String configFilename,
java.lang.String factoryConfigFilename)
Instantiates a
Config object from a user config file and a factoryconfig file. |
int |
readFile(java.lang.String filename)
Reads a user config file and fill the
Config with the read configvalues. |
boolean |
relativeFileExists(java.lang.String filename)
Check if given file name exists relatively to the current location.
|
void |
reload()
Reload the config from the file.
|
void |
setBool(java.lang.String section,
java.lang.String key,
boolean value)
Sets a boolean config item.
|
void |
setFloat(java.lang.String section,
java.lang.String key,
float value)
Sets a float config item.
|
void |
setInt(java.lang.String section,
java.lang.String key,
int value)
Sets an integer config item.
|
void |
setInt64(java.lang.String section,
java.lang.String key,
int value)
Sets a 64 bits integer config item.
|
void |
setIntHex(java.lang.String section,
java.lang.String key,
int value)
Sets an integer config item, but store it as hexadecimal.
|
void |
setOverwriteFlagForEntry(java.lang.String section,
java.lang.String key,
boolean value)
Sets the overwrite flag for a config item (used when dumping config as xml)
|
void |
setOverwriteFlagForSection(java.lang.String section,
boolean value)
Sets the overwrite flag for a config section (used when dumping config as xml)
|
void |
setRange(java.lang.String section,
java.lang.String key,
int minValue,
int maxValue)
Sets a range config item.
|
void |
setSkipFlagForEntry(java.lang.String section,
java.lang.String key,
boolean value)
Sets the skip flag for a config item (used when dumping config as xml)
|
void |
setSkipFlagForSection(java.lang.String section,
boolean value)
Sets the skip flag for a config section (used when dumping config as xml)
|
void |
setString(java.lang.String section,
java.lang.String key,
java.lang.String value)
Sets a string config item.
|
void |
setStringList(java.lang.String section,
java.lang.String key,
java.lang.String[] value)
Sets a string list config item.
|
void |
setUserData(java.lang.Object data)
Sets the object to store in this object user's data
|
int |
sync()
Writes the config file to disk.
|
java.lang.String |
toString() |
void |
writeRelativeFile(java.lang.String filename,
java.lang.String data)
Write a string in a file placed relatively with the Linphone configuration
file. |
@NonNull java.lang.String[] getSectionsNamesList()
void cleanEntry(@NonNull
java.lang.String section,
@NonNull
java.lang.String key)
section - the section for which to clean the key entry key - the key to clean void cleanSection(@NonNull
java.lang.String section)
section - the section to clean @NonNull java.lang.String dump()
@NonNull java.lang.String dumpAsXml()
boolean getBool(@NonNull
java.lang.String section,
@NonNull
java.lang.String key,
boolean defaultValue)
section - The section from which to retrieve a configuration item key - The name of the configuration item to retrieve defaultValue - The default value to return if not found float getDefaultFloat(@NonNull
java.lang.String section,
@NonNull
java.lang.String key,
float defaultValue)
section - The section from which to retrieve the default value key - The name of the configuration item to retrieve defaultValue - The default value to return if not found int getDefaultInt(@NonNull
java.lang.String section,
@NonNull
java.lang.String key,
int defaultValue)
section - The section from which to retrieve the default value key - The name of the configuration item to retrieve defaultValue - The default value to return if not found int getDefaultInt64(@NonNull
java.lang.String section,
@NonNull
java.lang.String key,
int defaultValue)
section - The section from which to retrieve the default value key - The name of the configuration item to retrieve defaultValue - The default value to return if not found java.lang.String getDefaultString(@NonNull
java.lang.String section,
@NonNull
java.lang.String key,
java.lang.String defaultValue)
section - The section from which to retrieve the default value key - The name of the configuration item to retrieve defaultValue - The default value to return if not found float getFloat(@NonNull
java.lang.String section,
@NonNull
java.lang.String key,
float defaultValue)
section - The section from which to retrieve a configuration item key - The name of the configuration item to retrieve defaultValue - The default value to return if not found int getInt(@NonNull
java.lang.String section,
@NonNull
java.lang.String key,
int defaultValue)
section - The section from which to retrieve a configuration item key - The name of the configuration item to retrieve defaultValue - The default value to return if not found int getInt64(@NonNull
java.lang.String section,
@NonNull
java.lang.String key,
int defaultValue)
section - The section from which to retrieve a configuration item key - The name of the configuration item to retrieve defaultValue - The default value to return if not found @NonNull
java.lang.String[] getKeysNamesList(@NonNull
java.lang.String section)
section - The section name boolean getOverwriteFlagForEntry(@NonNull
java.lang.String section,
@NonNull
java.lang.String key)
section - The section from which to retrieve the overwrite flag key - The name of the configuration item to retrieve the overwrite flagboolean getOverwriteFlagForSection(@NonNull
java.lang.String section)
section - The section from which to retrieve the overwrite flag @Nullable
java.lang.String getSectionParamString(@NonNull
java.lang.String section,
@NonNull
java.lang.String key,
@Nullable
java.lang.String defaultValue)
section - The section from which to retrieve the default value key - The name of the configuration item to retrieve defaultValue - The default value to return if not found. boolean getSkipFlagForEntry(@NonNull
java.lang.String section,
java.lang.String key)
section - The section from which to retrieve the skip flag key - The name of the configuration item to retrieve the skip flag from boolean getSkipFlagForSection(@NonNull
java.lang.String section)
section - The section from which to retrieve the skip flag @Nullable
java.lang.String getString(@NonNull
java.lang.String section,
@NonNull
java.lang.String key,
@Nullable
java.lang.String defaultString)
section - The section from which to retrieve a configuration item key - The name of the configuration item to retrieve defaultString - The default value to return if not found. @NonNull
java.lang.String[] getStringList(@NonNull
java.lang.String section,
@NonNull
java.lang.String key,
@Nullable
java.lang.String[] defaultList)
section - The section from which to retrieve a configuration item key - The name of the configuration item to retrieve defaultList - The list to return when the key doesn't exist. int hasEntry(@NonNull
java.lang.String section,
@NonNull
java.lang.String key)
section - to check if the given entry exists key - to check if it exists int hasSection(@NonNull
java.lang.String section)
section - the section to check if exists java.lang.String loadFromXmlFile(@NonNull
java.lang.String filename)
filename - The filename of the config file to read to fill the Configint loadFromXmlString(@NonNull
java.lang.String buffer)
buffer - The string of the config file to fill the Config int readFile(@NonNull
java.lang.String filename)
filename - The filename of the config file to read to fill the Configboolean relativeFileExists(@NonNull
java.lang.String filename)
filename - The file name to check if exists void reload()
void setBool(@NonNull
java.lang.String section,
@NonNull
java.lang.String key,
boolean value)
section - The section from which to retrieve a configuration item key - The name of the configuration item to retrieve value - the value to set void setFloat(@NonNull
java.lang.String section,
@NonNull
java.lang.String key,
float value)
section - The section from which to retrieve a configuration item key - The name of the configuration item to retrieve value - the value to set void setInt(@NonNull
java.lang.String section,
@NonNull
java.lang.String key,
int value)
section - The section from which to retrieve a configuration item key - The name of the configuration item to retrieve value - the value to set void setInt64(@NonNull
java.lang.String section,
@NonNull
java.lang.String key,
int value)
section - The section from which to retrieve a configuration item key - The name of the configuration item to retrieve value - the value to set void setIntHex(@NonNull
java.lang.String section,
@NonNull
java.lang.String key,
int value)
section - The section from which to retrieve a configuration item key - The name of the configuration item to retrieve value - the value to set void setOverwriteFlagForEntry(@NonNull
java.lang.String section,
@NonNull
java.lang.String key,
boolean value)
section - The section from which to set the overwrite flag key - The name of the configuration item to set the overwrite flag from value - The overwrite flag value to set void setOverwriteFlagForSection(@NonNull
java.lang.String section,
boolean value)
section - The section from which to set the overwrite flag value - The overwrite flag value to set void setRange(@NonNull
java.lang.String section,
@NonNull
java.lang.String key,
int minValue,
int maxValue)
section - The section from which to retrieve a configuration item key - The name of the configuration item to retrieve minValue - the min value to set maxValue - the max value to set void setSkipFlagForEntry(@NonNull
java.lang.String section,
@NonNull
java.lang.String key,
boolean value)
section - The section from which to set the skip flag key - The name of the configuration item to set the skip flag from value - The skip flag value to set void setSkipFlagForSection(@NonNull
java.lang.String section,
boolean value)
section - The section from which to set the skip flag value - The skip flag value to set void setString(@NonNull
java.lang.String section,
@NonNull
java.lang.String key,
@Nullable
java.lang.String value)
section - The section from which to retrieve a configuration item key - The name of the configuration item to retrieve value - The value to set void setStringList(@NonNull
java.lang.String section,
@NonNull
java.lang.String key,
@Nullable
java.lang.String[] value)
section - The name of the section to put the configuration item into key - The name of the configuration item to set value - The value to set. int sync()
void writeRelativeFile(@NonNull
java.lang.String filename,
@NonNull
java.lang.String data)
filename - Name of the file where to write data. The name is relative todata - String to write @NonNull Config newFromBuffer(@NonNull java.lang.String buffer)
Config object from a user provided buffer. buffer - the buffer from which the Config will be retrieved. WenewWithFactory(java.lang.String, java.lang.String) Config object @Nullable Config newWithFactory(@Nullable java.lang.String configFilename, @Nullable java.lang.String factoryConfigFilename)
Config object from a user config file and a factoryconfigFilename - the filename of the user config file to read to fill theConfig factoryConfigFilename - the filename of the factory config file to read toConfig Config object Config and then thevoid setUserData(java.lang.Object data)
data - the object to storejava.lang.Object getUserData()
long getNativePointer()
java.lang.String toString()
toString in class java.lang.Object