+bool Model_ValidatorsFactory::isCase(
+ FeaturePtr theFeature, std::string theAttribute)
+{
+ std::map<std::string, std::map<std::string, std::pair<std::string, std::string> > >::iterator
+ aFindFeature = myCases.find(theFeature->getKind());
+ if (aFindFeature != myCases.end()) {
+ std::map<std::string, std::pair<std::string, std::string> >::iterator
+ aFindAttr = aFindFeature->second.find(theAttribute);
+ if (aFindAttr != aFindFeature->second.end()) {
+ // the the switch-attribute that contains the case value
+ AttributeStringPtr aSwitch = theFeature->string(aFindAttr->second.first);
+ if (aSwitch.get()) {
+ return aSwitch->value() == aFindAttr->second.second; // the second is the case identifier
+ }
+ }
+ }
+ return true; // if no additional conditions, this attribute is the case to be validated
+}