本文整理汇总了C++中phpproject::Ptr_t::AddFolder方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr_t::AddFolder方法的具体用法?C++ Ptr_t::AddFolder怎么用?C++ Ptr_t::AddFolder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phpproject::Ptr_t
的用法示例。
在下文中一共展示了Ptr_t::AddFolder方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoAddFilesToFolder
void PHPWorkspaceView::DoAddFilesToFolder(const wxArrayString& paths, PHPProject::Ptr_t pProject, bool notify)
{
if(paths.IsEmpty()) return;
CHECK_PTR_RET(pProject);
wxString folder_path = PHPFolder::GetFolderPathFromFileFullPath(paths.Item(0), pProject->GetFilename().GetPath());
wxTreeItemId folderItem =
EnsureFolderExists(DoGetProjectItem(pProject->GetName()), folder_path, pProject->GetName());
PHPFolder::Ptr_t pFolder = pProject->AddFolder(folder_path);
CHECK_PTR_RET(pFolder);
wxArrayString newPaths;
for(size_t i = 0; i < paths.GetCount(); i++) {
if(pFolder->AddFile(paths.Item(i))) {
newPaths.Add(paths.Item(i));
}
}
if(newPaths.IsEmpty()) return;
if(notify) {
DoAddFilesToTreeView(folderItem, pProject, pFolder, newPaths);
// Notify the plugins
clCommandEvent evtFilesAdded(wxEVT_PROJ_FILE_ADDED);
evtFilesAdded.SetStrings(newPaths);
EventNotifier::Get()->AddPendingEvent(evtFilesAdded);
}
}
示例2: OnNewClass
void PHPWorkspaceView::OnNewClass(wxCommandEvent& e)
{
wxTreeItemId folderId = DoGetSingleSelection();
ItemData* data = DoGetItemData(folderId);
if(!data || !data->IsFolder()) {
return;
}
PHPProject::Ptr_t pProject = PHPWorkspace::Get()->GetProject(data->GetProjectName());
CHECK_PTR_RET(pProject);
PHPFolder::Ptr_t pFolder = pProject->Folder(data->GetFolderPath());
CHECK_PTR_RET(pFolder);
NewPHPClass dlg(wxTheApp->GetTopWindow(), pFolder->GetFullPath(pProject->GetFilename().GetPath(), false));
if(dlg.ShowModal() == wxID_OK) {
PHPClassDetails pcd = dlg.GetDetails();
pFolder = pProject->AddFolder(PHPFolder::GetFolderPathFromFileFullPath(pcd.GetFilepath().GetFullPath(),
pProject->GetFilename().GetPath()));
CHECK_PTR_RET(pFolder);
folderId = EnsureFolderExists(
DoGetProjectItem(pProject->GetName()), pFolder->GetPathRelativeToProject(), pProject->GetName());
DoAddFileWithContent(
folderId, pcd.GetFilepath(), pcd.ToString(EditorConfigST::Get()->GetOptions()->GetEOLAsString(), " "));
}
}
示例3: OnNewFolder
void PHPWorkspaceView::OnNewFolder(wxCommandEvent& e)
{
wxUnusedVar(e);
wxString name = wxGetTextFromUser(_("New Folder Name:"), _("New Folder"));
if(name.IsEmpty()) return;
wxString project = DoGetSelectedProject();
if(project.IsEmpty()) return;
wxTreeItemId parent = m_treeCtrlView->GetSelection();
CHECK_ITEM_RET(parent);
ItemData* itemData = DoGetItemData(parent);
CHECK_PTR_RET(itemData);
if(!itemData->IsFolder() && !itemData->IsProject()) return;
PHPProject::Ptr_t proj = PHPWorkspace::Get()->GetProject(project);
CHECK_PTR_RET(proj);
wxString folder;
if(itemData->IsFolder()) {
folder << itemData->GetFolderPath() << "/" << name;
} else {
folder << name;
}
PHPFolder::Ptr_t pFolder = proj->AddFolder(folder);
proj->Save();
// Update the UI
DoAddFolder(parent, pFolder, proj);
}