Code::Blocks  SVN r11506
ccdebuginfo.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3
3  * http://www.gnu.org/licenses/gpl-3.0.html
4  *
5  * $Revision: 11440 $
6  * $Id: ccdebuginfo.cpp 11440 2018-08-07 07:14:06Z fuscated $
7  * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/plugins/codecompletion/parser/ccdebuginfo.cpp $
8  */
9 
10 #include <sdk.h>
11 
12 #ifndef CB_PRECOMP
13  #include <wx/object.h>
14  #include <wx/string.h>
15  #include <wx/file.h>
16  #include <wx/filedlg.h>
17  #include <wx/utils.h> // wxWindowDisabler
18 
19  //(*InternalHeaders(CCDebugInfo)
20  #include <wx/string.h>
21  #include <wx/intl.h>
22  //*)
23 
24  #include <cbeditor.h>
25  #include <editormanager.h>
26  #include <logmanager.h>
27 #endif
28 
29 #include <wx/busyinfo.h>
30 #include <wx/tokenzr.h>
31 
32 #include "ccdebuginfo.h"
33 #include "parser.h"
34 
35 #define CC_DEBUGINFO_DEBUG_OUTPUT 0
36 
37 #if defined(CC_GLOBAL_DEBUG_OUTPUT)
38  #if CC_GLOBAL_DEBUG_OUTPUT == 1
39  #undef CC_DEBUGINFO_DEBUG_OUTPUT
40  #define CC_DEBUGINFO_DEBUG_OUTPUT 1
41  #elif CC_GLOBAL_DEBUG_OUTPUT == 2
42  #undef CC_DEBUGINFO_DEBUG_OUTPUT
43  #define CC_DEBUGINFO_DEBUG_OUTPUT 2
44  #endif
45 #endif
46 
47 #if CC_DEBUGINFO_DEBUG_OUTPUT == 1
48  #define TRACE(format, args...) \
49  CCLogger::Get()->DebugLog(F(format, ##args))
50  #define TRACE2(format, args...)
51 #elif CC_DEBUGINFO_DEBUG_OUTPUT == 2
52  #define TRACE(format, args...) \
53  do \
54  { \
55  if (g_EnableDebugTrace) \
56  CCLogger::Get()->DebugLog(F(format, ##args)); \
57  } \
58  while (false)
59  #define TRACE2(format, args...) \
60  CCLogger::Get()->DebugLog(F(format, ##args))
61 #else
62  #define TRACE(format, args...)
63  #define TRACE2(format, args...)
64 #endif
65 
67 {
68  inline void SaveCCDebugInfo(const wxString& fileDesc, const wxString& content)
69  {
70  wxString fname;
71  wxFileDialog dlg (Manager::Get()->GetAppWindow(),
72  fileDesc,
73  _T(""),
74  _T(""),
75  _T("Text files (*.txt)|*.txt|Any file (*)|*"),
77  PlaceWindow(&dlg);
78  if (dlg.ShowModal() != wxID_OK)
79  return;
80 
81  // Opening the file migth have failed, verify:
82  wxFile f(dlg.GetPath(), wxFile::write);
83  if (f.IsOpened())
84  {
85  f.Write(content); // write buffer to file
86  f.Close(); // release file handle
87  }
88  else
89  cbMessageBox(_("Cannot create file ") + fname, _("CC Debug Info"));
90  }
91 }// namespace CCDebugInfoHelper
92 
93 //(*IdInit(CCDebugInfo)
94 const long CCDebugInfo::ID_TEXTCTRL1 = wxNewId();
95 const long CCDebugInfo::ID_BUTTON1 = wxNewId();
100 const long CCDebugInfo::ID_STATICTEXT4 = wxNewId();
101 const long CCDebugInfo::ID_STATICTEXT6 = wxNewId();
102 const long CCDebugInfo::ID_STATICTEXT8 = wxNewId();
109 const long CCDebugInfo::ID_STATICTEXT1 = wxNewId();
112 const long CCDebugInfo::ID_BUTTON4 = wxNewId();
113 const long CCDebugInfo::ID_COMBOBOX3 = wxNewId();
114 const long CCDebugInfo::ID_BUTTON5 = wxNewId();
115 const long CCDebugInfo::ID_COMBOBOX2 = wxNewId();
116 const long CCDebugInfo::ID_BUTTON3 = wxNewId();
117 const long CCDebugInfo::ID_COMBOBOX1 = wxNewId();
118 const long CCDebugInfo::ID_BUTTON2 = wxNewId();
120 const long CCDebugInfo::ID_BUTTON7 = wxNewId();
122 const long CCDebugInfo::ID_BUTTON8 = wxNewId();
124 const long CCDebugInfo::ID_PANEL1 = wxNewId();
125 const long CCDebugInfo::ID_LISTBOX1 = wxNewId();
126 const long CCDebugInfo::ID_PANEL2 = wxNewId();
127 const long CCDebugInfo::ID_LISTBOX2 = wxNewId();
128 const long CCDebugInfo::ID_PANEL3 = wxNewId();
129 const long CCDebugInfo::ID_LISTBOX3 = wxNewId();
130 const long CCDebugInfo::ID_PANEL4 = wxNewId();
131 const long CCDebugInfo::ID_NOTEBOOK1 = wxNewId();
132 const long CCDebugInfo::ID_BUTTON6 = wxNewId();
133 //*)
134 
135 BEGIN_EVENT_TABLE(CCDebugInfo,wxScrollingDialog)
136  //(*EventTable(CCDebugInfo)
137  //*)
138 END_EVENT_TABLE()
139 
140 CCDebugInfo::CCDebugInfo(wxWindow* parent, ParserBase* parser, Token* token) :
141  m_Parser(parser),
142  m_Token(token)
143 {
144  //(*Initialize(CCDebugInfo)
145  wxStaticText* lblParent;
146  wxFlexGridSizer* FlexGridSizer1;
147  wxStaticText* lblArgs;
148  wxPanel* Panel1;
149  wxBoxSizer* BoxSizer3;
150  wxStaticLine* StaticLine2;
151  wxButton* btnGoParent;
152  wxStaticText* lblID;
153  wxBoxSizer* BoxSizer10;
154  wxStaticText* lblIsOp;
155  wxStaticText* lblName;
156  wxBoxSizer* BoxSizer7;
157  wxStaticText* lblKind;
158  wxStaticText* lblAncestors;
159  wxBoxSizer* BoxSizer13;
160  wxStaticText* lblDescendants;
161  wxBoxSizer* BoxSizer2;
162  wxPanel* Panel2;
163  wxButton* btnFind;
164  wxStaticText* lblIsConst;
165  wxBoxSizer* BoxSizer9;
166  wxStaticText* lblIsLocal;
167  wxButton* btnGoAsc;
168  wxStaticLine* StaticLine1;
169  wxBoxSizer* BoxSizer4;
170  wxStaticText* lblChildren;
171  wxPanel* Panel3;
172  wxStaticText* lblImplfile;
173  wxBoxSizer* BoxSizer8;
174  wxButton* btnGoDesc;
175  wxBoxSizer* BoxSizer1;
176  wxStaticText* lblIsTemp;
177  wxStaticText* lblScope;
178  wxNotebook* Notebook1;
179  wxStaticText* lblArgsStripped;
180  wxStaticText* lblFullType;
181  wxStaticText* lblDeclFile;
182  wxButton* btnGoDecl;
183  wxStaticText* lblNameSpace;
184  wxStaticText* lblUserData;
185  wxButton* btnGoImpl;
186  wxStaticText* StaticText29;
187  wxStaticText* lblTemplateArg;
188  wxBoxSizer* BoxSizer6;
189  wxStdDialogButtonSizer* StdDialogButtonSizer1;
190  wxButton* btnGoChildren;
191  wxStaticText* lblBaseType;
192  wxStaticText* lblIsNoExcept;
193 
194  Create(parent, wxID_ANY, _("Code-completion debug tool"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL, _T("wxID_ANY"));
195  BoxSizer1 = new wxBoxSizer(wxVERTICAL);
196  Notebook1 = new wxNotebook(this, ID_NOTEBOOK1, wxDefaultPosition, wxDefaultSize, 0, _T("ID_NOTEBOOK1"));
197  Panel1 = new wxPanel(Notebook1, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL1"));
198  BoxSizer2 = new wxBoxSizer(wxVERTICAL);
199  BoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
200  StaticText29 = new wxStaticText(Panel1, wxID_ANY, _("Find:"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
201  BoxSizer4->Add(StaticText29, 0, wxALIGN_CENTER_VERTICAL, 5);
202  txtFilter = new wxTextCtrl(Panel1, ID_TEXTCTRL1, _("*"), wxDefaultPosition, wxSize(401,21), 0, wxDefaultValidator, _T("ID_TEXTCTRL1"));
203  BoxSizer4->Add(txtFilter, 1, wxLEFT|wxALIGN_CENTER_VERTICAL, 5);
204  btnFind = new wxButton(Panel1, ID_BUTTON1, _("Find"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON1"));
205  btnFind->SetDefault();
206  BoxSizer4->Add(btnFind, 0, wxLEFT|wxALIGN_CENTER_VERTICAL, 5);
207  BoxSizer2->Add(BoxSizer4, 0, wxTOP|wxLEFT|wxRIGHT|wxEXPAND, 5);
208  StaticLine1 = new wxStaticLine(Panel1, wxID_ANY, wxDefaultPosition, wxSize(10,-1), wxLI_HORIZONTAL, _T("wxID_ANY"));
209  BoxSizer2->Add(StaticLine1, 0, wxALL|wxEXPAND, 5);
210  FlexGridSizer1 = new wxFlexGridSizer(0, 2, 5, 5);
211  FlexGridSizer1->AddGrowableCol(1);
212  lblID = new wxStaticText(Panel1, wxID_ANY, _("ID:"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
213  FlexGridSizer1->Add(lblID, 0, wxALIGN_TOP, 0);
214  txtID = new wxStaticText(Panel1, ID_STATICTEXT18, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT18"));
215  FlexGridSizer1->Add(txtID, 0, wxALIGN_TOP, 0);
216  lblName = new wxStaticText(Panel1, wxID_ANY, _("Name:"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
217  FlexGridSizer1->Add(lblName, 0, wxALIGN_TOP, 0);
218  txtName = new wxStaticText(Panel1, ID_STATICTEXT2, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT2"));
219  FlexGridSizer1->Add(txtName, 0, wxALIGN_TOP, 0);
220  lblKind = new wxStaticText(Panel1, wxID_ANY, _("Kind:"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
221  FlexGridSizer1->Add(lblKind, 0, wxALIGN_TOP, 0);
222  txtKind = new wxStaticText(Panel1, ID_STATICTEXT10, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT10"));
223  FlexGridSizer1->Add(txtKind, 0, wxALIGN_TOP, 0);
224  lblScope = new wxStaticText(Panel1, wxID_ANY, _("Scope:"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
225  FlexGridSizer1->Add(lblScope, 0, wxALIGN_TOP, 0);
226  txtScope = new wxStaticText(Panel1, ID_STATICTEXT12, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT12"));
227  FlexGridSizer1->Add(txtScope, 0, wxALIGN_TOP, 0);
228  lblFullType = new wxStaticText(Panel1, wxID_ANY, _("Full type:"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
229  FlexGridSizer1->Add(lblFullType, 0, wxALIGN_TOP, 0);
230  txtFullType = new wxStaticText(Panel1, ID_STATICTEXT4, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT4"));
231  FlexGridSizer1->Add(txtFullType, 0, wxALIGN_TOP, 0);
232  lblBaseType = new wxStaticText(Panel1, wxID_ANY, _("Base type:"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
233  FlexGridSizer1->Add(lblBaseType, 0, wxALIGN_TOP, 0);
234  txtBaseType = new wxStaticText(Panel1, ID_STATICTEXT6, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT6"));
235  FlexGridSizer1->Add(txtBaseType, 0, wxALIGN_TOP, 0);
236  lblArgs = new wxStaticText(Panel1, wxID_ANY, _("Arguments:"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
237  FlexGridSizer1->Add(lblArgs, 0, wxALIGN_TOP, 0);
238  txtArgs = new wxStaticText(Panel1, ID_STATICTEXT8, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT8"));
239  FlexGridSizer1->Add(txtArgs, 0, wxALIGN_TOP, 0);
240  lblArgsStripped = new wxStaticText(Panel1, wxID_ANY, _("Arguments (str.):"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
241  FlexGridSizer1->Add(lblArgsStripped, 0, wxALIGN_TOP, 0);
242  txtArgsStripped = new wxStaticText(Panel1, ID_STATICTEXT37, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT37"));
243  FlexGridSizer1->Add(txtArgsStripped, 0, wxALIGN_TOP, 0);
244  lblTemplateArg = new wxStaticText(Panel1, wxID_ANY, _("Templ. args:"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
245  FlexGridSizer1->Add(lblTemplateArg, 0, wxALIGN_TOP, 0);
246  txtTemplateArg = new wxStaticText(Panel1, ID_STATICTEXT41, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT41"));
247  FlexGridSizer1->Add(txtTemplateArg, 0, wxALIGN_TOP, 0);
248  lblIsOp = new wxStaticText(Panel1, wxID_ANY, _("Is operator\?"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
249  FlexGridSizer1->Add(lblIsOp, 0, wxALIGN_TOP, 0);
250  txtIsOp = new wxStaticText(Panel1, ID_STATICTEXT14, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT14"));
251  FlexGridSizer1->Add(txtIsOp, 0, wxALIGN_TOP, 0);
252  lblIsLocal = new wxStaticText(Panel1, wxID_ANY, _("Is local\?"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
253  FlexGridSizer1->Add(lblIsLocal, 0, wxALIGN_TOP, 0);
254  txtIsLocal = new wxStaticText(Panel1, ID_STATICTEXT16, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT16"));
255  FlexGridSizer1->Add(txtIsLocal, 0, wxALIGN_TOP, 0);
256  lblIsTemp = new wxStaticText(Panel1, wxID_ANY, _("Is temp\?"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
257  FlexGridSizer1->Add(lblIsTemp, 0, wxALIGN_TOP, 0);
258  txtIsTemp = new wxStaticText(Panel1, ID_STATICTEXT33, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT33"));
259  FlexGridSizer1->Add(txtIsTemp, 0, wxALIGN_TOP, 0);
260  lblIsConst = new wxStaticText(Panel1, wxID_ANY, _("Is const\?"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
261  FlexGridSizer1->Add(lblIsConst, 0, wxALIGN_TOP, 0);
262  txtIsConst = new wxStaticText(Panel1, ID_STATICTEXT39, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT39"));
263  FlexGridSizer1->Add(txtIsConst, 0, wxALIGN_TOP, 0);
264  lblIsNoExcept = new wxStaticText(Panel1, wxID_ANY, _("Is noexcept\?"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
265  FlexGridSizer1->Add(lblIsNoExcept, 0, wxALIGN_TOP, 0);
266  txtIsNoExcept = new wxStaticText(Panel1, ID_STATICTEXT1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT1"));
267  FlexGridSizer1->Add(txtIsNoExcept, 0, wxALIGN_TOP, 0);
268  lblNameSpace = new wxStaticText(Panel1, wxID_ANY, _("Namespace:"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
269  FlexGridSizer1->Add(lblNameSpace, 0, wxALIGN_TOP, 0);
270  txtNamespace = new wxStaticText(Panel1, ID_STATICTEXT20, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT20"));
271  FlexGridSizer1->Add(txtNamespace, 0, wxALIGN_TOP, 0);
272  lblParent = new wxStaticText(Panel1, wxID_ANY, _("Parent:"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
273  FlexGridSizer1->Add(lblParent, 0, wxALIGN_CENTER_VERTICAL, 0);
274  BoxSizer7 = new wxBoxSizer(wxHORIZONTAL);
275  txtParent = new wxStaticText(Panel1, ID_STATICTEXT24, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT24"));
276  BoxSizer7->Add(txtParent, 1, wxALIGN_CENTER_VERTICAL, 0);
277  btnGoParent = new wxButton(Panel1, ID_BUTTON4, _("Go"), wxDefaultPosition, wxSize(36,23), 0, wxDefaultValidator, _T("ID_BUTTON4"));
278  BoxSizer7->Add(btnGoParent, 0, wxALIGN_CENTER_VERTICAL, 0);
279  FlexGridSizer1->Add(BoxSizer7, 0, wxEXPAND, 0);
280  lblChildren = new wxStaticText(Panel1, wxID_ANY, _("Children:"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
281  FlexGridSizer1->Add(lblChildren, 0, wxALIGN_CENTER_VERTICAL, 0);
282  BoxSizer8 = new wxBoxSizer(wxHORIZONTAL);
283  cmbChildren = new wxComboBox(Panel1, ID_COMBOBOX3, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY, wxDefaultValidator, _T("ID_COMBOBOX3"));
284  BoxSizer8->Add(cmbChildren, 1, wxALIGN_CENTER_VERTICAL, 0);
285  btnGoChildren = new wxButton(Panel1, ID_BUTTON5, _("Go"), wxDefaultPosition, wxSize(36,23), 0, wxDefaultValidator, _T("ID_BUTTON5"));
286  BoxSizer8->Add(btnGoChildren, 0, wxALIGN_CENTER_VERTICAL, 0);
287  FlexGridSizer1->Add(BoxSizer8, 0, wxEXPAND, 0);
288  lblAncestors = new wxStaticText(Panel1, wxID_ANY, _("Ancestors:"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
289  FlexGridSizer1->Add(lblAncestors, 0, wxALIGN_CENTER_VERTICAL, 0);
290  BoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
291  cmbAncestors = new wxComboBox(Panel1, ID_COMBOBOX2, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY, wxDefaultValidator, _T("ID_COMBOBOX2"));
292  BoxSizer6->Add(cmbAncestors, 1, wxALIGN_CENTER_VERTICAL, 0);
293  btnGoAsc = new wxButton(Panel1, ID_BUTTON3, _("Go"), wxDefaultPosition, wxSize(36,23), 0, wxDefaultValidator, _T("ID_BUTTON3"));
294  BoxSizer6->Add(btnGoAsc, 0, wxALIGN_CENTER_VERTICAL, 0);
295  FlexGridSizer1->Add(BoxSizer6, 0, wxEXPAND, 0);
296  lblDescendants = new wxStaticText(Panel1, wxID_ANY, _("Descendants:"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
297  FlexGridSizer1->Add(lblDescendants, 0, wxALIGN_CENTER_VERTICAL, 0);
298  BoxSizer5 = new wxBoxSizer(wxHORIZONTAL);
299  cmbDescendants = new wxComboBox(Panel1, ID_COMBOBOX1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY, wxDefaultValidator, _T("ID_COMBOBOX1"));
300  BoxSizer5->Add(cmbDescendants, 1, wxALIGN_CENTER_VERTICAL, 0);
301  btnGoDesc = new wxButton(Panel1, ID_BUTTON2, _("Go"), wxDefaultPosition, wxSize(36,23), 0, wxDefaultValidator, _T("ID_BUTTON2"));
302  BoxSizer5->Add(btnGoDesc, 0, wxALIGN_CENTER_VERTICAL, 0);
303  FlexGridSizer1->Add(BoxSizer5, 0, wxEXPAND, 0);
304  lblDeclFile = new wxStaticText(Panel1, wxID_ANY, _("Decl. filename:"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
305  FlexGridSizer1->Add(lblDeclFile, 0, wxALIGN_TOP, 0);
306  BoxSizer11 = new wxBoxSizer(wxHORIZONTAL);
307  txtDeclFile = new wxStaticText(Panel1, ID_STATICTEXT26, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT26"));
308  BoxSizer11->Add(txtDeclFile, 1, wxALIGN_CENTER_VERTICAL, 0);
309  btnGoDecl = new wxButton(Panel1, ID_BUTTON7, _("Go"), wxDefaultPosition, wxSize(36,23), 0, wxDefaultValidator, _T("ID_BUTTON7"));
310  BoxSizer11->Add(btnGoDecl, 0, wxALIGN_CENTER_VERTICAL, 0);
311  FlexGridSizer1->Add(BoxSizer11, 0, wxEXPAND, 0);
312  lblImplfile = new wxStaticText(Panel1, wxID_ANY, _("Impl. filename:"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
313  FlexGridSizer1->Add(lblImplfile, 0, wxALIGN_TOP, 0);
314  BoxSizer12 = new wxBoxSizer(wxHORIZONTAL);
315  txtImplFile = new wxStaticText(Panel1, ID_STATICTEXT28, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT28"));
316  BoxSizer12->Add(txtImplFile, 1, wxALIGN_CENTER_VERTICAL, 0);
317  btnGoImpl = new wxButton(Panel1, ID_BUTTON8, _("Go"), wxDefaultPosition, wxSize(36,23), 0, wxDefaultValidator, _T("ID_BUTTON8"));
318  BoxSizer12->Add(btnGoImpl, 0, wxALIGN_CENTER_VERTICAL, 0);
319  FlexGridSizer1->Add(BoxSizer12, 0, wxEXPAND, 0);
320  lblUserData = new wxStaticText(Panel1, wxID_ANY, _("User data:"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
321  FlexGridSizer1->Add(lblUserData, 0, wxALIGN_TOP, 0);
322  txtUserData = new wxStaticText(Panel1, ID_STATICTEXT35, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT35"));
323  FlexGridSizer1->Add(txtUserData, 0, wxALIGN_TOP, 0);
324  BoxSizer2->Add(FlexGridSizer1, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5);
325  Panel1->SetSizer(BoxSizer2);
326  BoxSizer2->Fit(Panel1);
327  BoxSizer2->SetSizeHints(Panel1);
328  Panel2 = new wxPanel(Notebook1, ID_PANEL2, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL2"));
329  BoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
330  lstFiles = new wxListBox(Panel2, ID_LISTBOX1, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_LISTBOX1"));
331  BoxSizer3->Add(lstFiles, 1, wxALL|wxEXPAND, 5);
332  Panel2->SetSizer(BoxSizer3);
333  BoxSizer3->Fit(Panel2);
334  BoxSizer3->SetSizeHints(Panel2);
335  Panel3 = new wxPanel(Notebook1, ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL3"));
336  BoxSizer9 = new wxBoxSizer(wxHORIZONTAL);
337  lstDirs = new wxListBox(Panel3, ID_LISTBOX2, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_LISTBOX2"));
338  BoxSizer9->Add(lstDirs, 1, wxALL|wxEXPAND, 5);
339  Panel3->SetSizer(BoxSizer9);
340  BoxSizer9->Fit(Panel3);
341  BoxSizer9->SetSizeHints(Panel3);
342  Panel4 = new wxPanel(Notebook1, ID_PANEL4, wxPoint(170,6), wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL4"));
343  BoxSizer13 = new wxBoxSizer(wxHORIZONTAL);
344  lstMacros = new wxListBox(Panel4, ID_LISTBOX3, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_LISTBOX3"));
345  BoxSizer13->Add(lstMacros, 1, wxALL|wxEXPAND, 5);
346  Panel4->SetSizer(BoxSizer13);
347  BoxSizer13->Fit(Panel4);
348  BoxSizer13->SetSizeHints(Panel4);
349  Notebook1->AddPage(Panel1, _("Tokens"), false);
350  Notebook1->AddPage(Panel2, _("Files list"), false);
351  Notebook1->AddPage(Panel3, _("Search dirs"), false);
352  Notebook1->AddPage(Panel4, _("Predefined macros"), false);
353  BoxSizer1->Add(Notebook1, 1, wxALL|wxEXPAND, 5);
354  BoxSizer10 = new wxBoxSizer(wxHORIZONTAL);
355  txtInfo = new wxStaticText(this, wxID_ANY, _("The parser contains 0 tokens found in 0 files"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
356  BoxSizer10->Add(txtInfo, 1, wxLEFT|wxALIGN_CENTER_VERTICAL, 5);
357  btnSave = new wxButton(this, ID_BUTTON6, _("Save"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON6"));
358  BoxSizer10->Add(btnSave, 0, wxLEFT|wxALIGN_BOTTOM, 5);
359  BoxSizer1->Add(BoxSizer10, 0, wxEXPAND, 5);
360  StaticLine2 = new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxSize(10,-1), wxLI_HORIZONTAL, _T("wxID_ANY"));
361  BoxSizer1->Add(StaticLine2, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5);
362  StdDialogButtonSizer1 = new wxStdDialogButtonSizer();
363  StdDialogButtonSizer1->AddButton(new wxButton(this, wxID_CANCEL, _("Close")));
364  StdDialogButtonSizer1->Realize();
365  BoxSizer1->Add(StdDialogButtonSizer1, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5);
366  SetSizer(BoxSizer1);
367  BoxSizer1->Fit(this);
368  BoxSizer1->SetSizeHints(this);
369  Center();
370 
371  Connect(ID_BUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&CCDebugInfo::OnFindClick);
372  Connect(ID_BUTTON4,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&CCDebugInfo::OnGoParentClick);
373  Connect(ID_BUTTON5,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&CCDebugInfo::OnGoChildrenClick);
374  Connect(ID_BUTTON3,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&CCDebugInfo::OnGoAscClick);
375  Connect(ID_BUTTON2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&CCDebugInfo::OnGoDescClick);
376  Connect(ID_BUTTON7,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&CCDebugInfo::OnGoDeclClick);
377  Connect(ID_BUTTON8,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&CCDebugInfo::OnGoImplClick);
378  Connect(ID_BUTTON6,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&CCDebugInfo::OnSave);
379  Connect(wxID_ANY,wxEVT_INIT_DIALOG,(wxObjectEventFunction)&CCDebugInfo::OnInit);
380  //*)
381 }
382 
384 {
385  //(*Destroy(CCDebugInfo)
386  //*)
387 }
388 
390 {
391  TokenTree* tree = m_Parser->GetTokenTree();
392  if (!tree) return;
393 
394  lstFiles->Freeze();
395  lstFiles->Clear();
396 
397  for (size_t i = 0; i < tree->m_FilenameMap.size(); ++i)
398  {
399  wxString file = tree->m_FilenameMap.GetString(i);
400  if (!file.IsEmpty())
401  lstFiles->Append(file);
402  }
403 
404  lstFiles->Thaw();
405 }
406 
408 {
409  lstDirs->Freeze();
410  lstDirs->Clear();
411 
412  const wxArrayString& dirs = m_Parser->GetIncludeDirs();
413  for (size_t i = 0; i < dirs.GetCount(); ++i)
414  {
415  const wxString& file = dirs[i];
416  if (!file.IsEmpty())
417  lstDirs->Append(file);
418  }
419 
420  lstDirs->Thaw();
421 }
422 
424 {
425  lstMacros->Freeze();
426  lstMacros->Clear();
427 
428  wxStringTokenizer tknzr(m_Parser->GetPredefinedMacros(), wxT("#"));
429  while ( tknzr.HasMoreTokens() )
430  {
431  wxString macro = tknzr.GetNextToken();
432  if (!macro.IsEmpty())
433  lstMacros->Append(wxT("#") + macro);
434  }
435 
436  lstMacros->Thaw();
437 }
438 
440 {
441  if (!m_Token)
442  {
443  txtID->SetLabel(wxEmptyString);
444  txtName->SetLabel(wxEmptyString);
445  txtKind->SetLabel(wxEmptyString);
446  txtScope->SetLabel(wxEmptyString);
447  txtFullType->SetLabel(wxEmptyString);
448  txtBaseType->SetLabel(wxEmptyString);
449  txtArgs->SetLabel(wxEmptyString);
450  txtArgsStripped->SetLabel(wxEmptyString);
451  txtTemplateArg->SetLabel(wxEmptyString);
452  txtIsOp->SetLabel(wxEmptyString);
453  txtIsLocal->SetLabel(wxEmptyString);
454  txtNamespace->SetLabel(wxEmptyString);
455  txtParent->SetLabel(wxEmptyString);
456  cmbChildren->Clear();
457  cmbAncestors->Clear();
458  cmbDescendants->Clear();
459  txtDeclFile->SetLabel(wxEmptyString);
460  txtImplFile->SetLabel(wxEmptyString);
461  return;
462  }
463 
464  TokenTree* tree = m_Parser->GetTokenTree();
465  if (!tree) return;
466 
467  const Token* parent = tree->at(m_Token->m_ParentIndex);
468  tree->RecalcInheritanceChain(m_Token);
469 
470  wxString args = m_Token->GetFormattedArgs();
471  wxString argsStr = m_Token->m_BaseArgs;
472  wxString tmplArg = m_Token->m_TemplateArgument;
473  wxString fullType = m_Token->m_FullType;
474 
475  // so they can be displayed in wxStaticText
476  args.Replace(_T("&"), _T("&&"), true);
477  argsStr.Replace(_T("&"), _T("&&"), true);
478  tmplArg.Replace(_T("&"), _T("&&"), true);
479  fullType.Replace(_T("&"), _T("&&"), true);
480 
481  txtID->SetLabel(wxString::Format(_T("%d"), m_Token->m_Index));
482  txtName->SetLabel(m_Token->m_Name);
483  txtKind->SetLabel(m_Token->GetTokenKindString());
484  txtScope->SetLabel(m_Token->GetTokenScopeString());
485  txtFullType->SetLabel(fullType);
486  txtBaseType->SetLabel(m_Token->m_BaseType);
487  txtArgs->SetLabel(args);
488  txtArgsStripped->SetLabel(argsStr);
489  txtTemplateArg->SetLabel(tmplArg);
490  txtIsOp->SetLabel(m_Token->m_IsOperator ? _("Yes") : _("No"));
491  txtIsLocal->SetLabel(m_Token->m_IsLocal ? _("Yes") : _("No"));
492  txtIsTemp->SetLabel(m_Token->m_IsTemp ? _("Yes") : _("No"));
493  txtIsConst->SetLabel(m_Token->m_IsConst ? _("Yes") : _("No"));
494  txtIsNoExcept->SetLabel(m_Token->m_IsNoExcept ? _("Yes") : _("No"));
495  txtNamespace->SetLabel(m_Token->GetNamespace());
496  wxString label;
497  if (parent)
498  label = parent->m_Name;
499  else
500  label = _("<Global namespace>");
501  txtParent->SetLabel(wxString::Format(_T("%s (%d)"), label.wx_str(), m_Token->m_ParentIndex));
502 
503  FillChildren();
504  FillAncestors();
505  FillDescendants();
506 
507  if (!m_Token->GetFilename().IsEmpty())
508  txtDeclFile->SetLabel(wxString::Format(_T("%s : %u"), m_Token->GetFilename().c_str(), m_Token->m_Line));
509  else
510  txtDeclFile->SetLabel(wxEmptyString);
511  if (!m_Token->GetImplFilename().IsEmpty())
512  txtImplFile->SetLabel(wxString::Format(_("%s : %u (code lines: %u to %u)"), m_Token->GetImplFilename().c_str(), m_Token->m_ImplLine, m_Token->m_ImplLineStart, m_Token->m_ImplLineEnd));
513  else
514  txtImplFile->SetLabel(wxEmptyString);
515  txtUserData->SetLabel(wxString::Format(_T("0x%p"), m_Token->m_UserData));
516 }
517 
519 {
520  TokenTree* tree = m_Parser->GetTokenTree();
521  if (!tree) return;
522 
523  cmbChildren->Clear();
524 
525  for (TokenIdxSet::const_iterator it = m_Token->m_Children.begin(); it != m_Token->m_Children.end(); ++it)
526  {
527  const Token* child = tree->at(*it);
528  const wxString msgInvalidToken = _("<invalid token>");
529  cmbChildren->Append(wxString::Format(_T("%s (%d)"), child ? child->m_Name.wx_str() : msgInvalidToken.wx_str(), *it));
530  }
531  cmbChildren->SetSelection(0);
532 }
533 
535 {
536  TokenTree* tree = m_Parser->GetTokenTree();
537  if (!tree) return;
538 
539  cmbAncestors->Clear();
540 
541  for (TokenIdxSet::const_iterator it = m_Token->m_Ancestors.begin(); it != m_Token->m_Ancestors.end(); ++it)
542  {
543  const Token* ancestor = tree->at(*it);
544  const wxString msgInvalidToken = _("<invalid token>");
545  cmbAncestors->Append(wxString::Format(_T("%s (%d)"), ancestor ? ancestor->m_Name.wx_str() : msgInvalidToken.wx_str(), *it));
546  }
547  cmbAncestors->SetSelection(0);
548 }
549 
551 {
552  TokenTree* tree = m_Parser->GetTokenTree();
553  if (!tree) return;
554 
555  cmbDescendants->Clear();
556 
557  for (TokenIdxSet::const_iterator it = m_Token->m_Descendants.begin(); it != m_Token->m_Descendants.end(); ++it)
558  {
559  const Token* descendant = tree->at(*it);
560  const wxString msgInvalidToken = _("<invalid token>");
561  cmbDescendants->Append(wxString::Format(_T("%s (%d)"), descendant ? descendant->m_Name.wx_str() : msgInvalidToken.wx_str(), *it));
562  }
563  cmbDescendants->SetSelection(0);
564 }
565 
567 {
568  if (!m_Parser || !m_Parser->GetTokenTree())
569  return;
570 
571  txtInfo->SetLabel(wxString::Format(_("The parser contains %lu tokens, found in %lu files"),
572  static_cast<unsigned long>(m_Parser->GetTokenTree()->size()),
573  static_cast<unsigned long>(m_Parser->GetTokenTree()->m_FileMap.size())));
574 
575  DisplayTokenInfo();
576  FillFiles();
577  FillDirs();
578  FillMacros();
579 
580  txtFilter->SetFocus();
581 }
582 
584 {
585  TokenTree* tree = m_Parser->GetTokenTree();
586  if (!tree) return;
587 
588  wxString search = txtFilter->GetValue();
589 
590  m_Token = 0;
591 
592  // first determine if the user entered an ID or a search mask
593  long unsigned id;
594  if (search.ToULong(&id, 10))
595  {
596  // easy; ID
597  m_Token = tree->at(id);
598  }
599  else
600  {
601  // find all matching tokens
602  TokenIdxSet result;
603  for (size_t i = 0; i < tree->size(); ++i)
604  {
605  const Token* token = tree->at(i);
606  if (token && token->m_Name.Matches(search))
607  result.insert(i);
608  }
609 
610  // a single result?
611  if (result.size() == 1)
612  m_Token = tree->at(*(result.begin()));
613  else
614  {
615  // fill a list and ask the user which token to display
616  wxArrayString arr;
617  wxArrayInt intarr;
618  for (TokenIdxSet::const_iterator it = result.begin(); it != result.end(); ++it)
619  {
620  const Token* token = tree->at(*it);
621  arr.Add(token->DisplayName());
622  intarr.Add(*it);
623  }
624  int sel = cbGetSingleChoiceIndex(_("Please make a selection:"), _("Multiple matches"), arr, this,
625  wxSize(400, 400));
626  if (sel == -1)
627  return;
628 
629  m_Token = tree->at(intarr[sel]);
630  }
631  }
632 
633  DisplayTokenInfo();
634 }
635 
637 {
638  int idx = cmbAncestors->GetSelection();
639  if (!m_Token || idx == -1)
640  return;
641 
642  int count = 0;
643  for (TokenIdxSet::const_iterator it = m_Token->m_Ancestors.begin(); it != m_Token->m_Ancestors.end(); ++it)
644  {
645  if (count == idx)
646  m_Token = m_Parser->GetTokenTree()->at(*it);
647  {
648  DisplayTokenInfo();
649  break;
650  }
651  ++count;
652  }
653 }
654 
656 {
657  int idx = cmbDescendants->GetSelection();
658  if (!m_Token || idx == -1)
659  return;
660 
661  int count = 0;
662  for (TokenIdxSet::const_iterator it = m_Token->m_Descendants.begin(); it != m_Token->m_Descendants.end(); ++it)
663  {
664  if (count == idx)
665  {
666  m_Token = m_Parser->GetTokenTree()->at(*it);
667  DisplayTokenInfo();
668  break;
669  }
670  ++count;
671  }
672 }
673 
675 {
676  if (!m_Token || m_Token->m_ParentIndex == -1)
677  return;
678 
679  m_Token = m_Parser->GetTokenTree()->at(m_Token->m_ParentIndex);
680  DisplayTokenInfo();
681 }
682 
684 {
685  int idx = cmbChildren->GetSelection();
686  if (!m_Token || idx == -1)
687  return;
688 
689  int count = 0;
690  for (TokenIdxSet::const_iterator it = m_Token->m_Children.begin(); it != m_Token->m_Children.end(); ++it)
691  {
692  if (count == idx)
693  {
694  m_Token = m_Parser->GetTokenTree()->at(*it);
695  DisplayTokenInfo();
696  break;
697  }
698  ++count;
699  }
700 }
701 
702 void CCDebugInfo::OnSave(cb_unused wxCommandEvent& event)
703 {
704  TokenTree* tree = m_Parser->GetTokenTree();
705 
706  wxArrayString saveWhat;
707  saveWhat.Add(_("Dump the tokens tree"));
708  saveWhat.Add(_("Dump the serialised tokens tree"));
709  saveWhat.Add(_("Dump the file list"));
710  saveWhat.Add(_("Dump the list of include directories"));
711  saveWhat.Add(_("Dump the token list of files"));
712 
713  int sel = cbGetSingleChoiceIndex(_("What do you want to save?"), _("CC Debug Info"),
714  saveWhat, this, wxSize(400, 400));
715 
716  switch (sel)
717  {
718  case -1:
719  // cancelled
720  return;
721 
722  case 0:
723  {
724  wxString tt;
725  { // life time of wxWindowDisabler/wxBusyInfo
726  wxWindowDisabler disableAll;
727  wxBusyInfo running(_("Obtaining tokens tree... please wait (this may take several seconds)..."),
728  Manager::Get()->GetAppWindow());
729 
730  tt = tree->m_Tree.dump();
731  }
732  CCDebugInfoHelper::SaveCCDebugInfo(_("Save tokens tree"), tt);
733  }
734  break;
735  case 1:
736  {
737  wxString tt_ser;
738  { // life time of wxWindowDisabler/wxBusyInfo
739  wxWindowDisabler disableAll;
740  wxBusyInfo running(_("Serialising tokens tree... please wait (this may take several seconds)..."),
741  Manager::Get()->GetAppWindow());
742 
743  tt_ser = tree->m_Tree.Serialize();
744  }
745  CCDebugInfoHelper::SaveCCDebugInfo(_("Save serialised tokens tree"), tt_ser);
746  }
747  break;
748  case 2:
749  {
750  wxString files;
751  for (size_t i = 0; i < tree->m_FilenameMap.size(); ++i)
752  {
753  wxString file = tree->m_FilenameMap.GetString(i);
754  if (!file.IsEmpty())
755  files += file + _T("\r\n");
756  }
757 
758  CCDebugInfoHelper::SaveCCDebugInfo(_("Save file list"), files);
759  }
760  break;
761  case 3:
762  {
763  wxString dirs;
764  const wxArrayString& dirsArray = m_Parser->GetIncludeDirs();
765  for (size_t i = 0; i < dirsArray.GetCount(); ++i)
766  {
767  const wxString& dir = dirsArray[i];
768  if (!dir.IsEmpty())
769  dirs += dir + _T("\r\n");
770  }
771  CCDebugInfoHelper::SaveCCDebugInfo(_("Save list of include directories"), dirs);
772  }
773  break;
774  case 4:
775  {
776  wxString fileTokens;
777  {
778  wxWindowDisabler disableAll;
779  wxBusyInfo running(_("Obtaining tokens tree... please wait (this may take several seconds)..."),
780  Manager::Get()->GetAppWindow());
781  for (size_t i = 0; i < tree->m_FilenameMap.size(); ++i)
782  {
783  const wxString file = tree->m_FilenameMap.GetString(i);
784  if (!file.IsEmpty())
785  {
786  fileTokens += file + _T("\r\n");
787 
788  TokenIdxSet result;
789  tree->FindTokensInFile(file, result, tkUndefined);
790  for (TokenIdxSet::const_iterator it = result.begin(); it != result.end(); ++it)
791  {
792  const Token* token = tree->at(*it);
793  fileTokens << token->GetTokenKindString() << _T(" ");
794  if (token->m_TokenKind == tkFunction)
795  fileTokens << token->m_Name << token->GetFormattedArgs() << _T("\t");
796  else
797  fileTokens << token->DisplayName() << _T("\t");
798  fileTokens << _T("[") << token->m_Line << _T(",") << token->m_ImplLine << _T("]");
799  fileTokens << _T("\r\n");
800  }
801  }
802  fileTokens += _T("\r\n");
803  }
804  }
805 
806  CCDebugInfoHelper::SaveCCDebugInfo(_("Save token list of files"), fileTokens);
807  }
808  break;
809  default:
810  cbMessageBox(_("Invalid selection."), _("CC Debug Info"));
811  }
812 }
813 
815 {
816  wxString file;
817  int line;
818 
819  if (m_Token && !m_Token->GetFilename().IsEmpty())
820  {
821  file = m_Token->GetFilename();
822  line = m_Token->m_Line;
823  }
824  else
825  return;
826 
828  if (!ed)
829  ed = Manager::Get()->GetEditorManager()->Open(file);
830 
831  if (ed)
832  {
833  ed->Activate();
834  ed->GotoLine(line);
835  }
836 }
837 
839 {
840  wxString file;
841  int line;
842 
843  if (m_Token && !m_Token->GetImplFilename().IsEmpty())
844  {
845  file = m_Token->GetImplFilename();
846  line = m_Token->m_ImplLine;
847  }
848  else
849  return;
850 
852  if (!ed)
853  ed = Manager::Get()->GetEditorManager()->Open(file);
854 
855  if (ed)
856  {
857  ed->Activate();
858  ed->GotoLine(line);
859  }
860 }
static const long ID_STATICTEXT14
Definition: ccdebuginfo.h:59
wxSize Fit(wxWindow *window)
cbEditor * IsBuiltinOpen(const wxString &filename)
Definition: editormanager.h:92
void SaveCCDebugInfo(const wxString &fileDesc, const wxString &content)
Definition: ccdebuginfo.cpp:68
static const long ID_PANEL4
Definition: ccdebuginfo.h:84
virtual bool AddPage(wxWindow *page, const wxString &text, bool select=false, int imageId=NO_IMAGE)
bool Matches(const wxString &mask) const
virtual int ShowModal()
static const long ID_TEXTCTRL1
Definition: ccdebuginfo.h:48
int wxNewId()
static const long ID_STATICTEXT37
Definition: ccdebuginfo.h:57
TokenSearchTree m_Tree
This is a string->TokenIndexSet map.
Definition: tokentree.h:345
static const long ID_STATICTEXT26
Definition: ccdebuginfo.h:73
wxString GetFormattedArgs() const
remove all &#39; &#39; in the original function argument string
Definition: token.cpp:199
Token * at(int idx)
Definition: tokentree.h:51
void FillChildren()
void FillDirs()
void OnGoDescClick(wxCommandEvent &event)
static const long ID_STATICTEXT41
Definition: ccdebuginfo.h:58
const wxValidator wxDefaultValidator
static Manager * Get()
Use Manager::Get() to get a pointer to its instance Manager::Get() is guaranteed to never return an i...
Definition: manager.cpp:182
wxString m_Name
Token&#39;s name, it can be searched in the TokenTree.
Definition: token.h:188
unsigned int m_ImplLine
function implementation line index
Definition: token.h:219
void Clear()
Definition: tokentree.h:86
static const long ID_STATICTEXT18
Definition: ccdebuginfo.h:50
static const long ID_BUTTON2
Definition: ccdebuginfo.h:72
static const long ID_STATICTEXT28
Definition: ccdebuginfo.h:75
static const long ID_LISTBOX2
Definition: ccdebuginfo.h:81
static const long ID_PANEL2
Definition: ccdebuginfo.h:80
void GotoLine(int line, bool centerOnScreen=true) override
Move the caret at the specified line.
Definition: cbeditor.cpp:2223
void DisplayTokenInfo()
void FillFiles()
void OnGoAscClick(wxCommandEvent &event)
void FillMacros()
a container class to hold all the Tokens getting from parsing stage
Definition: tokentree.h:37
static const long ID_PANEL1
Definition: ccdebuginfo.h:78
wxCStrData c_str() const
virtual void Activate()
Activate this editor.
Definition: editorbase.cpp:175
DLLIMPORT int cbGetSingleChoiceIndex(const wxString &message, const wxString &caption, const wxArrayString &choices, wxWindow *parent=NULL, const wxSize &size=wxSize(300, 300), int initialSelection=0)
Definition: globals.cpp:1427
static const long ID_STATICTEXT33
Definition: ccdebuginfo.h:61
#define _T(string)
unsigned int m_Line
Line index where the token was met, which is 1 based.
Definition: token.h:210
void OnGoDeclClick(wxCommandEvent &event)
size_t size()
total size of std::vector<Token*>
Definition: tokentree.cpp:98
void AddGrowableCol(size_t idx, int proportion=0)
bool ToULong(unsigned long *val, int base=10) const
void AddButton(wxButton *button)
#define wxT(string)
wxString DisplayName() const
a short simple string to show the token information, this usually generate for show the tip message w...
Definition: token.cpp:80
static const long ID_COMBOBOX2
Definition: ccdebuginfo.h:69
static const long ID_STATICTEXT35
Definition: ccdebuginfo.h:77
const long ID_TEXTCTRL1
static const long ID_BUTTON6
Definition: ccdebuginfo.h:86
static const long ID_BUTTON5
Definition: ccdebuginfo.h:68
EditorManager * GetEditorManager() const
Definition: manager.cpp:434
void RecalcInheritanceChain(Token *token)
convert the Token&#39;s ancestor string to it&#39;s IDs this contains recursive calls, for example in such co...
Definition: tokentree.cpp:643
static const long ID_LISTBOX3
Definition: ccdebuginfo.h:83
static const long ID_STATICTEXT8
Definition: ccdebuginfo.h:56
static const long ID_STATICTEXT2
Definition: ccdebuginfo.h:51
virtual ~CCDebugInfo()
static const long ID_STATICTEXT10
Definition: ccdebuginfo.h:52
a symbol found in the parsed files, it can be many kinds, such as a variable, a class and so on...
Definition: token.h:82
std::set< int, std::less< int > > TokenIdxSet
Definition: token.h:16
#define wxTAB_TRAVERSAL
wxSizerItem * Add(wxWindow *window, const wxSizerFlags &flags)
static const long ID_STATICTEXT16
Definition: ccdebuginfo.h:60
size_t Replace(const wxString &strOld, const wxString &strNew, bool replaceAll=true)
void OnFindClick(wxCommandEvent &event)
const wxSize wxDefaultSize
size_t FindTokensInFile(const wxString &filename, TokenIdxSet &result, short int kindMask)
find tokens belong to a specified file
Definition: tokentree.cpp:298
const wxPoint wxDefaultPosition
static const long ID_STATICTEXT4
Definition: ccdebuginfo.h:54
const wxStringCharType * wx_str() const
#define wxDEFAULT_DIALOG_STYLE
static const long ID_COMBOBOX3
Definition: ccdebuginfo.h:67
static const long ID_BUTTON3
Definition: ccdebuginfo.h:70
wxString wxEmptyString
virtual wxString GetPath() const
wxString dump()
Dumps a graphical version of the tree.
#define wxCB_READONLY
static const long ID_COMBOBOX1
Definition: ccdebuginfo.h:71
cbEditor * Open(const wxString &filename, int pos=0, ProjectFile *data=nullptr)
const wxString & _(const wxString &string)
void OnGoParentClick(wxCommandEvent &event)
static const long ID_STATICTEXT20
Definition: ccdebuginfo.h:64
void OnInit(wxInitDialogEvent &event)
wxArray< int > wxArrayInt
wxString Serialize()
Loads the Tree and items from a file.
Definition: searchtree.h:525
wxEventType wxEVT_INIT_DIALOG
undefined or just "all"
Definition: token.h:76
wxString & Append(const char *psz)
A file editor.
Definition: cbeditor.h:43
bool IsEmpty() const
DLLIMPORT void PlaceWindow(wxTopLevelWindow *w, cbPlaceDialogMode mode=pdlBest, bool enforce=false)
Definition: globals.cpp:1177
static const long ID_BUTTON7
Definition: ccdebuginfo.h:74
void OnGoImplClick(wxCommandEvent &event)
TokenKind m_TokenKind
See TokenKind class.
Definition: token.h:234
#define wxLI_HORIZONTAL
static const long ID_PANEL3
Definition: ccdebuginfo.h:82
void SetSizeHints(wxWindow *window)
static const long ID_BUTTON1
Definition: ccdebuginfo.h:49
general function, not constructor nor destructor
Definition: token.h:54
size_t Add(const wxString &str, size_t copies=1)
void OnGoChildrenClick(wxCommandEvent &event)
static const long ID_NOTEBOOK1
Definition: ccdebuginfo.h:85
static const long ID_STATICTEXT6
Definition: ccdebuginfo.h:55
size_t GetCount() const
static const long ID_STATICTEXT24
Definition: ccdebuginfo.h:65
static const long ID_STATICTEXT1
Definition: ccdebuginfo.h:63
TokenFilenameMap m_FilenameMap
Map: file names -> file indices.
Definition: tokentree.h:369
#define wxRESIZE_BORDER
void OnSave(wxCommandEvent &event)
const wxString GetString(size_t n) const
Gets the key string for item n.
Definition: searchtree.cpp:556
static const long ID_BUTTON8
Definition: ccdebuginfo.h:76
static const long ID_STATICTEXT39
Definition: ccdebuginfo.h:62
wxString GetTokenKindString() const
the token kind string, e.g.
Definition: token.cpp:311
void FillAncestors()
static wxString Format(const wxString &format,...)
size_t Write(const void *buffer, size_t count)
static const long ID_BUTTON4
Definition: ccdebuginfo.h:66
void FillDescendants()
static const long ID_LISTBOX1
Definition: ccdebuginfo.h:79
DLLIMPORT int cbMessageBox(const wxString &message, const wxString &caption=wxEmptyString, int style=wxOK, wxWindow *parent=NULL, int x=-1, int y=-1)
wxMessageBox wrapper.
Definition: globals.cpp:1395
static const long ID_STATICTEXT12
Definition: ccdebuginfo.h:53
virtual size_t size() const
Definition: searchtree.h:283