| 111 | } |
| 112 | |
| 113 | bool mitk::PropertyDescriptions::HasDescription(const std::string &propertyName, |
| 114 | const std::string &className, |
| 115 | bool allowNameRegEx) const |
| 116 | { |
| 117 | if (!propertyName.empty()) |
| 118 | { |
| 119 | auto descriptionsIter = m_Descriptions.find(className); |
| 120 | |
| 121 | if (descriptionsIter != m_Descriptions.cend()) |
| 122 | { |
| 123 | auto iter = descriptionsIter->second.find(propertyName); |
| 124 | |
| 125 | if (iter != descriptionsIter->second.end()) |
| 126 | return true; |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | if (allowNameRegEx && !propertyName.empty()) |
| 131 | { |
| 132 | auto selector = [propertyName](const DescriptionMap::value_type &x) { |
| 133 | std::regex ex(x.first); |
| 134 | return std::regex_match(propertyName, ex); |
| 135 | }; |
| 136 | |
| 137 | auto descriptionsIter = m_DescriptionsRegEx.find(className); |
| 138 | |
| 139 | if (descriptionsIter != m_DescriptionsRegEx.cend()) |
| 140 | { |
| 141 | auto finding = std::find_if(descriptionsIter->second.cbegin(), descriptionsIter->second.cend(), selector); |
| 142 | |
| 143 | if (finding != descriptionsIter->second.cend()) |
| 144 | return true; |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | return false; |
| 149 | } |
| 150 | |
| 151 | void mitk::PropertyDescriptions::RemoveAllDescriptions(const std::string &className) |
| 152 | { |
no test coverage detected