Doxygen
DocGroup类 参考

#include <docgroup.h>

+ DocGroup 的协作图:

Public 成员函数

 DocGroup ()
 
void enterFile (const QCString &fileName, int)
 
void leaveFile (const QCString &fileName, int line)
 
void enterCompound (const QCString &fileName, int line, const QCString &name)
 
void leaveCompound (const QCString &, int, const QCString &)
 
void open (Entry *e, const QCString &, int, bool implicit=false)
 
void close (Entry *e, const QCString &fileName, int line, bool foundInline, bool implicit=false)
 
void initGroupInfo (Entry *e)
 
bool isEmpty () const
 
void clearHeader ()
 
void appendHeader (const char)
 
void addDocs (Entry *e)
 

Private 成员函数

int findExistingGroup (const MemberGroupInfo *info)
 

Private 属性

int m_openCount = 0
 
QCString m_memberGroupHeader
 
int m_memberGroupId = 0
 
QCString m_memberGroupRelates
 
QCString m_memberGroupDocs
 
std::vector< Groupingm_autoGroupStack
 
QCString m_compoundName
 

详细描述

在文件 docgroup.h24 行定义.

构造及析构函数说明

◆ DocGroup()

DocGroup::DocGroup ( )
inline

在文件 docgroup.h27 行定义.

27 {};

成员函数说明

◆ addDocs()

void DocGroup::addDocs ( Entry e)

在文件 docgroup.cpp193 行定义.

194 {
196  {
199  if (!m_memberGroupDocs.isEmpty() && !e->doc.isEmpty())
200  {
201  m_memberGroupDocs+="\n\n";
202  }
206  {
207  auto &info = it->second;
208  info->doc = m_memberGroupDocs;
209  info->docFile = e->docFile;
210  info->docLine = e->docLine;
211  info->setRefItems(e->sli);
212  }
213  e->doc.resize(0);
214  e->brief.resize(0);
215  }
216 }

引用了 Entry::brief, Entry::doc, Entry::docFile, Entry::docLine, end(), QCString::isEmpty(), m_memberGroupDocs, m_memberGroupId, Doxygen::memberGroupInfoMap, Entry::MEMBERGRP_SEC, QCString::resize(), Entry::section, Entry::sli, stripLeadingAndTrailingEmptyLines() , 以及 QCString::stripWhiteSpace().

◆ appendHeader()

void DocGroup::appendHeader ( const char  text)

在文件 docgroup.cpp228 行定义.

229 {
230  m_memberGroupHeader += text;
231 }

引用了 m_memberGroupHeader.

◆ clearHeader()

void DocGroup::clearHeader ( )

在文件 docgroup.cpp223 行定义.

224 {
226 }

引用了 m_memberGroupHeader , 以及 QCString::resize().

◆ close()

void DocGroup::close ( Entry e,
const QCString fileName,
int  line,
bool  foundInline,
bool  implicit = false 
)

在文件 docgroup.cpp136 行定义.

137 {
138  if (!implicit)
139  {
140  if (m_openCount < 1)
141  {
142  warn(fileName,line,"unbalanced grouping commands");
143  }
144  else
145  {
146  m_openCount--;
147  }
148  }
149  //printf("==> closeGroup(name=%s,sec=%x,file=%s,line=%d) m_autoGroupStack=%d\n",
150  // qPrint(e->name),e->section,fileName,line,m_autoGroupStack.size());
151  if (m_memberGroupId!=DOX_NOGROUP) // end of member group
152  {
154  if (it!=Doxygen::memberGroupInfoMap.end()) // known group
155  {
156  auto &info = it->second;
157  info->doc = m_memberGroupDocs;
158  info->docFile = fileName;
159  info->docLine = line;
160  }
164  if (!foundInline) e->mGrpId=DOX_NOGROUP;
165  //printf("new group id=%d\n",m_memberGroupId);
166  }
167  else if (!m_autoGroupStack.empty()) // end of auto group
168  {
169  Grouping grp = m_autoGroupStack.back();
170  m_autoGroupStack.pop_back();
171  // see bug577005: we should not remove the last group for e
172  if (!foundInline && !e->groups.empty()) e->groups.pop_back();
173  //printf("Removing %s e=%p\n",qPrint(grp->groupname),e);
174  if (!foundInline) initGroupInfo(e);
175  }
176 }

引用了 DOX_NOGROUP, end(), Entry::groups, initGroupInfo(), m_autoGroupStack, m_memberGroupDocs, m_memberGroupId, m_memberGroupRelates, m_openCount, Doxygen::memberGroupInfoMap, Entry::mGrpId, QCString::resize() , 以及 warn().

◆ enterCompound()

void DocGroup::enterCompound ( const QCString fileName,
int  line,
const QCString name 
)

在文件 docgroup.cpp54 行定义.

55 {
57  {
58  warn(fileName,line,"try to put compound %s inside a member group\n",qPrint(name));
59  }
63  m_compoundName = name;
64  int i = m_compoundName.find('(');
65  if (i!=-1)
66  {
67  m_compoundName=m_compoundName.left(i); // strip category (Obj-C)
68  }
69  if (m_compoundName.isEmpty())
70  {
71  m_compoundName=fileName;
72  }
73  //printf("groupEnterCompound(%s)\n",name);
74 }

引用了 DOX_NOGROUP, QCString::find(), QCString::isEmpty(), QCString::left(), m_compoundName, m_memberGroupDocs, m_memberGroupId, m_memberGroupRelates, qPrint(), QCString::resize() , 以及 warn().

◆ enterFile()

void DocGroup::enterFile ( const QCString fileName,
int   
)

◆ findExistingGroup()

int DocGroup::findExistingGroup ( const MemberGroupInfo info)
private

在文件 docgroup.cpp89 行定义.

90 {
91  //printf("findExistingGroup %s:%s\n",qPrint(info->header),qPrint(info->compoundName));
92  for (const auto &kv : Doxygen::memberGroupInfoMap)
93  {
94  if (m_compoundName==kv.second->compoundName && // same file or scope
95  !kv.second->header.isEmpty() && // not a nameless group
96  qstricmp(kv.second->header,info->header)==0 // same header name
97  )
98  {
99  //printf("Found it!\n");
100  return kv.first; // put the item in this group
101  }
102  }
103  return ++g_groupId; // start new group
104 }

引用了 g_groupId, MemberGroupInfo::header, QCString::isEmpty(), m_compoundName, Doxygen::memberGroupInfoMap , 以及 qstricmp().

被这些函数引用 open().

◆ initGroupInfo()

void DocGroup::initGroupInfo ( Entry e)

在文件 docgroup.cpp178 行定义.

179 {
180  //printf("==> initGroup(id=%d,related=%s,e=%p)\n",m_memberGroupId,
181  // qPrint(m_memberGroupRelates),e);
182  e->mGrpId = m_memberGroupId;
184  if (!m_autoGroupStack.empty())
185  {
186  //printf("Appending group %s to %s: count=%d entry=%p\n",
187  // qPrint(m_autoGroupStack.top()->groupname),
188  // qPrint(e->name),e->groups->count(),e);
189  e->groups.push_back(Grouping(m_autoGroupStack.back()));
190  }
191 }

引用了 Entry::groups, m_autoGroupStack, m_memberGroupId, m_memberGroupRelates, Entry::mGrpId , 以及 Entry::relates.

被这些函数引用 close().

◆ isEmpty()

bool DocGroup::isEmpty ( ) const

在文件 docgroup.cpp218 行定义.

219 {
220  return (m_memberGroupId==DOX_NOGROUP);
221 }

引用了 DOX_NOGROUP , 以及 m_memberGroupId.

◆ leaveCompound()

void DocGroup::leaveCompound ( const QCString ,
int  ,
const QCString  
)

在文件 docgroup.cpp76 行定义.

77 {
78  //printf("groupLeaveCompound(%s)\n",name);
79  //if (m_memberGroupId!=DOX_NOGROUP)
80  //{
81  // warn(fileName,line,"end of compound %s while inside a member group\n",qPrint(name));
82  //}
87 }

引用了 DOX_NOGROUP, m_compoundName, m_memberGroupDocs, m_memberGroupId, m_memberGroupRelates , 以及 QCString::resize().

◆ leaveFile()

void DocGroup::leaveFile ( const QCString fileName,
int  line 
)

在文件 docgroup.cpp35 行定义.

36 {
37  //if (m_memberGroupId!=DOX_NOGROUP)
38  //{
39  // warn(fileName,line,"end of file while inside a member group\n");
40  //}
44  if (!m_autoGroupStack.empty())
45  {
46  warn(fileName,line,"end of file while inside a group");
47  }
48  else if (m_openCount > 0) // < 0 is already handled on close call
49  {
50  warn(fileName,line,"end of file with unbalanced grouping commands");
51  }
52 }

引用了 DOX_NOGROUP, m_autoGroupStack, m_memberGroupDocs, m_memberGroupId, m_memberGroupRelates, m_openCount, QCString::resize() , 以及 warn().

◆ open()

void DocGroup::open ( Entry e,
const QCString ,
int  ,
bool  implicit = false 
)

在文件 docgroup.cpp106 行定义.

107 {
108  if (!implicit) m_openCount++;
109  //printf("==> openGroup(name=%s,sec=%x) m_autoGroupStack=%d\n",
110  // qPrint(e->name),e->section,m_autoGroupStack.size());
111  if (e->section==Entry::GROUPDOC_SEC) // auto group
112  {
113  m_autoGroupStack.push_back(Grouping(e->name,e->groupingPri()));
114  }
115  else // start of a member group
116  {
117  //printf(" membergroup id=%d %s\n",m_memberGroupId,qPrint(m_memberGroupHeader));
118  if (m_memberGroupId==DOX_NOGROUP) // no group started yet
119  {
120  auto info = std::make_unique<MemberGroupInfo>();
121  info->header = m_memberGroupHeader.stripWhiteSpace();
122  info->compoundName = m_compoundName;
123  m_memberGroupId = findExistingGroup(info.get());
126  {
127  //printf(" use membergroup %d\n",m_memberGroupId);
128  Doxygen::memberGroupInfoMap.insert(std::make_pair(m_memberGroupId,std::move(info)));
129  }
131  e->mGrpId = m_memberGroupId;
132  }
133  }
134 }

引用了 DOX_NOGROUP, end(), findExistingGroup(), Entry::GROUPDOC_SEC, Entry::groupingPri(), m_autoGroupStack, m_compoundName, m_memberGroupHeader, m_memberGroupId, m_memberGroupRelates, m_openCount, Doxygen::memberGroupInfoMap, Entry::mGrpId, Entry::name, Entry::relates, Entry::section , 以及 QCString::stripWhiteSpace().

类成员变量说明

◆ m_autoGroupStack

std::vector<Grouping> DocGroup::m_autoGroupStack
private

在文件 docgroup.h49 行定义.

被这些函数引用 close(), enterFile(), initGroupInfo(), leaveFile() , 以及 open().

◆ m_compoundName

QCString DocGroup::m_compoundName
private

在文件 docgroup.h50 行定义.

被这些函数引用 enterCompound(), enterFile(), findExistingGroup(), leaveCompound() , 以及 open().

◆ m_memberGroupDocs

QCString DocGroup::m_memberGroupDocs
private

在文件 docgroup.h48 行定义.

被这些函数引用 addDocs(), close(), enterCompound(), enterFile(), leaveCompound() , 以及 leaveFile().

◆ m_memberGroupHeader

QCString DocGroup::m_memberGroupHeader
private

在文件 docgroup.h45 行定义.

被这些函数引用 appendHeader(), clearHeader() , 以及 open().

◆ m_memberGroupId

int DocGroup::m_memberGroupId = 0
private

在文件 docgroup.h46 行定义.

被这些函数引用 addDocs(), close(), enterCompound(), enterFile(), initGroupInfo(), isEmpty(), leaveCompound(), leaveFile() , 以及 open().

◆ m_memberGroupRelates

QCString DocGroup::m_memberGroupRelates
private

在文件 docgroup.h47 行定义.

被这些函数引用 close(), enterCompound(), enterFile(), initGroupInfo(), leaveCompound(), leaveFile() , 以及 open().

◆ m_openCount

int DocGroup::m_openCount = 0
private

在文件 docgroup.h44 行定义.

被这些函数引用 close(), enterFile(), leaveFile() , 以及 open().


该类的文档由以下文件生成:
DocGroup::m_memberGroupRelates
QCString m_memberGroupRelates
Definition: docgroup.h:47
Entry::groupingPri
Grouping::GroupPri_t groupingPri() const
Definition: entry.h:314
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
Entry::name
QCString name
member name
Definition: entry.h:240
Grouping
Grouping info
Definition: types.h:64
Entry::mGrpId
int mGrpId
member group id
Definition: entry.h:286
DocGroup::m_compoundName
QCString m_compoundName
Definition: docgroup.h:50
Entry::docLine
int docLine
line number at which the documentation was found
Definition: entry.h:268
QCString::find
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:38
DocGroup::m_memberGroupDocs
QCString m_memberGroupDocs
Definition: docgroup.h:48
warn
void warn(const QCString &file, int line, const char *fmt,...)
Definition: message.cpp:151
Entry::relates
QCString relates
related class (doc block)
Definition: entry.h:276
Entry::doc
QCString doc
documentation block (partly parsed)
Definition: entry.h:267
end
DirIterator end(const DirIterator &) noexcept
Definition: dir.cpp:128
DocGroup::m_memberGroupHeader
QCString m_memberGroupHeader
Definition: docgroup.h:45
QCString::stripWhiteSpace
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition: qcstring.h:243
QCString::left
QCString left(size_t len) const
Definition: qcstring.h:212
g_groupId
static std::atomic_int g_groupId
Definition: docgroup.cpp:23
Entry::section
int section
entry type (see Sections);
Definition: entry.h:238
qstricmp
int qstricmp(const char *str1, const char *str2)
Definition: qcstring.cpp:433
Doxygen::memberGroupInfoMap
static MemberGroupInfoMap memberGroupInfoMap
Definition: doxygen.h:100
DocGroup::initGroupInfo
void initGroupInfo(Entry *e)
Definition: docgroup.cpp:178
Entry::GROUPDOC_SEC
@ GROUPDOC_SEC
Definition: entry.h:107
MemberGroupInfo::header
QCString header
Definition: membergroup.h:117
Entry::brief
QCString brief
brief description (doc block)
Definition: entry.h:270
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
stripLeadingAndTrailingEmptyLines
QCString stripLeadingAndTrailingEmptyLines(const QCString &s, int &docLine)
Special version of QCString::stripWhiteSpace() that only strips completely blank lines.
Definition: util.cpp:5394
DOX_NOGROUP
#define DOX_NOGROUP
Definition: membergroup.h:26
DocGroup::m_memberGroupId
int m_memberGroupId
Definition: docgroup.h:46
Entry::sli
RefItemVector sli
special lists (test/todo/bug/deprecated/..) this entry is in
Definition: entry.h:293
DocGroup::m_openCount
int m_openCount
Definition: docgroup.h:44
DocGroup::findExistingGroup
int findExistingGroup(const MemberGroupInfo *info)
Definition: docgroup.cpp:89
Entry::docFile
QCString docFile
file in which the documentation was found
Definition: entry.h:269
Entry::groups
std::vector< Grouping > groups
list of groups this entry belongs to
Definition: entry.h:288
DocGroup::m_autoGroupStack
std::vector< Grouping > m_autoGroupStack
Definition: docgroup.h:49
Entry::MEMBERGRP_SEC
@ MEMBERGRP_SEC
Definition: entry.h:110
QCString::resize
bool resize(size_t newlen)
Resizes the string to hold newlen characters (this value should also count the 0-terminator).
Definition: qcstring.h:164