External: LpConfig

LpConfig

The LpConfig object is used to manipulate a configuration file.
Source:

Methods

cleanSection(section) → {void}

Removes every pair of key,value in a section and remove the section.
Parameters:
Name Type Description
section string -
Source:
Returns:
Type
void

getDefaultFloat(section, key, default_value) → {number}

Retrieves a default configuration item as a float, given its section, key, and default value.
Parameters:
Name Type Description
section string -
key string -
default_value number -
Source:
Returns:
Type
number

getDefaultInt(section, key, default_value) → {number}

Retrieves a default configuration item as an integer, given its section, key, and default value.
Parameters:
Name Type Description
section string -
key string -
default_value number -
Source:
Returns:
Type
number

getDefaultInt64(section, key, default_value) → {number}

Retrieves a default configuration item as a 64 bit integer, given its section, key, and default value.
Parameters:
Name Type Description
section string -
key string -
default_value number -
Source:
Returns:
Type
number

getDefaultString(section, key, default_value) → {string}

Retrieves a default configuration item as a string, given its section, key, and default value.
Parameters:
Name Type Description
section string -
key string -
default_value string -
Source:
Returns:
Type
string

getFloat(section, key, default_value) → {number}

Retrieves a configuration item as a float, given its section, key, and default value.
Parameters:
Name Type Description
section string -
key string -
default_value number -
Source:
Returns:
Type
number

getInt(section, key, default_value) → {number}

Retrieves a configuration item as an integer, given its section, key, and default value.
Parameters:
Name Type Description
section string -
key string -
default_value number -
Source:
Returns:
Type
number

getInt64(section, key, default_value) → {number}

Retrieves a configuration item as a 64 bit integer, given its section, key, and default value.
Parameters:
Name Type Description
section string -
key string -
default_value number -
Source:
Returns:
Type
number

getRange(section, key, min, max, default_min, default_max) → {boolean}

Retrieves a configuration item as a range, given its section, key, and default min and max values.
Parameters:
Name Type Description
section string -
key string -
min number -
max number -
default_min number -
default_max number -
Source:
Returns:
Type
boolean

getSectionParamString(section, key, default_value) → {string}

Retrieves a section parameter item as a string, given its section and key.
Parameters:
Name Type Description
section string -
key string -
default_value string -
Source:
Returns:
Type
string

getString(section, key, default_string) → {string}

Retrieves a configuration item as a string, given its section, key, and default value.
Parameters:
Name Type Description
section string -
key string -
default_string string -
Source:
Returns:
Type
string

hasSection(section) → {number}

Returns 1 if a given section is present in the configuration.
Parameters:
Name Type Description
section string -
Source:
Returns:
Type
number

loadDictToSection(section, dict) → {void}

Loads a dictionary into a section of the lpconfig. If the section doesn't exist it is created. Overwrites existing keys, creates non-existing keys.
Parameters:
Name Type Description
section string -
dict external:LinphoneDictionary -
Source:
Returns:
Type
void

readFile(filename) → {number}

Reads a user config file and fill the LpConfig with the read config values.
Parameters:
Name Type Description
filename string The filename of the config file to read to fill the LpConfig
Source:
Returns:
Type
number

sectionToDict(section) → {external:LinphoneDictionary}

Converts a config section into a dictionary.
Parameters:
Name Type Description
section string -
Source:
Returns:
Type
external:LinphoneDictionary

setFloat(section, key, value) → {void}

Sets a float config item
Parameters:
Name Type Description
section string -
key string -
value number -
Source:
Returns:
Type
void

setInt(section, key, value) → {void}

Sets an integer config item
Parameters:
Name Type Description
section string -
key string -
value number -
Source:
Returns:
Type
void

setInt64(section, key, value) → {void}

Sets a 64 bits integer config item
Parameters:
Name Type Description
section string -
key string -
value number -
Source:
Returns:
Type
void

setIntHex(section, key, value) → {void}

Sets an integer config item, but store it as hexadecimal
Parameters:
Name Type Description
section string -
key string -
value number -
Source:
Returns:
Type
void

setRange(section, key, min_value, max_value) → {void}

Sets a range config item
Parameters:
Name Type Description
section string -
key string -
min_value number -
max_value number -
Source:
Returns:
Type
void

setString(section, key, value) → {void}

Sets a string config item
Parameters:
Name Type Description
section string -
key string -
value string -
Source:
Returns:
Type
void

sync() → {number}

Writes the config file to disk.
Source:
Returns:
Type
number