#include <cfg_getcap.h>
Public Member Functions | |
Getcap (const string &s) | |
~Getcap (void) | |
void | load_entry (const string &) |
Load/cache a capent from cap-db file. | |
Private Member Functions | |
int32_t | num (const string &) |
Load an entry from the cached capent and convert to a number. | |
std::string | str (const string &) |
Load an entry from the cached capent and return as a string. | |
Private Attributes | |
std::string | ent_name |
The entry name. | |
char * | capent |
Cache of the whole entry. | |
pthread_mutex_t | capent_mtx |
Mutex for protecting capent. |
This configuration file format is based on the getcap(3) routines that are common in the C library on BSD UNIX systems. It is the same set of library functions that are used for parsing termcap databases, and files of this format are often called termcap-style.
Definition at line 64 of file cfg_getcap.h.
Getcap::Getcap | ( | const string & | s | ) |
Getcap::~Getcap | ( | void | ) |
Definition at line 70 of file cfg_getcap.cc.
References capent, capent_mtx, and PTHREAD_CHECK_AND_THROW.
void Getcap::load_entry | ( | const string & | s | ) | [virtual] |
Load/cache a capent from cap-db file.
Implements Config.
Definition at line 95 of file cfg_getcap.cc.
References capent, capent_mtx, ent_name, Config::filename, num(), ConfigException::set_file(), and str().
int32_t Getcap::num | ( | const string & | key | ) | [private] |
Load an entry from the cached capent and convert to a number.
Get the numeric value of key.
Definition at line 221 of file cfg_getcap.cc.
References capent, and capent_mtx.
Referenced by load_entry().
string Getcap::str | ( | const string & | key | ) | [private] |
Load an entry from the cached capent and return as a string.
Get the string value of key, doing substitution of '&' with key.
Definition at line 243 of file cfg_getcap.cc.
References capent, capent_mtx, and ent_name.
Referenced by load_entry().
std::string Getcap::ent_name [private] |
char* Getcap::capent [private] |
Cache of the whole entry.
Definition at line 74 of file cfg_getcap.h.
Referenced by load_entry(), num(), str(), and ~Getcap().
pthread_mutex_t Getcap::capent_mtx [private] |
Mutex for protecting capent.
Definition at line 75 of file cfg_getcap.h.
Referenced by Getcap(), load_entry(), num(), str(), and ~Getcap().