#include <cenum.h>
Inheritance diagram for cEnum:
The class basically implements effective integer-to-string mapping. Primary usage is to support displaying symbolic names for integer values that represent some code (such as an enum or define). To be used mostly from Tkenv and possibly other user interfaces.
Public Member Functions | |
Constructors, destructor, assignment. | |
cEnum (const cEnum &cenum) | |
cEnum (const char *name=NULL, int siz=17) | |
virtual | ~cEnum () |
cEnum & | operator= (const cEnum &list) |
Redefined cObject member functions. | |
virtual cPolymorphic * | dup () const |
virtual std::string | info () const |
Insertion and lookup. | |
void | insert (int key, const char *str) |
const char * | stringFor (int key) |
int | lookup (const char *str, int fallback=-1) |
|
Copy constructor.
|
|
Constructor.
|
|
Destructor.
|
|
Creates and returns an exact copy of this object. See cObject for more details. Reimplemented from cObject. |
|
Produces a one-line description of object contents into the buffer passed as argument. See cObject for more details. Reimplemented from cPolymorphic. |
|
Add an item to the enum. If that numeric code exist, overwrite it. |
|
Look up string and return numeric code. If not found, return second argument (or -1). |
|
Assignment operator. The name member doesn't get copied; see cObject's operator=() for more details. |
|
Look up key and return string representation. Return NULL if not found. |