class i2sMapper

maps integers (typically: enumeration values) to Strings. More...

Full nameEnumBase::i2sMapper
Definition#include <lib/Enum.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

maps integers (typically: enumeration values) to Strings. Takes care of the fact, that an Integer may map to multiple strings (sometimes multiple enumeration values represent the same integer).

Provides a means to get the string representation of an integer and vice versa.

void  add (long, const char*)

adds a new int -> string mapping Does NOT take over responsibility for the pointer (i.e. it is not freed), so it is save to add constant strings provided in the program code.

std::string  lookup (long)

[const]

returns the string representation for this integer. If there are multiple strings for this integer, return a comma delimited list.

long  lookup (const char *)

[const]

returns the integer associated with the given string or -1 if the value is not found (XXX: this should throw an exception).

bool  inRange (long)

[const]

returns true, if we have an representation for the given integer.