本文整理汇总了C++中ProjectBuildTarget::GetFilesCount方法的典型用法代码示例。如果您正苦于以下问题:C++ ProjectBuildTarget::GetFilesCount方法的具体用法?C++ ProjectBuildTarget::GetFilesCount怎么用?C++ ProjectBuildTarget::GetFilesCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectBuildTarget
的用法示例。
在下文中一共展示了ProjectBuildTarget::GetFilesCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Parse
void ToDoListView::Parse()
{
// wxBusyCursor busy;
// based on user prefs, parse files for todo items
if (m_Ignore || (m_pPanel && !m_pPanel->IsShownOnScreen()) )
return; // Reentrancy
Clear();
m_ItemsMap.clear();
m_Items.Clear();
switch (m_pSource->GetSelection())
{
case 0: // current file only
{
// this is the easiest selection ;)
cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinEditor(Manager::Get()->GetEditorManager()->GetActiveEditor());
ParseEditor(ed);
break;
}
case 1: // open files
{
// easy too; parse all open editor files...
for (int i = 0; i < Manager::Get()->GetEditorManager()->GetEditorsCount(); ++i)
{
cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinEditor(Manager::Get()->GetEditorManager()->GetEditor(i));
ParseEditor(ed);
}
break;
}
case 2: // active target files
{
// loop all project files
// but be aware: if a file is opened, use the open file because
// it might not be the same on the disk...
cbProject* prj = Manager::Get()->GetProjectManager()->GetActiveProject();
if (!prj)
return;
ProjectBuildTarget *target = prj->GetBuildTarget(prj->GetActiveBuildTarget());
if (!target)
return;
wxProgressDialog pd(_T("Todo Plugin: Processing all files in the active target.."),
_T("Processing a target of a big project may take large amount of time.\n\n"
"Please be patient!\n"),
target->GetFilesCount(),
Manager::Get()->GetAppWindow(),
wxPD_AUTO_HIDE | wxPD_APP_MODAL | wxPD_CAN_ABORT);
int i = 0;
for (FilesList::iterator it = target->GetFilesList().begin();
it != target->GetFilesList().end();
++it)
{
ProjectFile* pf = *it;
wxString filename = pf->file.GetFullPath();
cbEditor* ed = Manager::Get()->GetEditorManager()->IsBuiltinOpen(filename);
if (ed)
ParseEditor(ed);
else
ParseFile(filename);
if (!pd.Update(i++))
{
break;
}
}
break;
}
case 3: // all project files
{
// loop all project files
// but be aware: if a file is opened, use the open file because
// it might not be the same on the disk...
cbProject* prj = Manager::Get()->GetProjectManager()->GetActiveProject();
if (!prj)
return;
wxProgressDialog pd(_T("Todo Plugin: Processing all files.."),
_T("Processing a big project may take large amount of time.\n\n"
"Please be patient!\n"),
prj->GetFilesCount(),
Manager::Get()->GetAppWindow(),
wxPD_AUTO_HIDE | wxPD_APP_MODAL | wxPD_CAN_ABORT);
int i = 0;
for (FilesList::iterator it = prj->GetFilesList().begin(); it != prj->GetFilesList().end(); ++it)
{
ProjectFile* pf = *it;
wxString filename = pf->file.GetFullPath();
cbEditor* ed = Manager::Get()->GetEditorManager()->IsBuiltinOpen(filename);
if (ed)
ParseEditor(ed);
else
ParseFile(filename);
if (!pd.Update(i++))
{
break;
}
}
break;
}
default:
break;
}
//.........这里部分代码省略.........