rutz::assoc_array< value_t > Class Template Reference

rutz::assoc_array is a typesafe wrapper of rutz::assoc_array_base. More...

#include <rutz/assocarray.h>

Inheritance diagram for rutz::assoc_array< value_t >:

Inheritance graph
[legend]
Collaboration diagram for rutz::assoc_array< value_t >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 assoc_array (const char *descr, bool nocase=false)
 Default constructor.
rutz::fstring get_known_keys (const char *sep) const
 Get a string listing of known keys, separated by the string sep.
void throw_for_key (const char *key, const rutz::file_pos &pos) const
 Raise an exception reporting an unknown key.
void throw_for_key (const rutz::fstring &key, const rutz::file_pos &pos) const
 Raise an exception reporting an unknown key.
value_t * get_ptr_for_key (const rutz::fstring &key) const
 Get the object associated with the given key.
value_t * get_ptr_for_key (const char *key) const
 Get the object associated with the given key.
void set_ptr_for_key (const char *key, value_t *ptr)
 Associate the object at ptr with the given key.


Detailed Description

template<class value_t>
class rutz::assoc_array< value_t >

rutz::assoc_array is a typesafe wrapper of rutz::assoc_array_base.

Definition at line 104 of file assocarray.h.


Constructor & Destructor Documentation

template<class value_t>
rutz::assoc_array< value_t >::assoc_array ( const char *  descr,
bool  nocase = false 
) [inline]

Default constructor.

Parameters:
descr a human-readable description of what this array's keys represent; this is used in error messages, e.g. if descr is "frobnicator", then error messages would include "unknown frobnicator"
nocase true if the array should use case-insensitive string comparisons (default is false, giving normal case-sensitive string comparisons)

Definition at line 117 of file assocarray.h.


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

The software described here is Copyright (c) 1998-2005, Rob Peters.
This page was generated Wed Dec 3 06:56:31 2008 by Doxygen version 1.5.5.