| 674 | } |
| 675 | |
| 676 | Properties* Properties::getNamespace(std::string_view id, bool searchNames, bool recurse) const |
| 677 | { |
| 678 | AXASSERT(!id.empty(), "invalid id"); |
| 679 | |
| 680 | for (const auto& it : _namespaces) |
| 681 | { |
| 682 | Properties* p = it; |
| 683 | if ((searchNames ? p->_namespace : p->_id) == id) |
| 684 | return p; |
| 685 | |
| 686 | if (recurse) |
| 687 | { |
| 688 | // Search recursively. |
| 689 | p = p->getNamespace(id, searchNames, true); |
| 690 | if (p) |
| 691 | return p; |
| 692 | } |
| 693 | } |
| 694 | |
| 695 | return nullptr; |
| 696 | } |
| 697 | |
| 698 | const char* Properties::getNamespace() const |
| 699 | { |