void PHPFileLayoutTree::BuildTree(wxTreeItemId parentTreeItem, PHPEntityBase::Ptr_t entity) { int imgID = GetImageId(entity); wxTreeItemId parent = AppendItem(parentTreeItem, entity->GetDisplayName(), imgID, imgID, new QItemData(entity)); // dont add the children of the function (i.e. function arguments) if(entity->Is(kEntityTypeFunction)) return; const PHPEntityBase::List_t& children = entity->GetChildren(); if(!children.empty()) { PHPEntityBase::List_t::const_iterator iter = children.begin(); for(; iter != children.end(); ++iter) { BuildTree(parent, *iter); } } }
void OpenResourceDlg::DoGetResources(const wxString& filter) { m_resources.clear(); PHPEntityBase::List_t matches; m_table.LoadAllByFilter(matches, filter); // Convert the PHP matches into resources PHPEntityBase::List_t::iterator iter = matches.begin(); m_resources.reserve(matches.size()); for(; iter != matches.end(); ++iter) { PHPEntityBase::Ptr_t match = *iter; if(FileUtils::FuzzyMatch(filter, match->GetFullName())) { ResourceItem resource; resource.displayName = match->GetDisplayName(); resource.filename = match->GetFilename(); resource.line = match->GetLine(); resource.SetType(match); m_resources.push_back(resource); } } }