本文整理汇总了C++中phpproject::Ptr_t::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr_t::GetName方法的具体用法?C++ Ptr_t::GetName怎么用?C++ Ptr_t::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phpproject::Ptr_t
的用法示例。
在下文中一共展示了Ptr_t::GetName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoAddFolder
void PHPWorkspaceView::DoAddFolder(const wxTreeItemId& parent, PHPFolder::Ptr_t folder, PHPProject::Ptr_t project)
{
// add the folder itself
ItemData* itemData = new ItemData(ItemData::Kind_Folder);
itemData->SetFolderPath(folder->GetPathRelativeToProject());
itemData->SetProjectName(project->GetName());
itemData->SetFolderName(folder->GetName()); // display name
wxTreeItemId folderItem = EnsureFolderExists(
DoGetProjectItem(project->GetName()), folder->GetPathRelativeToProject(), project->GetName());
// Get list of folders
const PHPFolder::List_t& children = folder->GetChildren();
PHPFolder::List_t::const_iterator iter = children.begin();
for(; iter != children.end(); ++iter) {
DoAddFolder(folderItem, *iter, project);
}
wxArrayString folderFiles;
folder->GetFiles(folderFiles, project->GetFilename().GetPath(), 0);
// Add the files
for(size_t i = 0; i < folderFiles.GetCount(); ++i) {
ItemData* itemData = new ItemData(ItemData::Kind_File);
itemData->SetFile(folderFiles.Item(i));
itemData->SetProjectName(project->GetName());
itemData->SetFolderPath(folder->GetPathRelativeToProject());
int imgId = DoGetItemImgIdx(folderFiles.Item(i));
m_treeCtrlView->AppendItem(folderItem, wxFileName(folderFiles.Item(i)).GetFullName(), imgId, imgId, itemData);
}
}
示例2: 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);
}
}
示例3: FromJSON
void PHPWorkspace::FromJSON(const JSONElement& e)
{
m_projects.clear();
if(e.hasNamedObject("projects")) {
PHPProject::Ptr_t firstProject;
JSONElement projects = e.namedObject("projects");
int count = projects.arraySize();
for(int i = 0; i < count; ++i) {
PHPProject::Ptr_t p(new PHPProject());
wxString project_file = projects.arrayItem(i).toString();
wxFileName fnProject(project_file);
fnProject.MakeAbsolute(m_workspaceFile.GetPath());
p->Load(fnProject);
m_projects.insert(std::make_pair(p->GetName(), p));
if(!firstProject) {
firstProject = p;
}
}
PHPProject::Ptr_t activeProject = GetActiveProject();
if(!activeProject && firstProject) {
// No active project found, mark the first project as active
activeProject = firstProject;
SetProjectActive(firstProject->GetName());
}
if(activeProject) {
// Notify about active project been set
clProjectSettingsEvent evt(wxEVT_ACTIVE_PROJECT_CHANGED);
evt.SetProjectName(activeProject->GetName());
evt.SetFileName(activeProject->GetFilename().GetFullPath());
EventNotifier::Get()->AddPendingEvent(evt);
}
}
}
示例4: 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(), " "));
}
}
示例5: DoAddFilesToTreeView
void PHPWorkspaceView::DoAddFilesToTreeView(const wxTreeItemId& folderId, PHPProject::Ptr_t pProject, PHPFolder::Ptr_t pFolder, const wxArrayString& files)
{
for(size_t i=0; i<files.GetCount(); ++i) {
ItemData *itemData = new ItemData(ItemData::Kind_File);
itemData->SetFile( files.Item(i) );
itemData->SetProjectName( pProject->GetName() );
itemData->SetFolderPath( pFolder->GetPathRelativeToProject() );
int imgId = DoGetItemImgIdx(files.Item(i));
m_treeCtrlView->AppendItem(folderId, wxFileName(files.Item(i)).GetFullName(), imgId, imgId, itemData);
}
m_treeCtrlView->SortChildren( folderId );
}