| 301 | } |
| 302 | |
| 303 | StructTreeNode* StructTreeNode::findNode(QString nameSpace, bool returnDeepest) |
| 304 | { |
| 305 | StructTreeNode* cur_node = this; |
| 306 | while (cur_node->getParent() != nullptr) |
| 307 | cur_node = cur_node->getParent(); |
| 308 | |
| 309 | QStringList names = nameSpace.split("::"); |
| 310 | for (QString name : names) |
| 311 | { |
| 312 | bool childFound = false; |
| 313 | for (StructTreeNode* child : cur_node->getChildren()) |
| 314 | { |
| 315 | if (child->getName() == name) |
| 316 | { |
| 317 | childFound = true; |
| 318 | cur_node = child; |
| 319 | break; |
| 320 | } |
| 321 | } |
| 322 | if (!childFound) |
| 323 | { |
| 324 | if (returnDeepest) |
| 325 | return cur_node; |
| 326 | else |
| 327 | return nullptr; |
| 328 | } |
| 329 | } |
| 330 | return cur_node; |
| 331 | } |
| 332 | |
| 333 | StructTreeNode* StructTreeNode::findDeepestAvailableNode(QString nameSpace) |
| 334 | { |
no test coverage detected