COVISE Core
|
#include <coStringTable.h>
Public Member Functions | |
coStringTable () | |
default Constructor More... | |
void | insert (int number, const char *str) |
bool | isElement (int x) |
bool | isElement (const char *str) |
const char * | operator[] (int x) |
int | operator[] (const char *str) |
Private Attributes | |
std::map< const char *, int, ltstr > * | cs_ |
std::map< int, const char *, ltint > * | ci_ |
a coStringTable object may have a string or an integer as index. You can either search for the integer and get the string or search for the string and get the integer. Examples: coStringTable sample; sample.insert(177, "foo");
gives foo cout << sample[177] << endl; gives 177 cout << sample["foo"] << endl;
coStringTable::coStringTable | ( | ) |
default Constructor
void coStringTable::insert | ( | int | number, |
const char * | str | ||
) |
Insert a pair of integer/string
number | the number belonging to the string |
str | the string to be inserted |
bool coStringTable::isElement | ( | int | x | ) |
check whether an integer occurs in the table
x | the integer to be found |
bool coStringTable::isElement | ( | const char * | str | ) |
check whether a string occurs in the table
const char * coStringTable::operator[] | ( | int | x | ) |
get the string belonging to the integer
x | the integer in question |
int coStringTable::operator[] | ( | const char * | str | ) |
get the integer belonging to the string
str |
|
private |
|
private |