Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

YAPET::CONFIG::Config Class Reference

Handle the command line and config file options. More...

#include <cfg.h>

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

List of all members.

Classes

struct  s_cl_filesecurity
 The request for checking file security on the command line. More...
struct  s_cl_ignorerc
 Ignoring the rc file provided on the command line. More...
struct  s_cl_petfile
 The .pet file to open provided on the command line. More...
struct  s_cl_struct
struct  s_cl_timeout
 The lock timeout provided on the command line. More...

Public Member Functions

 Config ()
 Config (const Config &c)
bool getAllowLockQuit () const
int getCharPools () const
bool getFilesecurity () const
std::string getPetFile () const
 Return the file to open upon start of YAPET.
size_t getPWGenPWLen () const
YAPET::PWGEN::RNGENGINE getPWGenRNG () const
unsigned int getPwInputTimeout () const
int getTimeout () const
void loadConfigFile (std::string filename="")
const Configoperator= (const Config &c)
void setFilesecurity (bool b)
void setIgnorerc (bool b)
void setPetFile (std::string s)
 Set the file to open upon start of YAPET.
void setTimeout (int i)
 ~Config ()

Static Public Member Functions

static bool getDefAllowLockQuit ()
static int getDefCharPools ()
static bool getDefCPoolDigits ()
static bool getDefCPoolLetters ()
static bool getDefCPoolOther ()
static bool getDefCPoolPunct ()
static bool getDefCPoolSpecial ()
static bool getDefFilesecurity ()
static bool getDefIgnorerc ()
static std::string getDefPetfile ()
static YAPET::PWGEN::RNGENGINE getDefPWGenRNG ()
static unsigned int getDefPwInputTimeout ()
static size_t getDefPWLength ()
static unsigned int getDefTimeout ()

Private Member Functions

std::string cleanupPath (const std::string &s) const
 Removes two or more consecutive slashes from the path.

Private Attributes

ConfigFilecfgfile
s_cl_filesecurity cl_filesecurity
s_cl_ignorerc cl_ignorerc
s_cl_petfile cl_petfile
s_cl_timeout cl_timeout

Static Private Attributes

static const bool def_allow_lock_quit
 Show the Quit button when unlocking screen.
static const int def_character_pools
 The default character subpools to use.
static const bool def_filesecurity
 Default for checking file security.
static const bool def_ignorerc
 Default for ignoring the rc file.
static const std::string def_petfile
 The default .pet file to open.
static const unsigned int def_pw_input_timeout
 Default for password input timeout.
static const
YAPET::PWGEN::RNGENGINE 
def_pwgen_rng
 Default rng.
static const size_t def_pwlen
 The default password length.
static const int def_timeout
 The default lock timeout.

Detailed Description

This class handles the command line and config file options.

Definition at line 50 of file cfg.h.


Constructor & Destructor Documentation

Config::Config (  ) 

Definition at line 140 of file cfg.cc.

Config::Config ( const Config c  ) 

Definition at line 148 of file cfg.cc.

References cfgfile, cl_filesecurity, cl_ignorerc, cl_petfile, and cl_timeout.

Config::~Config (  ) 

Definition at line 160 of file cfg.cc.

References cfgfile.


Member Function Documentation

std::string Config::cleanupPath ( const std::string &  s  )  const [private]

Definition at line 111 of file cfg.cc.

Referenced by getPetFile(), and setPetFile().

Here is the caller graph for this function:

bool Config::getAllowLockQuit (  )  const

Definition at line 379 of file cfg.cc.

References cfgfile, def_allow_lock_quit, and YAPET::CONFIG::ConfigFile::getAllowLockQuit().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int Config::getCharPools (  )  const
bool Config::getDefAllowLockQuit (  )  [static]

Definition at line 82 of file cfg.cc.

References def_allow_lock_quit.

int Config::getDefCharPools (  )  [static]

Definition at line 78 of file cfg.cc.

References def_character_pools.

bool Config::getDefCPoolDigits (  )  [static]

Definition at line 94 of file cfg.cc.

References def_character_pools, and YAPET::PWGEN::DIGITS.

bool Config::getDefCPoolLetters (  )  [static]

Definition at line 90 of file cfg.cc.

References def_character_pools, and YAPET::PWGEN::LETTERS.

bool Config::getDefCPoolOther (  )  [static]

Definition at line 106 of file cfg.cc.

References def_character_pools, and YAPET::PWGEN::OTHER.

bool Config::getDefCPoolPunct (  )  [static]

Definition at line 98 of file cfg.cc.

References def_character_pools, and YAPET::PWGEN::PUNCT.

bool Config::getDefCPoolSpecial (  )  [static]

Definition at line 102 of file cfg.cc.

References def_character_pools, and YAPET::PWGEN::SPECIAL.

bool Config::getDefFilesecurity (  )  [static]

Definition at line 62 of file cfg.cc.

References def_filesecurity.

bool Config::getDefIgnorerc (  )  [static]

Definition at line 66 of file cfg.cc.

References def_ignorerc.

std::string Config::getDefPetfile (  )  [static]

Definition at line 54 of file cfg.cc.

References def_petfile.

YAPET::PWGEN::RNGENGINE Config::getDefPWGenRNG (  )  [static]

Definition at line 70 of file cfg.cc.

References def_pwgen_rng.

unsigned int Config::getDefPwInputTimeout (  )  [static]

Definition at line 86 of file cfg.cc.

References def_pw_input_timeout.

size_t Config::getDefPWLength (  )  [static]

Definition at line 74 of file cfg.cc.

References def_pwlen.

Referenced by PWGenDialog::run().

Here is the caller graph for this function:

unsigned int Config::getDefTimeout (  )  [static]

Definition at line 58 of file cfg.cc.

References def_timeout.

bool Config::getFilesecurity (  )  const
std::string Config::getPetFile (  )  const

Definition at line 214 of file cfg.cc.

References cfgfile, cl_ignorerc, cl_petfile, cleanupPath(), def_petfile, YAPET::CONFIG::ConfigFile::getFileToLoad(), YAPET::CONFIG::Config::s_cl_ignorerc::ignore, YAPET::CONFIG::Config::s_cl_petfile::name, and YAPET::CONFIG::Config::s_cl_struct::set_on_cl.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

size_t Config::getPWGenPWLen (  )  const

Definition at line 348 of file cfg.cc.

References cfgfile, def_pwlen, and YAPET::CONFIG::ConfigFile::getPWGenPWLen().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

YAPET::PWGEN::RNGENGINE Config::getPWGenRNG (  )  const

Definition at line 339 of file cfg.cc.

References cfgfile, def_pwgen_rng, and YAPET::CONFIG::ConfigFile::getPWGenRNG().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int Config::getPwInputTimeout (  )  const

Definition at line 388 of file cfg.cc.

References cfgfile, def_pw_input_timeout, and YAPET::CONFIG::ConfigFile::getPwInputTimeout().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int Config::getTimeout (  )  const

Definition at line 255 of file cfg.cc.

References YAPET::CONFIG::Config::s_cl_timeout::amount, cfgfile, cl_ignorerc, cl_timeout, def_timeout, YAPET::CONFIG::ConfigFile::getLockTimeout(), YAPET::CONFIG::Config::s_cl_ignorerc::ignore, and YAPET::CONFIG::Config::s_cl_struct::set_on_cl.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void Config::loadConfigFile ( std::string  filename = ""  ) 
Parameters:
filename the file name to load. If empty, the default file will be loaded

Definition at line 169 of file cfg.cc.

References cfgfile, cl_ignorerc, YAPET::CONFIG::ConfigFile::getConfigFilePath(), YAPET::CONFIG::ConfigFile::getIgnoreRC(), YAPET::CONFIG::Config::s_cl_ignorerc::ignore, and YAPET::CONFIG::ConfigFile::isOpenSuccess().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

const Config & Config::operator= ( const Config c  ) 

Definition at line 398 of file cfg.cc.

References cfgfile, cl_filesecurity, cl_ignorerc, cl_petfile, and cl_timeout.

void YAPET::CONFIG::Config::setFilesecurity ( bool  b  )  [inline]

Definition at line 207 of file cfg.h.

References YAPET::CONFIG::Config::s_cl_filesecurity::check, cl_filesecurity, and YAPET::CONFIG::Config::s_cl_struct::set_on_cl.

Referenced by main().

Here is the caller graph for this function:

void YAPET::CONFIG::Config::setIgnorerc ( bool  b  )  [inline]

Definition at line 211 of file cfg.h.

References cl_ignorerc, YAPET::CONFIG::Config::s_cl_ignorerc::ignore, and YAPET::CONFIG::Config::s_cl_struct::set_on_cl.

Referenced by main().

Here is the caller graph for this function:

void YAPET::CONFIG::Config::setPetFile ( std::string  s  )  [inline]

Set the file to open upon start of YAPET. It will also make sure that the proper suffix is appended.

Parameters:
s the file path of the file.

Definition at line 191 of file cfg.h.

References cl_petfile, cleanupPath(), YAPET::CONSTS::Consts::getDefaultSuffix(), YAPET::CONFIG::Config::s_cl_petfile::name, and YAPET::CONFIG::Config::s_cl_struct::set_on_cl.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void YAPET::CONFIG::Config::setTimeout ( int  i  )  [inline]

Definition at line 203 of file cfg.h.

References YAPET::CONFIG::Config::s_cl_timeout::amount, cl_timeout, and YAPET::CONFIG::Config::s_cl_struct::set_on_cl.

Referenced by main().

Here is the caller graph for this function:


Member Data Documentation

Definition at line 155 of file cfg.h.

Referenced by Config(), getFilesecurity(), operator=(), and setFilesecurity().

Definition at line 153 of file cfg.h.

Referenced by Config(), getPetFile(), operator=(), and setPetFile().

Definition at line 154 of file cfg.h.

Referenced by Config(), getTimeout(), operator=(), and setTimeout().

const bool Config::def_allow_lock_quit [static, private]

Definition at line 69 of file cfg.h.

Referenced by getAllowLockQuit(), and getDefAllowLockQuit().

const int Config::def_character_pools [static, private]
const bool Config::def_filesecurity [static, private]

Definition at line 59 of file cfg.h.

Referenced by getDefFilesecurity(), and getFilesecurity().

const bool Config::def_ignorerc [static, private]

Definition at line 61 of file cfg.h.

Referenced by getDefIgnorerc().

const std::string Config::def_petfile [static, private]

Definition at line 55 of file cfg.h.

Referenced by getDefPetfile(), and getPetFile().

const unsigned int Config::def_pw_input_timeout [static, private]

Definition at line 71 of file cfg.h.

Referenced by getDefPwInputTimeout(), and getPwInputTimeout().

Definition at line 65 of file cfg.h.

Referenced by getDefPWGenRNG(), and getPWGenRNG().

const size_t Config::def_pwlen [static, private]

Definition at line 63 of file cfg.h.

Referenced by getDefPWLength(), and getPWGenPWLen().

const int Config::def_timeout [static, private]

Definition at line 57 of file cfg.h.

Referenced by getDefTimeout(), and getTimeout().


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