+
+ unsigned start = 0;
+ state = NORMAL;
+
+ while(1)
+ {
+ string::size_type underscore = str.find('_', start);
+ if(!str.compare(start, underscore-start, "NORMAL"))
+ state |= NORMAL;
+ else if(!str.compare(start, underscore-start, "HOVER"))
+ state |= HOVER;
+ else if(!str.compare(start, underscore-start, "ACTIVE"))
+ state |= ACTIVE;
+ else if(!str.compare(start, underscore-start, "FOCUS"))
+ state |= FOCUS;
+ else if(!str.compare(start, underscore-start, "DISABLED"))
+ state |= DISABLED;
+ else
+ {
+ is.setstate(ios_base::failbit);
+ break;
+ }
+
+ if(underscore==std::string::npos)
+ break;
+ start = underscore+1;
+ }