UCommon
Data Structures | Public Types | Public Member Functions | Friends
ucommon::keydata Class Reference

Data keys parsed from a keyfile. More...

#include <keydata.h>

Inheritance diagram for ucommon::keydata:
Inheritance graph
[legend]
Collaboration diagram for ucommon::keydata:
Collaboration graph
[legend]

Data Structures

class  keyvalue
 A key value set is used for iterative access. More...

Public Types

typedef linked_pointer< keyvalueiterator
 Convenience typedef for iterative pointer.

Public Member Functions

keyvaluebegin (void)
 Get first value object, for iterative examinations.
void clear (char *id)
 Remove a keyword id from the keydata structure.
keyvalueend (void)
 Get last value object, for iterative examinations.
char * get (char *id)
 Lookup a key value by it's id.
char * get (void)
 Get the name of this section.
char * operator() (char *id)
 Lookup a key value by it's id.
void set (char *id, char *value)
 Set a keyword and value in the keydata structure.
- Public Member Functions inherited from ucommon::OrderedObject
void delist (OrderedIndex *index)
 Remove our ordered object from an existing index.
virtual void enlist (OrderedIndex *index)
 List our ordered object in default strategy mode.
void enlistHead (OrderedIndex *index)
 List our ordered object at start of a linked list on an index.
void enlistTail (OrderedIndex *index)
 List our ordered object at end of a linked list on an index.
OrderedObjectgetNext (void)
 Get next ordered member when iterating.
- Public Member Functions inherited from ucommon::LinkedObject
void delist (LinkedObject **root)
 Locate and remove ourselves from a list of objects.
void enlist (LinkedObject **root)
 Add our object to an existing linked list through a pointer.
bool isMember (LinkedObject *list)
 Search to see if we are a member of a specific list.
virtual void release (void)
 Release list, mark as no longer linked.
virtual void retain (void)
 Retain by marking as self referenced list.
- Public Member Functions inherited from ucommon::ObjectProtocol
ObjectProtocolcopy (void)
 Retain (increase retention of) object when copying.
void operator++ (void)
 Increase retention operator.
void operator-- (void)
 Decrease retention operator.
virtual ~ObjectProtocol ()
 Required virtual destructor.

Friends

class keyfile
class keyvalue

Additional Inherited Members

- Protected Member Functions inherited from ucommon::OrderedObject
 OrderedObject (OrderedIndex *index)
 Construct an ordered object aot end of a an index.
 OrderedObject ()
 Construct an ordered object unattached.
- Protected Member Functions inherited from ucommon::LinkedObject
 LinkedObject (LinkedObject **root)
 Construct base class attached to a chain of objects.
 LinkedObject ()
 Construct base class unattached to anyone.

Detailed Description

Data keys parsed from a keyfile.

This is a specific [] section from a fully loaded keyfile, and offers common means to access data members. This is related to the original GNU Common C++ keydata object, although it is formed in a keyfile class which is loaded from a config file all at once.

Author:
David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org

Definition at line 57 of file keydata.h.


Member Function Documentation

keyvalue* ucommon::keydata::begin ( void  )
inline

Get first value object, for iterative examinations.

Returns:
first key value in chain.

Definition at line 128 of file keydata.h.

void ucommon::keydata::clear ( char *  id)

Remove a keyword id from the keydata structure.

Removed items still use pager allocated memory.

Parameters:
idto remove.
keyvalue* ucommon::keydata::end ( void  )
inline

Get last value object, for iterative examinations.

Returns:
first key value in chain.

Definition at line 135 of file keydata.h.

char* ucommon::keydata::get ( char *  id)

Lookup a key value by it's id.

Parameters:
idto look for.
Returns:
value string or NULL if not found.
char* ucommon::keydata::get ( void  )
inline

Get the name of this section.

Useful in iterative examinations.

Returns:
name of keydata section.

Definition at line 121 of file keydata.h.

char* ucommon::keydata::operator() ( char *  id)
inline

Lookup a key value by it's id.

Parameters:
idto look for.
Returns:
value string or NULL if not found.

Definition at line 98 of file keydata.h.

void ucommon::keydata::set ( char *  id,
char *  value 
)

Set a keyword and value in the keydata structure.

If the keyword already exists, it is replaced. Removed items still use pager allocated memory.

Parameters:
idto set.
valuefor the id.

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