本文整理汇总了C++中ProjectPtr::RemoveFile方法的典型用法代码示例。如果您正苦于以下问题:C++ ProjectPtr::RemoveFile方法的具体用法?C++ ProjectPtr::RemoveFile怎么用?C++ ProjectPtr::RemoveFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectPtr
的用法示例。
在下文中一共展示了ProjectPtr::RemoveFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RemoveFile
bool clCxxWorkspace::RemoveFile(const wxString& vdFullPath, const wxString& fileName, wxString& errMsg)
{
wxStringTokenizer tkz(vdFullPath, wxT(":"));
wxString projName = tkz.GetNextToken();
wxString fixedPath;
// Construct new path excluding the first token
size_t count = tkz.CountTokens();
if(!count) {
errMsg = _("Malformed project name");
return false;
}
for(size_t i = 0; i < count - 1; i++) {
fixedPath += tkz.GetNextToken();
fixedPath += wxT(":");
}
fixedPath += tkz.GetNextToken();
ProjectPtr proj = FindProjectByName(projName, errMsg);
if(!proj) {
errMsg = _("No such project");
return false;
}
bool result = proj->RemoveFile(fileName, fixedPath);
if(!result) {
errMsg = _("File removal failed");
}
return result;
}
示例2: RemoveStaleFiles
wxArrayString ReconcileProjectDlg::RemoveStaleFiles(const wxArrayString& StaleFiles) const
{
wxArrayString removals;
ProjectPtr proj = ManagerST::Get()->GetProject(m_projname);
wxCHECK_MSG(proj, removals, "Can't find a Project with the supplied name");
for (size_t n = 0; n < StaleFiles.GetCount(); ++n) {
// Reconstruct the VD path in projectname:foo:bar format
int index = StaleFiles[n].Find(": ");
wxCHECK_MSG(index != wxNOT_FOUND, removals, "Badly-formed stalefile string");
wxString vdPath = StaleFiles[n].Left(index);
wxString filepath = StaleFiles[n].Mid(index+2);
if (proj->RemoveFile(filepath, vdPath)) {
removals.Add(StaleFiles[n]);
}
}
return removals;
}
示例3: OnDeleteStaleFiles
void ReconcileProjectDlg::OnDeleteStaleFiles(wxCommandEvent& event)
{
ProjectPtr proj = ManagerST::Get()->GetProject(m_projname);
wxCHECK_RET(proj, "Can't find a Project with the supplied name");
wxDataViewItemArray items;
if (event.GetId() == wxID_DELETE) {
m_dataviewStaleFiles->GetSelections( items );
} else {
m_dataviewStaleFilesModel->GetChildren(wxDataViewItem(0), items);
}
proj->BeginTranscation();
for(size_t i=0; i<items.GetCount(); ++i) {
ReconcileFileItemData* data = dynamic_cast<ReconcileFileItemData*>(m_dataviewStaleFilesModel->GetClientObject(items.Item(i)));
if ( data ) {
proj->RemoveFile( data->GetFilename(), data->GetVirtualFolder() );
}
m_projectModified = true;
}
proj->CommitTranscation();
m_dataviewStaleFilesModel->DeleteItems(wxDataViewItem(0), items);
}