IncronCfg(3)

NAME
IncronCfg -

Configuration class'.

SYNOPSIS

#include <incroncfg.h>

  Static Public Member Functions
static void Init ()
Initializes default configuration values'.
static void Load (const std::string &rPath)
Loads configuration values'.
static bool GetValue (const std::string &rKey, std::string &rVal)
Retrieves a configuration value'.
static bool GetValue (const std::string &rKey, int &rVal)
Retrieves a configuration value'.
static bool GetValue (const std::string &rKey, unsigned &rVal)
Retrieves a configuration value'.
static bool GetValue (const std::string &rKey, bool &rVal)
Retrieves a configuration value'.
static std::string BuildPath (const std::string &rPath, const std::string &rName)
Builds a file path'.

  Static Protected Member Functions
static bool ParseLine (const char *s, std::string &rKey, std::string &rVal)
Parses a line a attempts to get a key and a value'.
static bool IsComment (const char *s)
Checks whether a line is a comment'.

Detailed Description

Configuration class'. This class provides access to values loaded from a configuration file (either a explicitly specified one or the default one)'.

Member Function Documentation

  std::string IncronCfg::BuildPath (const std::string &rPath, const std::string &rName) [static]

Builds a file path'. This function composes a path from a base path and a file name'.

Parameters:
    rPath base path
    rName file name

Returns:
    full path

  bool IncronCfg::GetValue (const std::string &rKey, std::string &rVal) [static]

Retrieves a configuration value'. This method attempts to find the appropriate configuration value for the given key and stores it into the given variable'.

Parameters:
    rKey value key
    rVal retrieved value

Returns:
    true = success, false = failure (invalid key)

  bool IncronCfg::GetValue (const std::string &rKey, int &rVal) [static]

Retrieves a configuration value'. This method attempts to find the appropriate configuration value for the given key and stores it into the given variable'.

Parameters:
    rKey value key
    rVal retrieved value

Returns:
    true = success, false = failure (invalid key)

  bool IncronCfg::GetValue (const std::string &rKey, unsigned &rVal) [static]

Retrieves a configuration value'. This method attempts to find the appropriate configuration value for the given key and stores it into the given variable'.

Parameters:
    rKey value key
    rVal retrieved value

Returns:
    true = success, false = failure (invalid key)

  bool IncronCfg::GetValue (const std::string &rKey, bool &rVal) [static]

Retrieves a configuration value'. This method attempts to find the appropriate configuration value for the given key and stores it into the given variable'.

Parameters:
    rKey value key
    rVal retrieved value

Returns:
    true = success, false = failure (invalid key)

  void IncronCfg::Init () [static]

Initializes default configuration values'.

  bool IncronCfg::IsComment (const char *s) [static, protected]

Checks whether a line is a comment'. Parameters:
    s text line

Returns:
    true = comment, false = otherwise

  void IncronCfg::Load (const std::string &rPath) [static]

Loads configuration values'. This method attempts to load configuration values from the specified file'. If it fails (e'.g'. the file doesn't exist) the default file is read'. As the last resort (for the case the default file can't be loaded) the hard-wired values are used'.

Parameters:
    rPath configuration file path

  bool IncronCfg::ParseLine (const char *s, std::string &rKey, std::string &rVal) [static, protected]

Parses a line a attempts to get a key and a value'. Parameters:
    s text line
    rKey key
    rVal value

Returns:
    true = success, false = failure

Author

Generated automatically by Doxygen for incron from the source code'.