Getcap Class Reference
[Configuration-related objects]

A configuration system based on the BSD getcap(3) library routines. More...

#include <cfg_getcap.h>

Inheritance diagram for Getcap:

Inheritance graph
[legend]
Collaboration diagram for Getcap:

Collaboration graph
[legend]

List of all members.

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.


Detailed Description

A configuration system based on the BSD getcap(3) library routines.

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.

See also:
ConfigFactory

Definition at line 64 of file cfg_getcap.h.


Constructor & Destructor Documentation

Getcap::Getcap ( const string &  s  ) 

Definition at line 57 of file cfg_getcap.cc.

References capent_mtx, and PTHREAD_CHECK_AND_THROW.

Getcap::~Getcap ( void   ) 

Definition at line 70 of file cfg_getcap.cc.

References capent, capent_mtx, and PTHREAD_CHECK_AND_THROW.


Member Function Documentation

void Getcap::load_entry ( const string &  s  )  [virtual]

Load/cache a capent from cap-db file.

Todo:
We should probabaly convert this code in Getcap::load_entry() to use the vector<> Config::config_keys.

Todo:
Perhaps the Getcap code should recognize both the 'local_socket' name, as well as the older 'sf' (socket file) name/key.

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

Here is the call graph for this function:

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:


Member Data Documentation

std::string Getcap::ent_name [private]

The entry name.

Definition at line 73 of file cfg_getcap.h.

Referenced by load_entry(), and str().

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


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

Generated on Tue May 13 11:32:45 2008 for consmgr by  doxygen 1.5.5