本文整理汇总了C++中TagEntryPtr::GetPath方法的典型用法代码示例。如果您正苦于以下问题:C++ TagEntryPtr::GetPath方法的具体用法?C++ TagEntryPtr::GetPath怎么用?C++ TagEntryPtr::GetPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TagEntryPtr
的用法示例。
在下文中一共展示了TagEntryPtr::GetPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowUsage
void FindUsageTab::ShowUsage(const std::list<CppToken>& matches, const wxString& searchWhat)
{
Clear();
int lineNumber(0);
wxString text;
wxString curfile;
wxString curfileContent;
wxArrayString lines;
text = wxString::Format(_("===== Finding references of '%s' =====\n"), searchWhat.c_str());
lineNumber++;
std::list<CppToken>::const_iterator iter = matches.begin();
for(; iter != matches.end(); iter++) {
// Print the line number
wxString file_name(iter->getFilename());
if(curfile != file_name) {
curfile = file_name;
wxFileName fn(file_name);
fn.MakeRelativeTo();
text << fn.GetFullPath() << wxT("\n");
lineNumber++;
// Load the file content
wxLogNull nolog;
wxFFile thefile(file_name, wxT("rb"));
if(thefile.IsOpened()) {
wxFileOffset size = thefile.Length();
wxString fileData;
fileData.Alloc(size);
curfileContent.Clear();
wxCSConv fontEncConv(wxFONTENCODING_ISO8859_1);
thefile.ReadAll(&curfileContent, fontEncConv);
// break the current file into lines, a line can be an empty string
lines = wxStringTokenize(curfileContent, wxT("\n"), wxTOKEN_RET_EMPTY_ALL);
}
}
// Keep the match
m_matches[lineNumber] = *iter;
// Format the message
wxString linenum = wxString::Format(wxT(" %5u: "), (unsigned int)iter->getLineNumber() + 1);
wxString scopeName(wxT("<global>"));
TagEntryPtr tag = TagsManagerST::Get()->FunctionFromFileLine(iter->getFilename(), iter->getLineNumber());
if(tag) {
scopeName = tag->GetPath();
}
text << linenum << wxT("[ ") << scopeName << wxT(" ] ");
if(lines.GetCount() > iter->getLineNumber()) {
text << lines.Item(iter->getLineNumber()).Trim().Trim(false);
}
text << wxT("\n");
lineNumber++;
}
text << wxString::Format(_("===== Found total of %u matches =====\n"), (unsigned int)m_matches.size());
AppendText(text);
}