You could map the strings to function pointer using a standard collection; executing the function when a match is found.
EDIT: Using the example in the article I gave the link to in my comment, you can declare a function pointer type:
typedef void (*funcPointer)(int);
and create multiple functions to match the signature:
void String1Action(int arg);
void String2Action(int arg);
The map would be std::string
to funcPointer
:
std::map<std::string, funcPointer> stringFunctionMap;
Then add the strings and function pointers:
stringFunctionMap.add("string1", &String1Action);
I've not tested any of the code I have just posted, it's off the top of my head :)