当前位置: 首页>>代码示例>>C++>>正文


C++ ProjectPtr::RemoveFile方法代码示例

本文整理汇总了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;
}
开发者ID:capturePointer,项目名称:codelite,代码行数:31,代码来源:workspace.cpp

示例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;
}
开发者ID:HTshandou,项目名称:codelite,代码行数:21,代码来源:reconcileproject.cpp

示例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);
}
开发者ID:HTshandou,项目名称:codelite,代码行数:23,代码来源:reconcileproject.cpp


注:本文中的ProjectPtr::RemoveFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。