本文整理汇总了C++中ProjectPtr::CreateVirtualDir方法的典型用法代码示例。如果您正苦于以下问题:C++ ProjectPtr::CreateVirtualDir方法的具体用法?C++ ProjectPtr::CreateVirtualDir怎么用?C++ ProjectPtr::CreateVirtualDir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectPtr
的用法示例。
在下文中一共展示了ProjectPtr::CreateVirtualDir方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateFiles
void VcImporter::CreateFiles(wxXmlNode* parent, wxString vdPath, ProjectPtr proj)
{
if(!parent) {
return;
}
wxXmlNode* child = parent->GetChildren();
while(child) {
if(child->GetName() == wxT("Filter")) {
// add new virtual directory
wxString name = XmlUtils::ReadString(child, wxT("Name"));
wxString tmpPath = vdPath;
if(tmpPath.IsEmpty() == false) {
tmpPath << wxT(":");
}
tmpPath << name;
proj->CreateVirtualDir(tmpPath);
CreateFiles(child, tmpPath, proj);
} else if(child->GetName() == wxT("File")) {
// found a file
wxString fileName = XmlUtils::ReadString(child, wxT("RelativePath"));
wxString path = vdPath;
if(path.IsEmpty()) {
path = wxT("src");
}
fileName.Replace(wxT("\\"), wxT("/"));
proj->AddFile(fileName, path);
}
child = child->GetNext();
}
}
示例2: CreateVirtualDirectory
bool clCxxWorkspace::CreateVirtualDirectory(const wxString& vdFullPath, wxString& errMsg, bool mkPath)
{
wxStringTokenizer tkz(vdFullPath, wxT(":"));
wxString projName = tkz.GetNextToken();
wxString fixedPath;
// Construct new path excluding the first token
size_t count = tkz.CountTokens();
for(size_t i = 0; i < count - 1; i++) {
fixedPath += tkz.GetNextToken();
fixedPath += wxT(":");
}
fixedPath += tkz.GetNextToken();
ProjectPtr proj = FindProjectByName(projName, errMsg);
return proj->CreateVirtualDir(fixedPath, mkPath);
}
示例3: Import
//.........这里部分代码省略.........
for(GenericEnvVarsValueType envVar : cfg->envVars) {
envVars += envVar.first + wxT("=") + envVar.second + wxT("\n");
}
le_conf->SetEnvvars(envVars);
BuildCommandList preBuildCommandList;
BuildCommandList postBuildCommandList;
for (wxString preBuildCmd : cfg->preBuildCommands) {
BuildCommand preBuildCommand;
preBuildCommand.SetCommand(preBuildCmd);
preBuildCommand.SetEnabled(true);
preBuildCommandList.push_back(preBuildCommand);
}
for (wxString postBuildCmd : cfg->postBuildCommands) {
BuildCommand postBuildCommand;
postBuildCommand.SetCommand(postBuildCmd);
postBuildCommand.SetEnabled(true);
postBuildCommandList.push_back(postBuildCommand);
}
le_conf->SetPreBuildCommands(preBuildCommandList);
le_conf->SetPostBuildCommands(postBuildCommandList);
le_settings->SetBuildConfiguration(le_conf);
if(!project->deps.IsEmpty())
proj->SetDependencies(project->deps, cfg->name);
}
proj->SetSettings(le_settings);
proj->BeginTranscation();
// Delete default virtual directory
proj->DeleteVirtualDir("include");
proj->DeleteVirtualDir("src");
for(GenericProjectFilePtr file : project->files) {
wxString vpath;
if(file->vpath.IsEmpty()) {
wxFileName fileInfo(file->name);
wxString ext = fileInfo.GetExt().Lower();
if(ext == wxT("h") || ext == wxT("hpp") || ext == wxT("hxx") || ext == wxT("hh") ||
ext == wxT("inl") || ext == wxT("inc")) {
vpath = wxT("include");
} else if(ext == wxT("c") || ext == wxT("cpp") || ext == wxT("cxx") || ext == wxT("cc")) {
vpath = wxT("src");
} else if(ext == wxT("s") || ext == wxT("S") || ext == wxT("asm")) {
vpath = wxT("src");
} else {
vpath = wxT("resource");
}
} else {
vpath = file->vpath;
if(file->vpath.Contains(wxT("\\"))) {
vpath.Replace(wxT("\\"), wxT(":"));
} else if(file->vpath.Contains(wxT("/"))) {
vpath.Replace(wxT("/"), wxT(":"));
}
}
proj->CreateVirtualDir(vpath);
proj->AddFile(file->name, vpath);
}
proj->CommitTranscation();
}
if(clWorkspace) {
BuildMatrixPtr clMatrix = clWorkspace->GetBuildMatrix();
WorkspaceConfigurationPtr wsconf = clMatrix->GetConfigurationByName(wxT("Debug"));
if(wsconf) {
wsconf->SetConfigMappingList(cmlDebug);
}
wsconf = clMatrix->GetConfigurationByName(wxT("Release"));
if(wsconf) {
wsconf->SetConfigMappingList(cmlRelease);
}
clWorkspace->SetBuildMatrix(clMatrix);
}
return true;
}
}
}
return false;
}