- std::string Instance = R->getName();
- std::string Name = R->getValueAsString("Name");
- std::string Value = R->getValueAsString("Value");
- std::string Attribute = R->getValueAsString("Attribute");
-
- OS << " if ((Bits & " << Instance << ") != 0) "
- << Attribute << " = " << Value << ";\n";
+ const std::string &Instance = R->getName();
+ const std::string &Value = R->getValueAsString("Value");
+ const std::string &Attribute = R->getValueAsString("Attribute");
+
+ if (Value=="true" || Value=="false")
+ OS << " if ((Bits & " << Instance << ") != 0) "
+ << Attribute << " = " << Value << ";\n";
+ else
+ OS << " if ((Bits & " << Instance << ") != 0 && " << Attribute <<
+ " < " << Value << ") " << Attribute << " = " << Value << ";\n";