Public Types | Public Member Functions | Friends

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< keydataiterator
 Convenience typedef for iterative pointer.

Public Member Functions

keydatabegin (void) const
 Get first keydata object, for iterative examinations.
keydataend (void) const
 Get last keydata object, for iterative examinations.
int err (void)
keydataget (void) const
 Get the non-sectioned defaults if there are any.
keydataget (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.
keydataoperator() (const char *section) const
keydataoperator[] (const char *section) const
void release (void)
 Release and re-initialize keyfile.

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 211 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 218 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 204 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: