Classes | Public Member Functions | List of all members
ndn::ConfigFile Class Reference

A ConfigFile locates, opens, and parses a library configuration file, and holds the values for the application to get. More...

#include <config-file.hpp>

Classes

class  Error
 

Public Member Functions

 ConfigFile ()
 Locate, open, and parse a library configuration file.
 
std::string get (const std::string &key, const std::string &defaultValue) const
 Get the value for the key, or a default value if not found. More...
 
const std::string & getPath () const
 Get the path of the configuration file. More...
 
const std::map< std::string, std::string > & getParsedConfiguration () const
 Get the configuration key/value pairs. More...
 

Detailed Description

A ConfigFile locates, opens, and parses a library configuration file, and holds the values for the application to get.

Member Function Documentation

std::string ndn::ConfigFile::get ( const std::string &  key,
const std::string &  defaultValue 
) const
inline

Get the value for the key, or a default value if not found.

Parameters
keyThe key to search for.
defaultValueThe default value if the key is not found.
Returns
The value, or defaultValue if the key is not found.
const std::map<std::string, std::string>& ndn::ConfigFile::getParsedConfiguration ( ) const
inline

Get the configuration key/value pairs.

Returns
A map of key/value pairs.
const std::string& ndn::ConfigFile::getPath ( ) const
inline

Get the path of the configuration file.

Returns
The path or an empty string if not found.

The documentation for this class was generated from the following files: