Parses the configuration file. More...
#include <cfgfile.h>

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 ConfigFile & | operator= (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 |
This class parses the per user configuration file.
Definition at line 54 of file cfgfile.h.
enum YAPET::CONFIG::ConfigFile::ReadResult [private] |
| ConfigFile::ConfigFile | ( | std::string | cfgfile = "" |
) |
Definition at line 211 of file cfgfile.cc.
References cfgfilepath, YAPET::CONSTS::Consts::getDefaultRCFilename(), getHomeDir(), opensuccess, and parseFile().

| ConfigFile::ConfigFile | ( | const ConfigFile & | cfgfile | ) |
Definition at line 261 of file cfgfile.cc.
| bool YAPET::CONFIG::ConfigFile::getAllowLockQuit | ( | ) | const [inline] |
Definition at line 139 of file cfgfile.h.
References allowlockquit.
Referenced by YAPET::CONFIG::Config::getAllowLockQuit().

| 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().

| 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().

| std::string ConfigFile::getHomeDir | ( | ) | const [private] |
Definition at line 62 of file cfgfile.cc.
Referenced by ConfigFile(), and parseFile().

| bool YAPET::CONFIG::ConfigFile::getIgnoreRC | ( | ) | const [inline] |
Definition at line 133 of file cfgfile.h.
References ignorerc.
Referenced by YAPET::CONFIG::Config::loadConfigFile().

| unsigned int YAPET::CONFIG::ConfigFile::getLockTimeout | ( | ) | const [inline] |
Definition at line 130 of file cfgfile.h.
References locktimeout.
Referenced by YAPET::CONFIG::Config::getTimeout().

| bool YAPET::CONFIG::ConfigFile::getPWGenDigits | ( | ) | const [inline] |
Definition at line 151 of file cfgfile.h.
References pwgen_digits.
Referenced by YAPET::CONFIG::Config::getCharPools().

| bool YAPET::CONFIG::ConfigFile::getPWGenLetters | ( | ) | const [inline] |
Definition at line 148 of file cfgfile.h.
References pwgen_letters.
Referenced by YAPET::CONFIG::Config::getCharPools().

| bool YAPET::CONFIG::ConfigFile::getPWGenOther | ( | ) | const [inline] |
Definition at line 160 of file cfgfile.h.
References pwgen_other.
Referenced by YAPET::CONFIG::Config::getCharPools().

| bool YAPET::CONFIG::ConfigFile::getPWGenPunct | ( | ) | const [inline] |
Definition at line 154 of file cfgfile.h.
References pwgen_punct.
Referenced by YAPET::CONFIG::Config::getCharPools().

| 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().

| 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().

| bool YAPET::CONFIG::ConfigFile::getPWGenSpecial | ( | ) | const [inline] |
Definition at line 157 of file cfgfile.h.
References pwgen_special.
Referenced by YAPET::CONFIG::Config::getCharPools().

| unsigned int YAPET::CONFIG::ConfigFile::getPwInputTimeout | ( | ) | const [inline] |
Definition at line 136 of file cfgfile.h.
References pwinputtimeout.
Referenced by YAPET::CONFIG::Config::getPwInputTimeout().

| bool YAPET::CONFIG::ConfigFile::getUseFileSecurity | ( | ) | const [inline] |
Definition at line 127 of file cfgfile.h.
References usefsecurity.
Referenced by YAPET::CONFIG::Config::getFilesecurity().

| bool YAPET::CONFIG::ConfigFile::isOpenSuccess | ( | ) | const [inline] |
Definition at line 163 of file cfgfile.h.
References opensuccess.
Referenced by YAPET::CONFIG::Config::loadConfigFile().

| const ConfigFile & ConfigFile::operator= | ( | const ConfigFile & | cfgfile | ) |
Definition at line 279 of file cfgfile.cc.
References allowlockquit, cfgfilepath, filetoload, locktimeout, opensuccess, pwgen_digits, pwgen_letters, pwgen_other, pwgen_punct, pwgen_pwlen, pwgen_rng, pwgen_special, pwinputtimeout, and usefsecurity.
| 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().


| ReadResult YAPET::CONFIG::ConfigFile::readOption | ( | std::string | l, | |
| const std::string & | needle, | |||
| t & | val | |||
| ) | [inline, private] |
Reads single options into the variable specified.
| l | line read from the config file | |
| needle | name of the option including the '=' sign | |
| ref | reference where to store the value read. |
val is only touched if return value is OPTION_FOUND. Definition at line 100 of file cfgfile.h.
References OPTION_EMPTY.
bool YAPET::CONFIG::ConfigFile::allowlockquit [private] |
Definition at line 69 of file cfgfile.h.
Referenced by getAllowLockQuit(), operator=(), and parseFile().
std::string YAPET::CONFIG::ConfigFile::cfgfilepath [private] |
Definition at line 72 of file cfgfile.h.
Referenced by ConfigFile(), getConfigFilePath(), operator=(), and parseFile().
std::string YAPET::CONFIG::ConfigFile::filetoload [private] |
Definition at line 65 of file cfgfile.h.
Referenced by getFileToLoad(), operator=(), and parseFile().
bool YAPET::CONFIG::ConfigFile::ignorerc [private] |
Definition at line 71 of file cfgfile.h.
Referenced by getIgnoreRC(), and parseFile().
unsigned int YAPET::CONFIG::ConfigFile::locktimeout [private] |
Definition at line 67 of file cfgfile.h.
Referenced by getLockTimeout(), operator=(), and parseFile().
bool YAPET::CONFIG::ConfigFile::opensuccess [private] |
Definition at line 75 of file cfgfile.h.
Referenced by ConfigFile(), isOpenSuccess(), and operator=().
bool YAPET::CONFIG::ConfigFile::pwgen_digits [private] |
Definition at line 79 of file cfgfile.h.
Referenced by getPWGenDigits(), operator=(), and parseFile().
bool YAPET::CONFIG::ConfigFile::pwgen_letters [private] |
Definition at line 78 of file cfgfile.h.
Referenced by getPWGenLetters(), operator=(), and parseFile().
bool YAPET::CONFIG::ConfigFile::pwgen_other [private] |
Definition at line 82 of file cfgfile.h.
Referenced by getPWGenOther(), operator=(), and parseFile().
bool YAPET::CONFIG::ConfigFile::pwgen_punct [private] |
Definition at line 80 of file cfgfile.h.
Referenced by getPWGenPunct(), operator=(), and parseFile().
size_t YAPET::CONFIG::ConfigFile::pwgen_pwlen [private] |
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().
bool YAPET::CONFIG::ConfigFile::pwgen_special [private] |
Definition at line 81 of file cfgfile.h.
Referenced by getPWGenSpecial(), operator=(), and parseFile().
unsigned int YAPET::CONFIG::ConfigFile::pwinputtimeout [private] |
Definition at line 68 of file cfgfile.h.
Referenced by getPwInputTimeout(), operator=(), and parseFile().
bool YAPET::CONFIG::ConfigFile::usefsecurity [private] |
Definition at line 66 of file cfgfile.h.
Referenced by getUseFileSecurity(), operator=(), and parseFile().
1.7.1