本文整理汇总了C++中TagEntryPtrVector_t::at方法的典型用法代码示例。如果您正苦于以下问题:C++ TagEntryPtrVector_t::at方法的具体用法?C++ TagEntryPtrVector_t::at怎么用?C++ TagEntryPtrVector_t::at使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TagEntryPtrVector_t
的用法示例。
在下文中一共展示了TagEntryPtrVector_t::at方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoShowCompletionBox
void PHPCodeCompletion::DoShowCompletionBox(const PHPEntityBase::List_t& entries, PHPExpression::Ptr_t expr)
{
wxCodeCompletionBoxEntry::Vec_t ccEntries;
TagEntryPtrVector_t tags;
wxStringSet_t uniqueEntries;
// search for the old item
PHPEntityBase::List_t::const_iterator iter = entries.begin();
for(; iter != entries.end(); ++iter) {
PHPEntityBase::Ptr_t entry = *iter;
if(uniqueEntries.count(entry->GetFullName()) == 0) {
uniqueEntries.insert(entry->GetFullName());
} else {
// don't add duplicate entries
continue;
}
PHPEntityBase::Ptr_t ns = expr->GetSourceFile()->Namespace(); // the namespace at the source file
TagEntryPtr t = DoPHPEntityToTagEntry(entry);
tags.push_back(t);
}
std::sort(tags.begin(), tags.end(), _SAscendingSort());
for(size_t i = 0; i < tags.size(); ++i) {
wxCodeCompletionBoxEntry::Ptr_t ccEntry = wxCodeCompletionBox::TagToEntry(tags.at(i));
ccEntry->SetComment(tags.at(i)->GetComment());
ccEntries.push_back(ccEntry);
}
wxCodeCompletionBoxManager::Get().ShowCompletionBox(
m_manager->GetActiveEditor()->GetCtrl(), ccEntries, wxCodeCompletionBox::kRefreshOnKeyType, wxNOT_FOUND);
}
示例2: TagsToEntries
wxCodeCompletionBoxEntry::Vec_t wxCodeCompletionBox::TagsToEntries(const TagEntryPtrVector_t& tags)
{
wxCodeCompletionBoxEntry::Vec_t entries;
for(size_t i = 0; i < tags.size(); ++i) {
TagEntryPtr tag = tags.at(i);
wxString text = tag->GetDisplayName().Trim().Trim(false);
int imgIndex = GetImageId(tag);
wxCodeCompletionBoxEntry::Ptr_t entry = wxCodeCompletionBoxEntry::New(text, imgIndex);
entry->m_tag = tag;
entries.push_back(entry);
}
return entries;
}
示例3: DoPopulateTags
void OpenResourceDialog::DoPopulateTags()
{
bool gotExactMatch(false);
// Next, add the tags
TagEntryPtrVector_t tags;
if(m_userFilters.IsEmpty()) return;
m_manager->GetTagsManager()->GetTagsByPartialName(m_userFilters.Item(0), tags);
for(size_t i = 0; i < tags.size(); i++) {
TagEntryPtr tag = tags.at(i);
// Filter out non relevanting entries
if(!m_filters.IsEmpty() && m_filters.Index(tag->GetKind()) == wxNOT_FOUND) continue;
if(!MatchesFilter(tag->GetName())) continue;
wxString name(tag->GetName());
// keep the fullpath
wxDataViewItem item;
wxString fullname;
if(tag->GetKind() == wxT("function") || tag->GetKind() == wxT("prototype")) {
fullname = wxString::Format(
wxT("%s::%s%s"), tag->GetScope().c_str(), tag->GetName().c_str(), tag->GetSignature().c_str());
item = DoAppendLine(tag->GetName(),
fullname,
(tag->GetKind() == wxT("function")),
new OpenResourceDialogItemData(
tag->GetFile(), tag->GetLine(), tag->GetPattern(), tag->GetName(), tag->GetScope()),
DoGetTagImg(tag));
} else {
fullname = wxString::Format(wxT("%s::%s"), tag->GetScope().c_str(), tag->GetName().c_str());
item = DoAppendLine(tag->GetName(),
fullname,
false,
new OpenResourceDialogItemData(
tag->GetFile(), tag->GetLine(), tag->GetPattern(), tag->GetName(), tag->GetScope()),
DoGetTagImg(tag));
}
if((m_userFilters.GetCount() == 1) && (m_userFilters.Item(0).CmpNoCase(name) == 0) && !gotExactMatch) {
gotExactMatch = true;
DoSelectItem(item);
}
}
}