Doxygen
stlsupport.cpp 文件参考
#include "stlsupport.h"
#include "entry.h"
#include "config.h"
+ stlsupport.cpp 的引用(Include)关系图:

浏览源代码.

struct  STLInfo
 A struct contained the data for an STL class 更多...
 

函数

static void addSTLMember (const std::shared_ptr< Entry > &root, const char *type, const char *name)
 
static void addSTLIterator (const std::shared_ptr< Entry > &classEntry, const QCString &name)
 
static void addSTLClass (const std::shared_ptr< Entry > &root, const STLInfo *info)
 
static void addSTLClasses (const std::shared_ptr< Entry > &root)
 
void addSTLSupport (std::shared_ptr< Entry > &root)
 Add stub entries for the most used classes in the standard template library 更多...
 

变量

static STLInfo g_stlinfo []
 

函数说明

◆ addSTLClass()

static void addSTLClass ( const std::shared_ptr< Entry > &  root,
const STLInfo info 
)
static

在文件 stlsupport.cpp165 行定义.

166 {
167  //printf("Adding STL class %s\n",info->className);
168  QCString fullName = info->className;
169  fullName.prepend("std::");
170 
171  // add fake Entry for the class
172  std::shared_ptr<Entry> classEntry = std::make_shared<Entry>();
173  classEntry->fileName = "[STL]";
174  classEntry->startLine = 1;
175  classEntry->name = fullName;
176  classEntry->section = Entry::CLASS_SEC;
177  classEntry->brief = "STL class";
178  classEntry->hidden = FALSE;
179  classEntry->artificial= TRUE;
180 
181  // add template arguments to class
182  if (info->templType1)
183  {
184  ArgumentList al;
185  Argument a;
186  a.type="typename";
187  a.name=info->templType1;
188  al.push_back(a);
189  if (info->templType2) // another template argument
190  {
191  a.type="typename";
192  a.name=info->templType2;
193  al.push_back(a);
194  }
195  classEntry->tArgLists.push_back(al);
196  }
197  // add member variables
198  if (info->templName1)
199  {
200  addSTLMember(classEntry,info->templType1,info->templName1);
201  }
202  if (info->templName2)
203  {
204  addSTLMember(classEntry,info->templType2,info->templName2);
205  }
206  if (fullName=="std::auto_ptr" ||
207  fullName=="std::smart_ptr" ||
208  fullName=="std::shared_ptr" ||
209  fullName=="std::weak_ptr" ||
210  fullName=="std::unique_ptr")
211  {
212  std::shared_ptr<Entry> memEntry = std::make_shared<Entry>();
213  memEntry->name = "operator->";
214  memEntry->args = "()";
215  memEntry->type = "T*";
216  memEntry->protection = Public;
217  memEntry->section = Entry::FUNCTION_SEC;
218  memEntry->brief = "STL member";
219  memEntry->hidden = FALSE;
220  memEntry->artificial = FALSE;
221  classEntry->moveToSubEntryAndKeep(memEntry);
222  }
223  if (info->baseClass1)
224  {
225  classEntry->extends.push_back(BaseInfo(info->baseClass1,Public,info->virtualInheritance?Virtual:Normal));
226  }
227  if (info->baseClass2)
228  {
229  classEntry->extends.push_back(BaseInfo(info->baseClass2,Public,info->virtualInheritance?Virtual:Normal));
230  }
231  if (info->iterators)
232  {
233  // add iterator class
234  addSTLIterator(classEntry,fullName+"::iterator");
235  addSTLIterator(classEntry,fullName+"::const_iterator");
236  addSTLIterator(classEntry,fullName+"::reverse_iterator");
237  addSTLIterator(classEntry,fullName+"::const_reverse_iterator");
238  }
239  root->moveToSubEntryAndKeep(classEntry);
240 }

引用了 addSTLIterator(), addSTLMember(), STLInfo::baseClass1, STLInfo::baseClass2, Entry::CLASS_SEC, STLInfo::className, FALSE, Entry::FUNCTION_SEC, STLInfo::iterators, Argument::name, Normal, QCString::prepend(), Public, ArgumentList::push_back(), STLInfo::templName1, STLInfo::templName2, STLInfo::templType1, STLInfo::templType2, TRUE, Argument::type, Virtual , 以及 STLInfo::virtualInheritance.

被这些函数引用 addSTLClasses().

◆ addSTLClasses()

static void addSTLClasses ( const std::shared_ptr< Entry > &  root)
static

在文件 stlsupport.cpp243 行定义.

244 {
245  std::shared_ptr<Entry> namespaceEntry = std::make_shared<Entry>();
246  namespaceEntry->fileName = "[STL]";
247  namespaceEntry->startLine = 1;
248  namespaceEntry->name = "std";
249  namespaceEntry->section = Entry::NAMESPACE_SEC;
250  namespaceEntry->brief = "STL namespace";
251  namespaceEntry->hidden = FALSE;
252  namespaceEntry->artificial= TRUE;
253 
254  STLInfo *info = g_stlinfo;
255  while (info->className)
256  {
257  addSTLClass(namespaceEntry,info);
258  info++;
259  }
260 
261  root->moveToSubEntryAndKeep(namespaceEntry);
262 }

引用了 addSTLClass(), STLInfo::className, FALSE, g_stlinfo, Entry::NAMESPACE_SEC , 以及 TRUE.

被这些函数引用 addSTLSupport().

◆ addSTLIterator()

static void addSTLIterator ( const std::shared_ptr< Entry > &  classEntry,
const QCString name 
)
static

在文件 stlsupport.cpp152 行定义.

153 {
154  std::shared_ptr<Entry> iteratorClassEntry = std::make_shared<Entry>();
155  iteratorClassEntry->fileName = "[STL]";
156  iteratorClassEntry->startLine = 1;
157  iteratorClassEntry->name = name;
158  iteratorClassEntry->section = Entry::CLASS_SEC;
159  iteratorClassEntry->brief = "STL iterator class";
160  iteratorClassEntry->hidden = FALSE;
161  iteratorClassEntry->artificial= TRUE;
162  classEntry->moveToSubEntryAndKeep(iteratorClassEntry);
163 }

引用了 Entry::CLASS_SEC, FALSE , 以及 TRUE.

被这些函数引用 addSTLClass().

◆ addSTLMember()

static void addSTLMember ( const std::shared_ptr< Entry > &  root,
const char *  type,
const char *  name 
)
static

在文件 stlsupport.cpp139 行定义.

140 {
141  std::shared_ptr<Entry> memEntry = std::make_shared<Entry>();
142  memEntry->name = name;
143  memEntry->type = type;
144  memEntry->protection = Public;
145  memEntry->section = Entry::VARIABLE_SEC;
146  memEntry->brief = "STL member";
147  memEntry->hidden = FALSE;
148  memEntry->artificial = TRUE;
149  root->moveToSubEntryAndKeep(memEntry);
150 }

引用了 FALSE, Public, TRUE , 以及 Entry::VARIABLE_SEC.

被这些函数引用 addSTLClass().

◆ addSTLSupport()

void addSTLSupport ( std::shared_ptr< Entry > &  root)

Add stub entries for the most used classes in the standard template library

参数
rootRoot of the entry tree to add the entries to.

在文件 stlsupport.cpp264 行定义.

265 {
266  if (Config_getBool(BUILTIN_STL_SUPPORT))
267  {
268  addSTLClasses(root);
269  }
270 }

引用了 addSTLClasses() , 以及 Config_getBool.

被这些函数引用 parseInput().

变量说明

◆ g_stlinfo

STLInfo g_stlinfo[]
static

在文件 stlsupport.cpp34 行定义.

被这些函数引用 addSTLClasses().

STLInfo::templType2
const char * templType2
Definition: stlsupport.cpp:41
ArgumentList::push_back
void push_back(const Argument &a)
Definition: arguments.h:95
Normal
@ Normal
Definition: types.h:29
STLInfo::className
const char * className
Definition: stlsupport.cpp:36
ArgumentList
This class represents an function or template argument list.
Definition: arguments.h:59
STLInfo::iterators
bool iterators
Definition: stlsupport.cpp:44
addSTLClasses
static void addSTLClasses(const std::shared_ptr< Entry > &root)
Definition: stlsupport.cpp:243
Virtual
@ Virtual
Definition: types.h:29
Public
@ Public
Definition: types.h:26
STLInfo::virtualInheritance
bool virtualInheritance
Definition: stlsupport.cpp:43
Argument::type
QCString type
Definition: arguments.h:50
Entry::NAMESPACE_SEC
@ NAMESPACE_SEC
Definition: entry.h:68
STLInfo::baseClass2
const char * baseClass2
Definition: stlsupport.cpp:38
Entry::CLASS_SEC
@ CLASS_SEC
Definition: entry.h:67
addSTLClass
static void addSTLClass(const std::shared_ptr< Entry > &root, const STLInfo *info)
Definition: stlsupport.cpp:165
Argument
This class contains the information about the argument of a function or template
Definition: arguments.h:26
addSTLMember
static void addSTLMember(const std::shared_ptr< Entry > &root, const char *type, const char *name)
Definition: stlsupport.cpp:139
TRUE
#define TRUE
Definition: qcstring.h:36
Entry::FUNCTION_SEC
@ FUNCTION_SEC
Definition: entry.h:97
STLInfo::templName1
const char * templName1
Definition: stlsupport.cpp:40
Config_getBool
#define Config_getBool(name)
Definition: config.h:33
addSTLIterator
static void addSTLIterator(const std::shared_ptr< Entry > &classEntry, const QCString &name)
Definition: stlsupport.cpp:152
Argument::name
QCString name
Definition: arguments.h:52
BaseInfo
This class stores information about an inheritance relation
Definition: entry.h:35
Entry::VARIABLE_SEC
@ VARIABLE_SEC
Definition: entry.h:96
STLInfo::templType1
const char * templType1
Definition: stlsupport.cpp:39
g_stlinfo
static STLInfo g_stlinfo[]
Definition: stlsupport.cpp:34
QCString::prepend
QCString & prepend(const char *s)
Definition: qcstring.h:339
STLInfo::baseClass1
const char * baseClass1
Definition: stlsupport.cpp:37
STLInfo
A struct contained the data for an STL class
Definition: stlsupport.cpp:21
FALSE
#define FALSE
Definition: qcstring.h:33
STLInfo::templName2
const char * templName2
Definition: stlsupport.cpp:42
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108