Main Page   Compound List   File List   Compound Members   File Members  

An Enumeration to const char * translation template Documentation

This is an example of a template that can be used to translate enumeration values into strings (which will usually be a string version of the enumeration name). These enumerations can be packaged within a class, which avoids making the enumeration identifiers global.

The template is EnumTranslate

Two example classes are included, class Fruit and class Numbers. These classes define local enumeration sets and instantiate the EnumTranslate template.

Each instance of the template has its own static table used to translate between enumeration values and C strings.

Copyright and Use

You may use this source code without limitation and without fee as long as you include:

     This software was written and is copyrighted by Ian Kaplan, Bear
     Products International,, 2001, 2002.

This software is provided "as is", without any warrenty or claim as to its usefulness. Anyone who uses this source code uses it at their own risk. Nor is any support provided by Ian Kaplan and Bear Products International.

Generated at Mon May 13 14:07:31 2002 for An Enumeration to const char * translation template by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001