Public Member Functions | Private Types | Private Member Functions | Private Attributes

YAPET::CONFIG::ConfigFile Class Reference

Parses the configuration file. More...

#include <cfgfile.h>

Collaboration diagram for YAPET::CONFIG::ConfigFile:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ConfigFile (std::string cfgfile="")
 ConfigFile (const ConfigFile &cfgfile)
bool getAllowLockQuit () const
const std::string & getConfigFilePath () const
const std::string & getFileToLoad () const
bool getIgnoreRC () const
unsigned int getLockTimeout () const
bool getPWGenDigits () const
bool getPWGenLetters () const
bool getPWGenOther () const
bool getPWGenPunct () const
size_t getPWGenPWLen () const
YAPET::PWGEN::RNGENGINE getPWGenRNG () const
bool getPWGenSpecial () const
unsigned int getPwInputTimeout () const
bool getUseFileSecurity () const
bool isOpenSuccess () const
const ConfigFileoperator= (const ConfigFile &cfgfile)
 ~ConfigFile ()

Private Types

enum  ReadResult { OPTION_NOT_FOUND, OPTION_EMPTY, OPTION_FOUND }

Private Member Functions

std::string getHomeDir () const
void parseFile ()
template<class t >
ReadResult readOption (std::string l, const std::string &needle, t &val)

Private Attributes

bool allowlockquit
std::string cfgfilepath
std::string filetoload
bool ignorerc
unsigned int locktimeout
bool opensuccess
 Indicates whether or not the file could have been opened.
bool pwgen_digits
bool pwgen_letters
bool pwgen_other
bool pwgen_punct
size_t pwgen_pwlen
YAPET::PWGEN::RNGENGINE pwgen_rng
bool pwgen_special
unsigned int pwinputtimeout
bool usefsecurity

Detailed Description

This class parses the per user configuration file.

Definition at line 54 of file cfgfile.h.


Member Enumeration Documentation

Values returned by readOption.

Enumerator:
OPTION_NOT_FOUND 
OPTION_EMPTY 
OPTION_FOUND 

Definition at line 59 of file cfgfile.h.


Constructor & Destructor Documentation

ConfigFile::ConfigFile ( std::string  cfgfile = ""  ) 

Definition at line 211 of file cfgfile.cc.

References cfgfilepath, YAPET::CONSTS::Consts::getDefaultRCFilename(), getHomeDir(), opensuccess, and parseFile().

Here is the call graph for this function:

ConfigFile::ConfigFile ( const ConfigFile cfgfile  ) 

Definition at line 261 of file cfgfile.cc.

YAPET::CONFIG::ConfigFile::~ConfigFile (  )  [inline]

Definition at line 118 of file cfgfile.h.


Member Function Documentation

bool YAPET::CONFIG::ConfigFile::getAllowLockQuit (  )  const [inline]

Definition at line 139 of file cfgfile.h.

References allowlockquit.

Referenced by YAPET::CONFIG::Config::getAllowLockQuit().

Here is the caller graph for this function:

const std::string& YAPET::CONFIG::ConfigFile::getConfigFilePath (  )  const [inline]

Definition at line 121 of file cfgfile.h.

References cfgfilepath.

Referenced by YAPET::CONFIG::Config::loadConfigFile().

Here is the caller graph for this function:

const std::string& YAPET::CONFIG::ConfigFile::getFileToLoad (  )  const [inline]

Definition at line 124 of file cfgfile.h.

References filetoload.

Referenced by YAPET::CONFIG::Config::getPetFile().

Here is the caller graph for this function:

std::string ConfigFile::getHomeDir (  )  const [private]

Definition at line 62 of file cfgfile.cc.

Referenced by ConfigFile(), and parseFile().

Here is the caller graph for this function:

bool YAPET::CONFIG::ConfigFile::getIgnoreRC (  )  const [inline]

Definition at line 133 of file cfgfile.h.

References ignorerc.

Referenced by YAPET::CONFIG::Config::loadConfigFile().

Here is the caller graph for this function:

unsigned int YAPET::CONFIG::ConfigFile::getLockTimeout (  )  const [inline]

Definition at line 130 of file cfgfile.h.

References locktimeout.

Referenced by YAPET::CONFIG::Config::getTimeout().

Here is the caller graph for this function:

bool YAPET::CONFIG::ConfigFile::getPWGenDigits (  )  const [inline]

Definition at line 151 of file cfgfile.h.

References pwgen_digits.

Referenced by YAPET::CONFIG::Config::getCharPools().

Here is the caller graph for this function:

bool YAPET::CONFIG::ConfigFile::getPWGenLetters (  )  const [inline]

Definition at line 148 of file cfgfile.h.

References pwgen_letters.

Referenced by YAPET::CONFIG::Config::getCharPools().

Here is the caller graph for this function:

bool YAPET::CONFIG::ConfigFile::getPWGenOther (  )  const [inline]

Definition at line 160 of file cfgfile.h.

References pwgen_other.

Referenced by YAPET::CONFIG::Config::getCharPools().

Here is the caller graph for this function:

bool YAPET::CONFIG::ConfigFile::getPWGenPunct (  )  const [inline]

Definition at line 154 of file cfgfile.h.

References pwgen_punct.

Referenced by YAPET::CONFIG::Config::getCharPools().

Here is the caller graph for this function:

size_t YAPET::CONFIG::ConfigFile::getPWGenPWLen (  )  const [inline]

Definition at line 145 of file cfgfile.h.

References pwgen_pwlen.

Referenced by YAPET::CONFIG::Config::getPWGenPWLen().

Here is the caller graph for this function:

YAPET::PWGEN::RNGENGINE YAPET::CONFIG::ConfigFile::getPWGenRNG (  )  const [inline]

Definition at line 142 of file cfgfile.h.

References pwgen_rng.

Referenced by YAPET::CONFIG::Config::getPWGenRNG().

Here is the caller graph for this function:

bool YAPET::CONFIG::ConfigFile::getPWGenSpecial (  )  const [inline]

Definition at line 157 of file cfgfile.h.

References pwgen_special.

Referenced by YAPET::CONFIG::Config::getCharPools().

Here is the caller graph for this function:

unsigned int YAPET::CONFIG::ConfigFile::getPwInputTimeout (  )  const [inline]

Definition at line 136 of file cfgfile.h.

References pwinputtimeout.

Referenced by YAPET::CONFIG::Config::getPwInputTimeout().

Here is the caller graph for this function:

bool YAPET::CONFIG::ConfigFile::getUseFileSecurity (  )  const [inline]

Definition at line 127 of file cfgfile.h.

References usefsecurity.

Referenced by YAPET::CONFIG::Config::getFilesecurity().

Here is the caller graph for this function:

bool YAPET::CONFIG::ConfigFile::isOpenSuccess (  )  const [inline]

Definition at line 163 of file cfgfile.h.

References opensuccess.

Referenced by YAPET::CONFIG::Config::loadConfigFile().

Here is the caller graph for this function:

const ConfigFile & ConfigFile::operator= ( const ConfigFile cfgfile  ) 
void ConfigFile::parseFile (  )  [private]

Definition at line 96 of file cfgfile.cc.

References allowlockquit, cfgfilepath, filetoload, YAPET::CONSTS::Consts::getDefaultSuffix(), getHomeDir(), ignorerc, locktimeout, OPTION_EMPTY, OPTION_NOT_FOUND, pwgen_digits, pwgen_letters, pwgen_other, pwgen_punct, pwgen_pwlen, pwgen_rng, pwgen_special, pwinputtimeout, and usefsecurity.

Referenced by ConfigFile().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class t >
ReadResult YAPET::CONFIG::ConfigFile::readOption ( std::string  l,
const std::string &  needle,
t &  val 
) [inline, private]

Reads single options into the variable specified.

Parameters:
l line read from the config file
needle name of the option including the '=' sign
ref reference where to store the value read.
Returns:
a value from ReadResult. val is only touched if return value is OPTION_FOUND.

Definition at line 100 of file cfgfile.h.

References OPTION_EMPTY.


Member Data Documentation

Definition at line 69 of file cfgfile.h.

Referenced by getAllowLockQuit(), operator=(), and parseFile().

Definition at line 72 of file cfgfile.h.

Referenced by ConfigFile(), getConfigFilePath(), operator=(), and parseFile().

Definition at line 65 of file cfgfile.h.

Referenced by getFileToLoad(), operator=(), and parseFile().

Definition at line 71 of file cfgfile.h.

Referenced by getIgnoreRC(), and parseFile().

Definition at line 67 of file cfgfile.h.

Referenced by getLockTimeout(), operator=(), and parseFile().

Definition at line 75 of file cfgfile.h.

Referenced by ConfigFile(), isOpenSuccess(), and operator=().

Definition at line 79 of file cfgfile.h.

Referenced by getPWGenDigits(), operator=(), and parseFile().

Definition at line 78 of file cfgfile.h.

Referenced by getPWGenLetters(), operator=(), and parseFile().

Definition at line 82 of file cfgfile.h.

Referenced by getPWGenOther(), operator=(), and parseFile().

Definition at line 80 of file cfgfile.h.

Referenced by getPWGenPunct(), operator=(), and parseFile().

Definition at line 84 of file cfgfile.h.

Referenced by getPWGenPWLen(), operator=(), and parseFile().

Definition at line 83 of file cfgfile.h.

Referenced by getPWGenRNG(), operator=(), and parseFile().

Definition at line 81 of file cfgfile.h.

Referenced by getPWGenSpecial(), operator=(), and parseFile().

Definition at line 68 of file cfgfile.h.

Referenced by getPwInputTimeout(), operator=(), and parseFile().

Definition at line 66 of file cfgfile.h.

Referenced by getUseFileSecurity(), operator=(), and parseFile().


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