本文整理汇总了C++中ProjectPtr::GetFilesMetadata方法的典型用法代码示例。如果您正苦于以下问题:C++ ProjectPtr::GetFilesMetadata方法的具体用法?C++ ProjectPtr::GetFilesMetadata怎么用?C++ ProjectPtr::GetFilesMetadata使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectPtr
的用法示例。
在下文中一共展示了ProjectPtr::GetFilesMetadata方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoFindFiles
void ReconcileProjectDlg::DoFindFiles()
{
m_stalefiles.clear();
m_newfiles.clear();
ProjectPtr proj = ManagerST::Get()->GetProject(m_projname);
wxCHECK_RET(proj, "Can't find a Project with the supplied name");
// get list of files from the project
Project::FileInfoVector_t projectfiles;
proj->GetFilesMetadata(projectfiles);
wxStringSet_t projectfilesSet;
Project::FileInfoVector_t::const_iterator it = projectfiles.begin();
for( ; it != projectfiles.end(); ++it ) {
projectfilesSet.insert( it->GetFilename() );
}
std::vector<wxString> result;
std::set_difference(m_allfiles.begin(), m_allfiles.end(), projectfilesSet.begin(), projectfilesSet.end(), std::back_inserter(result));
m_newfiles.insert(result.begin(), result.end());
// now run the diff reverse to get list of stale files
m_stalefiles.clear();
Project::FileInfoVector_t::const_iterator iter = projectfiles.begin();
for(; iter != projectfiles.end(); ++iter ) {
if ( !wxFileName::Exists( iter->GetFilename() ) ) {
m_stalefiles.push_back( *iter );
}
}
}
示例2: OnFormatProject
void CodeFormatter::OnFormatProject(wxCommandEvent& e)
{
wxUnusedVar(e);
TreeItemInfo selectedItem = m_mgr->GetSelectedTreeItemInfo(TreeFileView);
if(selectedItem.m_itemType != ProjectItem::TypeProject) {
return;
}
ProjectPtr pProj = clCxxWorkspaceST::Get()->GetProject(selectedItem.m_text);
CHECK_PTR_RET(pProj);
Project::FileInfoVector_t allFiles;
pProj->GetFilesMetadata(allFiles);
std::vector<wxFileName> filesToFormat;
// Filter non C++/JavaScript files
for(size_t i = 0; i < allFiles.size(); ++i) {
wxFileName fn(allFiles.at(i).GetFilename());
if(fn.GetFullName() == "sqlite3.c") {
// skip this famous a quite large file ...
continue;
}
const wxString& filename = allFiles.at(i).GetFilename();
if(FileExtManager::IsCxxFile(filename) || FileExtManager::IsJavascriptFile(filename)) {
filesToFormat.push_back(allFiles.at(i).GetFilename());
}
}
if(filesToFormat.empty()) {
::wxMessageBox(_("Nothing to be done here"));
return;
}
wxString msg;
msg << _("You are about to beautify ") << filesToFormat.size() << _(" files\nContinue?");
if(wxYES != ::wxMessageBox(msg, _("Source Code Formatter"), wxYES_NO | wxCANCEL | wxCENTER)) {
return;
}
// Format the files
BatchFormat(filesToFormat);
}