本文整理汇总了C++中ProjectPtr::GetDependencies方法的典型用法代码示例。如果您正苦于以下问题:C++ ProjectPtr::GetDependencies方法的具体用法?C++ ProjectPtr::GetDependencies怎么用?C++ ProjectPtr::GetDependencies使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectPtr
的用法示例。
在下文中一共展示了ProjectPtr::GetDependencies方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RemoveProject
bool clCxxWorkspace::RemoveProject(const wxString& name, wxString& errMsg)
{
ProjectPtr proj = FindProjectByName(name, errMsg);
if(!proj) {
return false;
}
// remove the associated build configuration with this
// project
RemoveProjectFromBuildMatrix(proj);
// remove the project from the internal map
std::map<wxString, ProjectPtr>::iterator iter = m_projects.find(proj->GetName());
if(iter != m_projects.end()) {
m_projects.erase(iter);
}
// update the xml file
wxXmlNode* root = m_doc.GetRoot();
wxXmlNode* child = root->GetChildren();
while(child) {
if(child->GetName() == wxT("Project") && child->GetPropVal(wxT("Name"), wxEmptyString) == name) {
if(child->GetPropVal(wxT("Active"), wxEmptyString).CmpNoCase(wxT("Yes")) == 0) {
// the removed project was active,
// select new project to be active
if(!m_projects.empty()) {
std::map<wxString, ProjectPtr>::iterator iter = m_projects.begin();
SetActiveProject(iter->first, true);
}
}
root->RemoveChild(child);
delete child;
break;
}
child = child->GetNext();
}
// go over the dependencies list of each project and remove the project
iter = m_projects.begin();
for(; iter != m_projects.end(); iter++) {
ProjectPtr p = iter->second;
if(p) {
wxArrayString configs;
// populate the choice control with the list of available configurations for this project
ProjectSettingsPtr settings = p->GetSettings();
if(settings) {
ProjectSettingsCookie cookie;
BuildConfigPtr bldConf = settings->GetFirstBuildConfiguration(cookie);
while(bldConf) {
configs.Add(bldConf->GetName());
bldConf = settings->GetNextBuildConfiguration(cookie);
}
}
// update each configuration of this project
for(size_t i = 0; i < configs.GetCount(); i++) {
wxArrayString deps = p->GetDependencies(configs.Item(i));
int where = deps.Index(name);
if(where != wxNOT_FOUND) {
deps.RemoveAt((size_t)where);
}
// update the configuration
p->SetDependencies(deps, configs.Item(i));
}
}
}
return SaveXmlFile();
}