ucc::keyfile Class Reference

Traditional keypair config file parsing class. More...

#include <keydata.h>

Inheritance diagram for ucc::keyfile:
Inheritance graph
[legend]
Collaboration diagram for ucc::keyfile:
Collaboration graph
[legend]

Public Types

typedef linked_pointer< keydata > iterator
 Convenience typedef for iterative pointer.

Public Member Functions

keydata * begin (void) const
 Get first keydata object, for iterative examinations.
keydata * end (void) const
 Get last keydata object, for iterative examinations.
keydata * get (void) const
 Get the non-sectioned defaults if there are any.
keydata * get (const char *section) const
 Get a keydata section name.
 keyfile (const char *path, size_t pagesize=0)
 Create a key file object from an existing config file.
 keyfile (size_t pagesize=0)
 Create an empty key file ready for loading.
void load (const char *path)
 Load (overlay) another config file over the currently loaded one.
keydata * operator() (const char *section) const
keydata * operator[] (const char *section) const

Friends

class keydata

Detailed Description

Traditional keypair config file parsing class.

This is used to get generic config data either from a /etc/xxx.conf, a windows style xxx.ini file, or a ~/.xxxrc file, and parses [] sections from the entire file at once.

Definition at line 150 of file keydata.h.


Constructor & Destructor Documentation

ucc::keyfile::keyfile ( size_t  pagesize = 0  ) 

Create an empty key file ready for loading.

Parameters:
pagesize for memory paging.
ucc::keyfile::keyfile ( const char *  path,
size_t  pagesize = 0 
)

Create a key file object from an existing config file.

Parameters:
path to load from.
pagesize for memory paging.

Member Function Documentation

keydata* ucc::keyfile::begin ( void   )  const [inline]

Get first keydata object, for iterative examinations.

Returns:
first key value in chain.

Definition at line 205 of file keydata.h.

keydata* ucc::keyfile::end ( void   )  const [inline]

Get last keydata object, for iterative examinations.

Returns:
first key value in chain.

Definition at line 212 of file keydata.h.

keydata* ucc::keyfile::get ( void   )  const [inline]

Get the non-sectioned defaults if there are any.

Returns:
default key section.

Definition at line 198 of file keydata.h.

keydata* ucc::keyfile::get ( const char *  section  )  const

Get a keydata section name.

Parameters:
section name to look for.
Returns:
keydata section object if found, NULL if not.
void ucc::keyfile::load ( const char *  path  ) 

Load (overlay) another config file over the currently loaded one.

This is used to merge key data, such as getting default values from a global config, and then overlaying a local home config file.

Parameters:
path to load keys from into current object.

The documentation for this class was generated from the following file:
Generated on Tue Jul 6 08:22:31 2010 for UCommon by  doxygen 1.6.3