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

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

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 141 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   )  [inline]

Get first keydata object, for iterative examinations.

Returns:
first key value in chain.

Definition at line 196 of file keydata.h.

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

Get last keydata object, for iterative examinations.

Returns:
first key value in chain.

Definition at line 203 of file keydata.h.

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

Get the non-sectioned defaults if there are any.

Returns:
default key section.

Definition at line 189 of file keydata.h.

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

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 by  doxygen 1.6.2