The priority is defined by elems order, except elements with priority="high".
| 121 | |
| 122 | /// The priority is defined by elems order, except elements with priority="high". |
| 123 | std::vector<pugi::xml_node> GetPrioritizedTypes(pugi::xml_node const & node) |
| 124 | { |
| 125 | std::vector<pugi::xml_node> result; |
| 126 | for (auto const & xNode : node.select_nodes("/comaps/editor/types/type[@id]")) |
| 127 | result.push_back(xNode.node()); |
| 128 | stable_sort(begin(result), end(result), [](pugi::xml_node const & lhs, pugi::xml_node const & rhs) |
| 129 | { |
| 130 | auto const lhsWeight = kPriorityWeights.find(lhs.attribute("priority").value()); |
| 131 | auto const rhsWeight = kPriorityWeights.find(rhs.attribute("priority").value()); |
| 132 | |
| 133 | CHECK(lhsWeight != kPriorityWeights.end(), ("")); |
| 134 | CHECK(rhsWeight != kPriorityWeights.end(), ("")); |
| 135 | |
| 136 | return lhsWeight->second < rhsWeight->second; |
| 137 | }); |
| 138 | return result; |
| 139 | } |
| 140 | } // namespace |
| 141 | |
| 142 | bool EditorConfig::GetTypeDescription(std::vector<std::string> classificatorTypes, |