Class: ConfigFile

ConfigFile()

new ConfigFile()

A ConfigFile locates, opens, and parses a library configuration file, and holds the values for the application to get. Locate, open, and parse a library configuration file.
Source:

Methods

(static) findConfigFile_() → {string}

Look for the configuration file in these well-known locations: 1. $HOME/.ndn/client.conf 2. /etc/ndn/client.conf We don't support the C++ #define value @SYSCONFDIR@.
Source:
Returns:
The path of the config file or an empty string if not found.
Type
string

get(key, defaultValue) → {string}

Get the value for the key, or a default value if not found.
Parameters:
Name Type Description
key string The key to search for.
defaultValue string The default value if the key is not found.
Source:
Returns:
The value, or defaultValue if the key is not found.
Type
string

getParsedConfiguration() → {object}

Get the configuration key/value pairs.
Source:
Returns:
An associative array of the key/value pairs.
Type
object

getPath() → {string}

Get the path of the configuration file.
Source:
Returns:
The path or an empty string if not found.
Type
string

parse_()

Open path_, parse the configuration file and set config_.
Source: