I'm working on a "Menu Manager" that will let me display menus that are saved as a text file. This way I can add or remove menu items without having to recompile the whole program. The problem I am having is how to match the menu items that are read from the text file to the actual function calls. After reading around a bit I figure the best way to do this is to use a std::map to map the menu items with pointers to the correct function. So I figure I could parse through the text file, extracting each menu item and mapping a function pointer to it. However, I would still have to recompile the file eveytime I change a menu so that the correct function pointers would be mapped.
Is there a better way to do this using c++ or am I just stuck using a bunch of if/then statements and changing it everytime I add or remove menu items?