本文整理汇总了C++中phpproject::Ptr_t::GetSettings方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr_t::GetSettings方法的具体用法?C++ Ptr_t::GetSettings怎么用?C++ Ptr_t::GetSettings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phpproject::Ptr_t
的用法示例。
在下文中一共展示了Ptr_t::GetSettings方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ExpandRequire
wxString PHPCodeCompletion::ExpandRequire(const wxFileName& curfile, const wxString& require)
{
PHPScanner_t scanner = ::phpLexerNew("<?php " + require);
if(!scanner) return "";
wxString outFile;
phpLexerToken token;
while(::phpLexerNext(scanner, token)) {
if(token.IsAnyComment()) continue;
switch(token.type) {
case kPHP_T_REQUIRE:
case kPHP_T_REQUIRE_ONCE:
break;
case kPHP_T_CONSTANT_ENCAPSED_STRING: {
wxString str = token.text;
str.Trim().Trim(false);
// strip the " or ' from the string
str.Remove(0, 1).RemoveLast();
outFile << str;
break;
}
case kPHP_T_FILE:
outFile << curfile.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR);
break;
case kPHP_T_DIR:
outFile << curfile.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR);
break;
}
}
wxFileName fileName(outFile);
if(fileName.IsOk() && fileName.IsRelative()) {
wxArrayString paths;
paths.Add(curfile.GetPath());
// Relative path, we try to resolve it by looking at the include path give to us
PHPProject::Ptr_t proj = PHPWorkspace::Get()->GetActiveProject();
if(proj) {
wxArrayString incpaths = proj->GetSettings().GetIncludePathAsArray();
paths.insert(paths.end(), incpaths.begin(), incpaths.end());
}
for(size_t i = 0; i < paths.GetCount(); ++i) {
wxFileName tmpFile = fileName;
if(tmpFile.MakeAbsolute(paths.Item(i))) {
wxString fullpath = tmpFile.GetFullPath();
if(wxFileName::Exists(fullpath)) {
fileName = tmpFile;
break;
}
}
}
}
if(fileName.IsOk()) {
fileName.Normalize();
outFile = fileName.GetFullPath();
}
::phpLexerDestroy(&scanner);
return outFile;
}
示例2: DoApplyBreakpoints
void XDebugManager::DoApplyBreakpoints()
{
CL_DEBUG("CodeLite >>> Applying breakpoints");
CHECK_PTR_RET(m_readerThread);
PHPProject::Ptr_t pProject = PHPWorkspace::Get()->GetActiveProject();
CHECK_PTR_RET(pProject);
const PHPProjectSettingsData& settings = pProject->GetSettings();
bool bRunAsWebserver = ( pProject->GetSettings().GetRunAs() == PHPProjectSettingsData::kRunAsWebsite);
XDebugBreakpoint::List_t& breakpoints = m_breakpointsMgr.GetBreakpoints();
XDebugBreakpoint::List_t::iterator iter = breakpoints.begin();
for( ; iter != breakpoints.end(); ++iter ) {
// apply only breakpoints without xdebug-id attached to them
if ( iter->IsApplied() ) {
continue;
}
wxStringMap_t sftpMapping;
SSHWorkspaceSettings sftpSettings;
sftpSettings.Load();
if ( !sftpSettings.GetRemoteFolder().IsEmpty() && sftpSettings.IsRemoteUploadEnabled() ) {
sftpMapping.insert( std::make_pair(PHPWorkspace::Get()->GetFilename().GetPath(), sftpSettings.GetRemoteFolder()) );
}
wxString command;
XDebugCommandHandler::Ptr_t handler( new XDebugBreakpointCmdHandler(this, ++TranscationId, *iter) );
wxString filepath = bRunAsWebserver ? settings.GetMappdPath( iter->GetFileName(), true , sftpMapping) : iter->GetFileName();
command << "breakpoint_set -i "
<< handler->GetTransactionId()
<< " -t line"
<< " -f " << filepath
<< " -n " << iter->GetLine();
DoSocketWrite( command );
AddHandler( handler );
}
}
示例3: MapRemoteFileToLocalFile
wxString MapRemoteFileToLocalFile(const wxString& remoteFile)
{
// Check that a workspace is opened
if(!PHPWorkspace::Get()->IsOpen()) return remoteFile;
// Sanity
PHPProject::Ptr_t pProject = PHPWorkspace::Get()->GetActiveProject();
if(!pProject) return remoteFile;
// Map filename file attribute returned by xdebug to local filename
wxString filename = remoteFile;
// Remote the "file://" from the file path
filename.StartsWith(FILE_SCHEME, &filename);
CL_DEBUG("filename => %s", filename);
// On Windows, the file is returned like (after removing the file://)
// /C:/Http/htdocs/file.php - remote the leading "/"
wxRegEx reMSWPrefix("/[a-zA-Z]{1}:/");
if(reMSWPrefix.IsValid() && reMSWPrefix.Matches(filename)) {
// Windows file
CL_DEBUG("filename => %s", filename);
filename.Remove(0, 1);
}
// Remove URI encoding ("%20"=>" " etc)
DecodeFileName(filename);
CL_DEBUG("filename => %s", filename);
// First check if the remote file exists locally
if(wxFileName(filename).Exists()) {
return wxFileName(filename).GetFullPath();
}
// Use the active project file mapping
const PHPProjectSettingsData& settings = pProject->GetSettings();
const JSONElement::wxStringMap_t& mapping = settings.GetFileMapping();
JSONElement::wxStringMap_t::const_iterator iter = mapping.begin();
for(; iter != mapping.end(); ++iter) {
const wxString& localFolder = iter->first;
const wxString& remoteFolder = iter->second;
if(filename.StartsWith(remoteFolder)) {
filename.Replace(remoteFolder, localFolder);
return wxFileName(filename).GetFullPath();
}
}
// No matching was found
return remoteFile;
}
示例4: GetFileMapping
wxStringMap_t XDebugManager::GetFileMapping(PHPProject::Ptr_t pProject) const
{
wxASSERT(pProject);
wxStringMap_t mappings;
const PHPProjectSettingsData& settings = pProject->GetSettings();
mappings = settings.GetFileMapping();
// Add the SFTP mappings
SSHWorkspaceSettings sftpSettings;
sftpSettings.Load();
if ( !sftpSettings.GetRemoteFolder().IsEmpty() && sftpSettings.IsRemoteUploadEnabled() ) {
mappings.insert( std::make_pair(PHPWorkspace::Get()->GetFilename().GetPath(), sftpSettings.GetRemoteFolder()) );
}
return mappings;
}
示例5: Save
void PHPProjectSettingsDlg::Save()
{
PHPProject::Ptr_t pProject = PHPWorkspace::Get()->GetProject(m_projectName);
CHECK_PTR_RET(pProject);
PHPProjectSettingsData& data = pProject->GetSettings();
// General settings
data.SetRunAs(m_choicebook1->GetSelection() == 0 ? PHPProjectSettingsData::kRunAsCLI :
PHPProjectSettingsData::kRunAsWebsite);
data.SetPhpExe(m_filePickerPHPExe->GetPath());
data.SetIndexFile(m_filePickerIndex->GetPath());
data.SetArgs(m_textCtrlProgramArgs->GetValue());
data.SetWorkingDirectory(m_dirPickerWorkingDirectory->GetPath());
data.SetIncludePath(m_textCtrlPHPIncludePath->GetValue());
data.SetPauseWhenExeTerminates(m_checkBoxPauseWhenExecutionEnds->IsChecked());
data.SetPhpIniFile(m_filePickerPhpIni->GetPath());
data.SetProjectURL(m_textCtrlWebSiteURL->GetValue());
data.SetUseSystemBrowser(m_checkBoxSystemBrowser->IsChecked());
// Code Completion settings
data.SetCcIncludePath(m_textCtrlCCIncludePath->GetValue());
// Save the file mapping
JSONElement::wxStringMap_t mapping;
int itemCount = m_dvListCtrlFileMapping->GetItemCount();
for(int i = 0; i < itemCount; ++i) {
wxVariant source, target;
m_dvListCtrlFileMapping->GetValue(source, i, 0);
m_dvListCtrlFileMapping->GetValue(target, i, 1);
mapping.insert(std::make_pair(source.GetString(), target.GetString()));
}
data.SetFileMapping(mapping);
wxString fileExts = m_pgPropFileTypes->GetValue().GetString();
fileExts.Replace(",", ";");
pProject->SetImportFileSpec(fileExts);
wxString excludeDirs = m_pgPropExcludeFolders->GetValue().GetString();
excludeDirs.Replace(",", ";");
pProject->SetExcludeFolders(excludeDirs);
// Save the project content
pProject->Save();
SetDirty(false);
}
示例6: OnMakeIndexPHP
void PHPWorkspaceView::OnMakeIndexPHP(wxCommandEvent& e)
{
e.Skip();
wxTreeItemId item = DoGetSingleSelection();
CHECK_ITEM_RET(item);
ItemData* itemData = DoGetItemData(item);
CHECK_PTR_RET(itemData);
CHECK_ID_FILE(itemData);
wxString projectName = itemData->GetProjectName();
if(projectName.IsEmpty()) return;
PHPProject::Ptr_t pProject = PHPWorkspace::Get()->GetProject(projectName);
CHECK_PTR_RET(pProject);
PHPProjectSettingsData& settings = pProject->GetSettings();
settings.SetIndexFile(itemData->GetFile());
pProject->Save();
}
示例7: ParseWorkspace
void PHPWorkspace::ParseWorkspace(bool full)
{
// Request for parsing
if(full) {
// a full parsing is needed, stop the paser thread
// close the database, delete it and recreate it
// then, restart the parser thread
PHPParserThread::Clear();
PHPParserThread::Release(); // Stop and wait the thread terminates
// Close the CC manager
PHPCodeCompletion::Instance()->Close();
// Delete the file
wxFileName fnDatabaseFile(m_workspaceFile.GetPath(), "phpsymbols.db");
fnDatabaseFile.AppendDir(".codelite");
wxLogNull noLog;
bool bRemoved = ::wxRemoveFile(fnDatabaseFile.GetFullPath());
wxUnusedVar(bRemoved);
// Start the managers again
PHPParserThread::Instance()->Start();
PHPCodeCompletion::Instance()->Open(m_workspaceFile);
}
PHPParserThreadRequest* req = new PHPParserThreadRequest(PHPParserThreadRequest::kParseWorkspaceFilesQuick);
req->workspaceFile = GetFilename().GetFullPath();
GetWorkspaceFiles(req->files);
// Append the current project CC include paths
PHPProject::Ptr_t pProject = GetActiveProject();
if(pProject) {
PHPProjectSettingsData& settings = pProject->GetSettings();
req->frameworksPaths = settings.GetCCIncludePathAsArray();
}
PHPParserThread::Instance()->Add(req);
}