本文整理汇总了C++中ProjectPtr::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ ProjectPtr::GetName方法的具体用法?C++ ProjectPtr::GetName怎么用?C++ ProjectPtr::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectPtr
的用法示例。
在下文中一共展示了ProjectPtr::GetName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoGetBuildCommand
wxString QMakePlugin::DoGetBuildCommand(const wxString &project, const wxString &config, bool projectOnly)
{
wxUnusedVar ( config );
wxString errMsg;
ProjectPtr p = m_mgr->GetWorkspace()->FindProjectByName(project, errMsg);
if ( !p ) {
return wxEmptyString;
}
BuildConfigPtr bldConf = WorkspaceST::Get()->GetProjBuildConf(project, config);
wxString cmd;
if ( !projectOnly ) {
cmd << wxT("@cd \"") << p->GetFileName().GetPath() << wxT("\" && ");
}
// fix: replace all Windows like slashes to POSIX
wxString command = bldConf->GetCompiler()->GetTool("MAKE");
command.Replace(wxT("\\"), wxT("/"));
cmd << command << wxT(" \"") << p->GetName() << wxT(".mk\"");
return cmd;
}
示例2: DoInitialize
void BatchBuildDlg::DoInitialize()
{
// load the previously saved batch build file
wxFileName fn(WorkspaceST::Get()->GetWorkspaceFileName());
fn.SetExt(wxT("batch_build"));
wxString content;
wxArrayString arr;
if (ReadFileWithConversion(fn.GetFullPath(), content)) {
arr = wxStringTokenize(content, wxT("\n"), wxTOKEN_STRTOK);
for (size_t i=0; i<arr.GetCount(); i++) {
int idx = m_checkListConfigurations->Append(arr.Item(i));
m_checkListConfigurations->Check((unsigned int)idx);
}
}
// loop over all projects, for each project collect all available
// build configurations and add them to the check list control
wxArrayString projects;
WorkspaceST::Get()->GetProjectList(projects);
for (size_t i=0; i<projects.GetCount(); i++) {
ProjectPtr p = ManagerST::Get()->GetProject(projects.Item(i));
if (p) {
ProjectSettingsPtr settings = p->GetSettings();
if (settings) {
ProjectSettingsCookie cookie;
BuildConfigPtr bldConf = settings->GetFirstBuildConfiguration(cookie);
while (bldConf) {
wxString item(p->GetName() + wxT(" | ") + bldConf->GetName());
int where = arr.Index(item);
if (where == wxNOT_FOUND) {
// append this item
m_checkListConfigurations->Append(item);
} else {
// this item already been added,
// remove it from the arr and continue
arr.RemoveAt((size_t)where);
}
bldConf = settings->GetNextBuildConfiguration(cookie);
}
}
}
}
// check to see which configuration was left in 'arr'
// and remove them from the checklistbox
for (size_t i=0; i<arr.GetCount(); i++) {
int where = m_checkListConfigurations->FindString(arr.Item(i));
if (where != wxNOT_FOUND) {
m_checkListConfigurations->Delete((unsigned int)where);
}
}
arr.clear();
if (m_checkListConfigurations->GetCount()>0) {
m_checkListConfigurations->Select(0);
}
}
示例3: OnDebugStart
void LLDBDebuggerPlugin::OnDebugStart(clDebugEvent& event)
{
event.Skip();
return;
if ( ::PromptForYesNoDialogWithCheckbox(_("Would you like to use LLDB debugger as your primary debugger?"), "UseLLDB") != wxID_YES ) {
event.Skip();
return;
}
// Get the executable to debug
wxString errMsg;
ProjectPtr pProject = WorkspaceST::Get()->FindProjectByName(event.GetProjectName(), errMsg);
if ( !pProject ) {
event.Skip();
return;
}
wxSetWorkingDirectory ( pProject->GetFileName().GetPath() );
BuildConfigPtr bldConf = WorkspaceST::Get()->GetProjBuildConf ( pProject->GetName(), wxEmptyString );
if ( !bldConf ) {
event.Skip();
return;
}
// Show the terminal
ShowTerminal("LLDB Console Window");
if ( m_debugger.Start("/home/eran/devl/TestArea/TestHang/Debug/TestHang") ) {
m_debugger.AddBreakpoint("main");
m_debugger.ApplyBreakpoints();
m_debugger.Run("/tmp/in", "/tmp/out", "/tmp/err", wxArrayString(), wxArrayString(), ::wxGetCwd());
}
}
示例4: RemoveProjectFromBuildMatrix
void clCxxWorkspace::RemoveProjectFromBuildMatrix(ProjectPtr prj)
{
BuildMatrixPtr matrix = GetBuildMatrix();
wxString selConfName = matrix->GetSelectedConfigurationName();
std::list<WorkspaceConfigurationPtr> wspList = matrix->GetConfigurations();
std::list<WorkspaceConfigurationPtr>::iterator iter = wspList.begin();
for(; iter != wspList.end(); iter++) {
WorkspaceConfiguration::ConfigMappingList prjList = (*iter)->GetMapping();
WorkspaceConfiguration::ConfigMappingList::iterator it = prjList.begin();
for(; it != prjList.end(); it++) {
if((*it).m_project == prj->GetName()) {
prjList.erase(it);
break;
}
}
(*iter)->SetConfigMappingList(prjList);
matrix->SetConfiguration((*iter));
}
// and set the configuration name
matrix->SetSelectedConfigurationName(selConfName);
// this will also reset the build matrix pointer
SetBuildMatrix(matrix);
}
示例5: DoGetBuildCommand
wxString QMakePlugin::DoGetBuildCommand(const wxString& project, const wxString& config, bool projectOnly)
{
wxUnusedVar(config);
wxString errMsg;
ProjectPtr p = m_mgr->GetWorkspace()->FindProjectByName(project, errMsg);
if(!p) { return wxEmptyString; }
BuildConfigPtr bldConf = clCxxWorkspaceST::Get()->GetProjBuildConf(project, config);
wxString cmd;
wxString projectMakefile;
projectMakefile << p->GetName() << ".mk";
::WrapWithQuotes(projectMakefile);
projectMakefile.Replace("\\", "/");
if(!projectOnly) {
// part of a greater makefile, use $(MAKE)
cmd << wxT("@cd \"") << p->GetFileName().GetPath() << wxT("\" && ");
cmd << "$(MAKE) -f " << projectMakefile;
} else {
// project only
cmd = bldConf->GetCompiler()->GetTool("MAKE");
if(!cmd.Contains("-f")) { cmd << " -f "; }
cmd << " " << projectMakefile;
}
return cmd;
}
示例6: DoSetWorkingDirectory
void ShellCommand::DoSetWorkingDirectory(ProjectPtr proj, bool isCustom, bool isFileOnly)
{
//when using custom build, user can select different working directory
if (proj) {
if (isCustom) {
//first set the path to the project working directory
::wxSetWorkingDirectory(proj->GetFileName().GetPath());
BuildConfigPtr buildConf = WorkspaceST::Get()->GetProjBuildConf(m_info.GetProject(), m_info.GetConfiguration());
if (buildConf) {
wxString wd = buildConf->GetCustomBuildWorkingDir();
if (wd.IsEmpty()) {
// use the project path
wd = proj->GetFileName().GetPath();
} else {
// expand macros from path
wd = ExpandAllVariables(wd, WorkspaceST::Get(), proj->GetName(), buildConf->GetName(), wxEmptyString);
}
::wxSetWorkingDirectory(wd);
}
} else {
if(m_info.GetProjectOnly() || isFileOnly) {
//first set the path to the project working directory
::wxSetWorkingDirectory(proj->GetFileName().GetPath());
}
}
}
}
示例7: wxASSERT
void
CMakeProjectMenu::OnMakeDirty(wxCommandEvent& event)
{
// Get settings
const CMakeProjectSettings* settings = m_plugin->GetSelectedProjectSettings();
// Event shouldn't be called when project is not enabled
wxASSERT(settings && settings->enabled);
// This function just touch .cmake_dirty file
ProjectPtr project = m_plugin->GetSelectedProject();
// Real project
wxString projectName = project->GetName();
// Project has parent project -> touch dirty file there
if (!settings->parentProject.IsEmpty()) {
projectName = settings->parentProject;
}
// Move to project directory
wxFileName dirtyFile = m_plugin->GetProjectDirectory(projectName);
dirtyFile.SetFullName(".cmake_dirty");
// Update file time
dirtyFile.Touch();
}
示例8:
void
CMakeProjectMenu::OnFileExists(wxUpdateUIEvent& event)
{
ProjectPtr project = m_plugin->GetSelectedProject();
if (project)
event.Enable(m_plugin->ExistsCMakeLists(m_plugin->GetProjectDirectory(project->GetName())));
}
示例9: OnCheckPopupProject
void MemCheckPlugin::OnCheckPopupProject(wxCommandEvent& event)
{
CHECK_CL_SHUTDOWN()
ProjectPtr project = m_mgr->GetSelectedProject();
if(project) {
CheckProject(project->GetName());
}
}
示例10: DoRunCMake
void CMakePlugin::DoRunCMake(ProjectPtr p)
{
CHECK_PTR_RET(p);
BuildConfigPtr buildConf = p->GetBuildConfiguration();
CHECK_COND_RET(buildConf);
// Apply the environment variables before we do anything here
#ifdef __WXMSW__
// On Windows, we need to set the bin folder of the selected compiler
wxFileName fnCxx(buildConf->GetCompiler()->GetTool("CXX"));
wxStringMap_t om;
wxString pathvar;
pathvar << fnCxx.GetPath() << clPATH_SEPARATOR << "$PATH";
om["PATH"] = pathvar;
EnvSetter es(NULL, &om, p->GetName(), buildConf->GetName());
#else
EnvSetter es(p);
#endif
CMakeGenerator generator;
if(generator.CanGenerate(p)) {
generator.Generate(p);
}
const wxString& args = buildConf->GetBuildSystemArguments();
wxString cmakeExe = GetCMake()->GetPath().GetFullPath();
// Did the user provide a generator to use?
bool hasGeneratorInArgs = (args.Find(" -G") != wxNOT_FOUND);
// Build the working directory
wxFileName fnWorkingDirectory(CMakeBuilder::GetWorkspaceBuildFolder(false), "");
wxString workingDirectory = fnWorkingDirectory.GetPath();
// Ensure that the build directory exists
fnWorkingDirectory.Mkdir(wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL);
::WrapWithQuotes(cmakeExe);
wxString command;
command << cmakeExe << " .. " << args;
if(!hasGeneratorInArgs) {
#ifdef __WXMSW__
// On Windows, generate MinGW makefiles
command << " -G\"MinGW Makefiles\"";
#endif
}
// Execute it
IProcess* proc = ::CreateAsyncProcess(this, command, IProcessCreateDefault, fnWorkingDirectory.GetPath());
if(!proc) {
::wxMessageBox(_("Failed to execute:\n") + command, "CodeLite", wxICON_ERROR | wxOK | wxCENTER,
EventNotifier::Get()->TopFrame());
return;
}
m_mgr->ShowOutputPane(_("Build"));
m_mgr->ClearOutputTab(kOutputTab_Build);
m_mgr->AppendOutputTabText(kOutputTab_Build, command + "\n");
}
示例11: OnExportMakefile
void QMakePlugin::OnExportMakefile(wxCommandEvent& event)
{
if(m_qmakeProcess) return;
QmakePluginData::BuildConfPluginData bcpd;
ProjectPtr pProj = m_mgr->GetSelectedProject();
CHECK_PTR_RET(pProj);
BuildConfigPtr bldConf = pProj->GetBuildConfiguration();
CHECK_PTR_RET(bldConf);
wxString project = pProj->GetName();
wxString config = bldConf->GetName();
if(!DoGetData(project, config, bcpd)) {
event.Skip();
return;
}
if(bcpd.m_enabled) {
// This project/configuration is qmake project
QMakeProFileGenerator generator(m_mgr, project, config);
// Regenerate the .pro file
generator.Generate();
// run qmake
wxString qmake_exe = m_conf->Read(wxString::Format(wxT("%s/qmake"), bcpd.m_qmakeConfig.c_str()));
wxString qmakespec = m_conf->Read(wxString::Format(wxT("%s/qmakespec"), bcpd.m_qmakeConfig.c_str()));
wxString qtdir = m_conf->Read(wxString::Format(wxT("%s/qtdir"), bcpd.m_qmakeConfig.c_str()));
// Create qmake comand
wxString qmake_exe_line;
qmake_exe.Trim().Trim(false);
qmakespec.Trim().Trim(false);
// Set QTDIR
DirSaver ds;
{
wxString errMsg;
ProjectPtr p = m_mgr->GetWorkspace()->FindProjectByName(project, errMsg);
if(!p) { return; }
qmake_exe_line << wxT("\"") << qmake_exe << wxT("\" -spec ") << qmakespec << wxT(" ")
<< generator.GetProFileName();
wxStringMap_t om;
om.insert(std::make_pair("QTDIR", qtdir));
EnvSetter envGuard(NULL, &om, project, config);
m_mgr->ClearOutputTab(kOutputTab_Build);
m_mgr->AppendOutputTabText(kOutputTab_Build, wxString() << "-- " << qmake_exe_line << "\n");
m_qmakeProcess =
::CreateAsyncProcess(this, qmake_exe_line, IProcessCreateDefault, p->GetFileName().GetPath());
}
}
event.Skip();
}
示例12: NewProjectClientData
NewProjectClientData(ProjectPtr project, const wxString & templateName = wxEmptyString)
: m_templateName(templateName)
{
m_project = project;
if (m_project && m_templateName.IsEmpty() ) {
// use the project name
m_templateName = m_project->GetName();
}
}
示例13: wxUnusedVar
void
CMakeProjectMenu::OnCMakeListsOpen(wxCommandEvent& event)
{
wxUnusedVar(event);
ProjectPtr project = m_plugin->GetSelectedProject();
if (project)
m_plugin->OpenCMakeLists(m_plugin->GetProjectDirectory(project->GetName()));
}
示例14: GetSelectedBuildConfig
BuildConfigPtr CMakePlugin::GetSelectedBuildConfig() const
{
const clCxxWorkspace* workspace = m_mgr->GetWorkspace();
wxASSERT(workspace);
const ProjectPtr projectPtr = GetSelectedProject();
wxASSERT(projectPtr);
return workspace->GetProjBuildConf(projectPtr->GetName(), wxEmptyString);
}
示例15: DoAddProject
ProjectPtr clCxxWorkspace::DoAddProject(ProjectPtr proj)
{
if(!proj) {
return NULL;
}
m_projects.insert(std::make_pair(proj->GetName(), proj));
proj->AssociateToWorkspace(this);
return proj;
}