Thanks for the script
Simian Man!
Now, to clear it up; what I want to is to have attributes in a file, in some cases defined by other attributes. I think an rpg game is a better example than the key bindings (dont care about the math for now, its another problem);
ATTR_STR = 50
ATTR_DEX = 20
ATTR_ATK = ATTR_STR * ATTR_DEX + 100
A file looking like this would be easy to parse with the operator>>. So that part of the problem is solved.
But say I had an xml file defining items or something (point is, I have the enums in the xml file);
<root> <item type="somethingcool"> <requirements key="ATTR_STR" val="40" /> </item></root>
Consider the initial problem solved - reading enums from a simple config file - but now the next problem is how to handle the enums in the xml files. I use TinyXml which lets me retrieve them as a std::string or const char* and therefor I need some way of using the operator (see my second post) or a second way of doing the conversion.
Either that, or I come up with a way of defining the items without xml. Maybe define my own file format? That way, I could read the enums with the operator.
Any thoughts? Sorry about being unclear before.