I'm trying to find an elegant way to parse a string like:
EVENT_TYPE(param1;param2; ...)
EVENT_TYPE is one of many string constants, each has zero or more parameters. So far I thought that given the sting "s" contains EVENT_TYPE(param1;param2) I'd write:
if (boost::istarts_with(s, "EVENT_TYPE")) {
std::istringstream iss(s);
int param1, param2;
iss >> "EVENT_TYPE(" >> param1 >> ";" >> param2 >> ")";
}
That would be nice to give a const string& and tell that way "skip these characters". Well, that's not the case. How would YOU THERE go about this? :-)
Thanks for advice!