MCPcopy Create free account
hub / github.com/MITK/MITK / HasDescription

Method HasDescription

Modules/Core/src/DataManagement/mitkPropertyDescriptions.cpp:113–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113bool 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
151void mitk::PropertyDescriptions::RemoveAllDescriptions(const std::string &className)
152{

Callers 3

UpdateDetailsLabelMethod · 0.80
SetTaskListMethod · 0.80
to_jsonFunction · 0.80

Calls 3

emptyMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected