本文整理汇总了C++中CScopeConfData类的典型用法代码示例。如果您正苦于以下问题:C++ CScopeConfData类的具体用法?C++ CScopeConfData怎么用?C++ CScopeConfData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CScopeConfData类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoCreateListFile
void Cscope::OnCreateDB(wxCommandEvent& e)
{
// sanity
if(m_mgr->IsWorkspaceOpen() == false) {
return;
}
m_cscopeWin->Clear();
wxString list_file = DoCreateListFile(true);
// get the reverted index option
wxString command;
wxString endMsg;
CScopeConfData settings;
command << GetCscopeExeName();
m_mgr->GetConfigTool()->ReadObject(wxT("CscopeSettings"), &settings);
if(settings.GetBuildRevertedIndexOption()) {
command << wxT(" -q");
endMsg << _("Recreated inverted CScope DB");
} else {
command << wxT(" -b");
endMsg << _("Recreated CScope DB");
}
// Do the actual create db
// since the process is always running from the workspace
// directory, there is no need to specify the full path of the list file
command << wxT(" -L -i cscope_file.list");
DoCscopeCommand(command, wxEmptyString, endMsg);
}
示例2: GetSearchPattern
void Cscope::OnFindFunctionsCallingThisFunction(wxCommandEvent& e)
{
wxString word = GetSearchPattern();
if(word.IsEmpty()) {
return;
}
m_cscopeWin->Clear();
wxString list_file = DoCreateListFile(false);
// get the rebuild option
wxString rebuildOption = wxT("");
CScopeConfData settings;
m_mgr->GetConfigTool()->ReadObject(wxT("CscopeSettings"), &settings);
if(!settings.GetRebuildOption()) {
rebuildOption = wxT(" -d");
}
// Do the actual search
wxString command;
wxString endMsg;
command << GetCscopeExeName() << rebuildOption << wxT(" -L -3 ") << word << wxT(" -i ") << list_file;
endMsg << _("cscope results for: functions calling '") << word << wxT("'");
DoCscopeCommand(command, word, endMsg);
}
示例3: DoCreateListFile
void Cscope::OnFindSymbol(wxCommandEvent &e)
{
// sanity
if ( m_mgr->GetActiveEditor() == NULL ) {
return;
}
wxString word = m_mgr->GetActiveEditor()->GetWordAtCaret();
if (word.IsEmpty()) {
return;
}
m_cscopeWin->Clear();
wxString list_file = DoCreateListFile(false);
// get the rebuild option
wxString rebuildOption = wxT("");
CScopeConfData settings;
m_mgr->GetConfigTool()->ReadObject(wxT("CscopeSettings"), &settings);
if (!settings.GetRebuildOption())
{
rebuildOption = wxT(" -d");
}
//Do the actual search
wxString command;
wxString endMsg;
command << GetCscopeExeName() << rebuildOption << wxT(" -L -0 ") << word << wxT(" -i ") << list_file;
endMsg << wxT("cscope results for: find C symbol '") << word << wxT("'");
DoCscopeCommand(command, word, endMsg);
}
示例4: CScopeSettingsDlgBase
CScopeSettingsDlg::CScopeSettingsDlg(wxWindow* parent)
: CScopeSettingsDlgBase(parent)
{
CScopeConfData settings;
EditorConfigST::Get()->ReadObject("CscopeSettings", &settings);
m_filePickerCScopeExe->SetPath(settings.GetCscopeExe());
WindowAttrManager::Load(this, "CScopeSettingsDlg");
}
示例5: OnChangeSearchScope
void CscopeTab::OnChangeSearchScope(wxCommandEvent& e)
{
CScopeConfData data;
m_mgr->GetConfigTool()->ReadObject(wxT("CscopeSettings"), &data);
// update the settings
data.SetScanScope(m_stringManager.GetStringSelection());
data.SetRebuildDbOption(m_checkBoxUpdateDb->IsChecked());
data.SetBuildRevertedIndexOption(m_checkBoxRevertedIndex->IsChecked());
// store the object
m_mgr->GetConfigTool()->WriteObject(wxT("CscopeSettings"), &data);
}
示例6: OnDoSettings
void Cscope::OnDoSettings(wxCommandEvent& e)
{
// atm the only setting to set is the cscope filepath
// First find the current value, if any
CScopeConfData settings;
m_mgr->GetConfigTool()->ReadObject(wxT("CscopeSettings"), &settings);
wxString filepath = settings.GetCscopeExe();
CScopeSettingsDlg dlg(EventNotifier::Get()->TopFrame());
if(dlg.ShowModal() == wxID_OK) {
settings.SetCscopeExe(dlg.GetPath());
m_mgr->GetConfigTool()->WriteObject(wxT("CscopeSettings"), &settings);
}
}
示例7: OnDoSettings
void Cscope::OnDoSettings(wxCommandEvent &e)
{
// atm the only setting to set is the cscope filepath
// First find the current value, if any
CScopeConfData settings;
m_mgr->GetConfigTool()->ReadObject(wxT("CscopeSettings"), &settings);
wxString filepath = settings.GetCscopeExe();
// Since there's only the one thing to ask, keep it simple for now
wxString fp = wxGetTextFromUser(_("Please enter the filepath where cscope can be found"), _("Where is cscope?"), filepath);
if ( fp.IsEmpty() ) {
return;
}
settings.SetCscopeExe(fp);
m_mgr->GetConfigTool()->WriteObject(wxT("CscopeSettings"), &settings);
}
示例8: wxT
void Cscope::OnFindFilesIncludingThisFname(wxCommandEvent& e)
{
wxString word = m_mgr->GetActiveEditor()->GetSelection();
if(word.IsEmpty()) {
// If there's no selection, try for the caret word
// That'll either be (rubbish, or) a filename
// or it'll be the 'h'of filename.h
// Cscope can cope with just a filename
word = m_mgr->GetActiveEditor()->GetWordAtCaret();
if(word == wxT("h")) {
long pos = m_mgr->GetActiveEditor()->GetCurrentPosition();
long start = m_mgr->GetActiveEditor()->WordStartPos(pos - 2, true);
wxString name = m_mgr->GetActiveEditor()->GetTextRange(start, pos - 2);
// Append the .h Cscope would be happy with just foo,
// but would also return #include foobar.h which isn't what's been requested
word = name + wxT(".h");
}
if(word.IsEmpty()) {
return;
}
}
m_cscopeWin->Clear();
wxString list_file = DoCreateListFile(false);
// get the rebuild option
wxString rebuildOption = wxT("");
CScopeConfData settings;
m_mgr->GetConfigTool()->ReadObject(wxT("CscopeSettings"), &settings);
if(!settings.GetRebuildOption()) {
rebuildOption = wxT(" -d");
}
// Do the actual search
wxString command;
wxString endMsg;
command << GetCscopeExeName() << rebuildOption << wxT(" -L -8 ") << word << wxT(" -i ") << list_file;
endMsg << _("cscope results for: files that #include '") << word << wxT("'");
DoCscopeCommand(command, word, endMsg);
}
示例9: CscopeTabBase
CscopeTab::CscopeTab( wxWindow* parent, IManager *mgr )
: CscopeTabBase( parent )
, m_table(NULL)
, m_mgr(mgr)
{
m_bitmaps = clGetManager()->GetStdIcons()->MakeStandardMimeMap();
CScopeConfData data;
m_mgr->GetConfigTool()->ReadObject(wxT("CscopeSettings"), &data);
const wxString SearchScope[] = { wxTRANSLATE("Entire Workspace"), wxTRANSLATE("Active Project") };
m_stringManager.AddStrings(sizeof(SearchScope)/sizeof(wxString), SearchScope, data.GetScanScope(), m_choiceSearchScope);
wxFont defFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
m_font = wxFont( defFont.GetPointSize(), wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
m_checkBoxUpdateDb->SetValue(data.GetRebuildOption());
m_checkBoxRevertedIndex->SetValue(data.GetBuildRevertedIndexOption());
SetMessage(_("Ready"), 0);
Clear(); // To make the Clear button UpdateUI work initially
EventNotifier::Get()->Connect(wxEVT_CL_THEME_CHANGED, wxCommandEventHandler(CscopeTab::OnThemeChanged), NULL, this);
}
示例10: GetCscopeExeName
wxString Cscope::GetCscopeExeName()
{
CScopeConfData settings;
m_mgr->GetConfigTool()->ReadObject(wxT("CscopeSettings"), &settings);
return settings.GetCscopeExe();
}