Doxygen
DocSection类 参考

Node representing a normal section 更多...

#include <docparser.h>

+ 类 DocSection 继承关系图:
+ DocSection 的协作图:

Public 成员函数

 DocSection (DocParser &parser, DocNode *parent, int level, const QCString &id)
 
Kind kind () const override
 
int level () const
 
QCString title () const
 
QCString anchor () const
 
QCString id () const
 
QCString file () const
 
int parse ()
 
- Public 成员函数 继承自 CompAccept< DocSection >
 CompAccept (DocParser &parser)
 
void accept (DocVisitor *v) override
 
const DocNodeListchildren () const
 
DocNodeListchildren ()
 
- Public 成员函数 继承自 DocNode
 DocNode (DocParser &parser)
 
virtual ~DocNode ()
 
DocNodeparent () const
 
void setParent (DocNode *parent)
 
bool isPreformatted () const
 

Private 属性

int m_level = 0
 
QCString m_id
 
QCString m_title
 
QCString m_anchor
 
QCString m_file
 

额外继承的成员函数

- Public 类型 继承自 DocNode
enum  Kind {
  Kind_Root = 0, Kind_Word = 1, Kind_WhiteSpace = 2, Kind_Para = 3,
  Kind_AutoList = 4, Kind_AutoListItem = 5, Kind_Symbol = 6, Kind_URL = 7,
  Kind_StyleChange = 8, Kind_SimpleSect = 9, Kind_Title = 10, Kind_SimpleList = 11,
  Kind_SimpleListItem = 12, Kind_Section = 13, Kind_Verbatim = 14, Kind_XRefItem = 15,
  Kind_HtmlList = 16, Kind_HtmlListItem = 17, Kind_HtmlDescList = 18, Kind_HtmlDescData = 19,
  Kind_HtmlDescTitle = 20, Kind_HtmlTable = 21, Kind_HtmlRow = 22, Kind_HtmlCell = 23,
  Kind_HtmlCaption = 24, Kind_LineBreak = 25, Kind_HorRuler = 26, Kind_Anchor = 27,
  Kind_IndexEntry = 28, Kind_Internal = 29, Kind_HRef = 30, Kind_Include = 31,
  Kind_IncOperator = 32, Kind_HtmlHeader = 33, Kind_Image = 34, Kind_DotFile = 35,
  Kind_Link = 36, Kind_Ref = 37, Kind_Formula = 38, Kind_SecRefItem = 39,
  Kind_SecRefList = 40, Kind_SimpleSectSep = 41, Kind_LinkedWord = 42, Kind_ParamSect = 43,
  Kind_ParamList = 44, Kind_InternalRef = 45, Kind_Copy = 46, Kind_Text = 47,
  Kind_MscFile = 48, Kind_HtmlBlockQuote = 49, Kind_VhdlFlow = 50, Kind_ParBlock = 51,
  Kind_DiaFile = 52, Kind_Emoji = 53, Kind_Sep = 54
}
 
- Protected 类型 继承自 DocNode
enum  RefType { Unknown, Anchor, Section, Table }
 
- Protected 成员函数 继承自 DocNode
void setInsidePreformatted (bool p)
 
- Protected 属性 继承自 CompAccept< DocSection >
DocNodeList m_children
 
- Protected 属性 继承自 DocNode
DocNodem_parent = 0
 
DocParserm_parser
 

详细描述

Node representing a normal section

在文件 docparser.h1001 行定义.

构造及析构函数说明

◆ DocSection()

DocSection::DocSection ( DocParser parser,
DocNode parent,
int  level,
const QCString id 
)
inline

在文件 docparser.h1004 行定义.

1004  :
1005  CompAccept<DocSection>(parser), m_level(level), m_id(id) { m_parent = parent; }

引用了 DocNode::m_parent , 以及 DocNode::parent().

被这些函数引用 parse().

成员函数说明

◆ anchor()

QCString DocSection::anchor ( ) const
inline

◆ file()

QCString DocSection::file ( ) const
inline

在文件 docparser.h1011 行定义.

1011 { return m_file; }

引用了 m_file.

被这些函数引用 DocbookDocVisitor::visitPre(), LatexDocVisitor::visitPre(), RTFDocVisitor::visitPre() , 以及 XmlDocVisitor::visitPre().

◆ id()

QCString DocSection::id ( ) const
inline

在文件 docparser.h1010 行定义.

1010 { return m_id; }

引用了 m_id.

◆ kind()

Kind DocSection::kind ( ) const
inlineoverridevirtual

Returns the kind of node. Provides runtime type information

实现了 DocNode.

在文件 docparser.h1006 行定义.

1006 { return Kind_Section; }

引用了 DocNode::Kind_Section.

◆ level()

◆ parse()

int DocSection::parse ( )

在文件 docparser.cpp6904 行定义.

6905 {
6906  DBG(("DocSection::parse() start %s level=%d\n",qPrint(m_parser.context.token->sectionId),m_level));
6907  int retval=RetVal_OK;
6908  auto ns = AutoNodeStack(m_parser,this);
6909 
6910  if (!m_id.isEmpty())
6911  {
6913  if (sec)
6914  {
6915  m_file = sec->fileName();
6916  m_anchor = sec->label();
6917  m_title = sec->title();
6918  if (m_title.isEmpty()) m_title = sec->label();
6919  }
6920  }
6921 
6922  // first parse any number of paragraphs
6923  bool isFirst=TRUE;
6924  DocPara *lastPar=0;
6925  do
6926  {
6927  DocPara *par = new DocPara(m_parser,this);
6928  if (isFirst) { par->markFirst(); isFirst=FALSE; }
6929  retval=par->parse();
6930  if (!par->isEmpty())
6931  {
6932  m_children.push_back(std::unique_ptr<DocPara>(par));
6933  lastPar=par;
6934  }
6935  else
6936  {
6937  delete par;
6938  }
6939  if (retval==TK_LISTITEM)
6940  {
6941  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"Invalid list item found");
6942  }
6943  if (retval==RetVal_Internal)
6944  {
6945  DocInternal *in = new DocInternal(m_parser,this);
6946  m_children.push_back(std::unique_ptr<DocInternal>(in));
6947  retval = in->parse(m_level+1);
6948  if (retval==RetVal_EndInternal)
6949  {
6950  retval=RetVal_OK;
6951  }
6952  }
6953  } while (retval!=0 &&
6954  retval!=RetVal_Section &&
6955  retval!=RetVal_Subsection &&
6956  retval!=RetVal_Subsubsection &&
6957  retval!=RetVal_Paragraph &&
6958  retval!=RetVal_EndInternal
6959  );
6960 
6961  if (lastPar) lastPar->markLast();
6962 
6963  //printf("m_level=%d <-> %d\n",m_level,Doxygen::subpageNestingLevel);
6964 
6965  while (true)
6966  {
6968  {
6969  // then parse any number of nested sections
6970  while (retval==RetVal_Subsection) // more sections follow
6971  {
6972  DocSection *s=new DocSection(m_parser,this,
6974  m_children.push_back(std::unique_ptr<DocSection>(s));
6975  retval = s->parse();
6976  }
6977  break;
6978  }
6980  {
6982  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"Unexpected subsubsection command found inside %s!",g_sectionLevelToName[m_level]);
6983  // then parse any number of nested sections
6984  while (retval==RetVal_Subsubsection) // more sections follow
6985  {
6986  DocSection *s=new DocSection(m_parser,this,
6988  m_children.push_back(std::unique_ptr<DocSection>(s));
6989  retval = s->parse();
6990  }
6991  if (!(m_level<Doxygen::subpageNestingLevel+2 && retval == RetVal_Subsection)) break;
6992  }
6993  else if (retval==RetVal_Paragraph && m_level<=std::min(5,Doxygen::subpageNestingLevel+3))
6994  {
6996  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"Unexpected paragraph command found inside %s!",g_sectionLevelToName[m_level]);
6997  // then parse any number of nested sections
6998  while (retval==RetVal_Paragraph) // more sections follow
6999  {
7000  DocSection *s=new DocSection(m_parser,this,
7002  m_children.push_back(std::unique_ptr<DocSection>(s));
7003  retval = s->parse();
7004  }
7005  if (!(m_level<Doxygen::subpageNestingLevel+3 && (retval == RetVal_Subsection || retval == RetVal_Subsubsection))) break;
7006  }
7007  else
7008  {
7009  break;
7010  }
7011  }
7012 
7013  INTERNAL_ASSERT(retval==0 ||
7014  retval==RetVal_Section ||
7015  retval==RetVal_Subsection ||
7016  retval==RetVal_Subsubsection ||
7017  retval==RetVal_Paragraph ||
7018  retval==RetVal_Internal ||
7019  retval==RetVal_EndInternal
7020  );
7021 
7022  DBG(("DocSection::parse() end: retval=%s\n",DocTokenizer::retvalToString(retval)));
7023  return retval;
7024 }

引用了 DocParser::context, DBG, DocSection(), FALSE, SectionInfo::fileName(), DocParserContext::fileName, LinkedMap< T, Hash, KeyEqual, Map >::find(), g_sectionLevelToName, DocTokenizer::getLineNr(), SectionManager::instance(), INTERNAL_ASSERT, QCString::isEmpty(), DocPara::isEmpty(), SectionInfo::label(), m_anchor, CompAccept< DocSection >::m_children, m_file, m_id, m_level, DocNode::m_parser, m_title, DocPara::markFirst(), DocPara::markLast(), parse(), DocInternal::parse(), DocPara::parse(), qPrint(), RetVal_EndInternal, RetVal_Internal, RetVal_OK, RetVal_Paragraph, RetVal_Section, RetVal_Subsection, RetVal_Subsubsection, DocTokenizer::retvalToString(), TokenInfo::sectionId, QCString::startsWith(), Doxygen::subpageNestingLevel, SectionInfo::title(), TK_LISTITEM, DocParserContext::token, DocParser::tokenizer, TRUE , 以及 warn_doc_error().

被这些函数引用 parse(), DocInternal::parse() , 以及 DocRoot::parse().

◆ title()

类成员变量说明

◆ m_anchor

QCString DocSection::m_anchor
private

在文件 docparser.h1018 行定义.

被这些函数引用 anchor() , 以及 parse().

◆ m_file

QCString DocSection::m_file
private

在文件 docparser.h1019 行定义.

被这些函数引用 file() , 以及 parse().

◆ m_id

QCString DocSection::m_id
private

在文件 docparser.h1016 行定义.

被这些函数引用 id() , 以及 parse().

◆ m_level

int DocSection::m_level = 0
private

在文件 docparser.h1015 行定义.

被这些函数引用 level() , 以及 parse().

◆ m_title

QCString DocSection::m_title
private

在文件 docparser.h1017 行定义.

被这些函数引用 parse() , 以及 title().


该类的文档由以下文件生成:
RetVal_Subsubsection
@ RetVal_Subsubsection
Definition: doctokenizer.h:64
DocPara
Node representing a paragraph in the documentation tree
Definition: docparser.h:1178
DocParserContext::token
TokenInfo * token
Definition: docparser.cpp:129
DocParser::context
DocParserContext context
Definition: docparser.cpp:175
CompAccept< DocSection >
DocSection::DocSection
DocSection(DocParser &parser, DocNode *parent, int level, const QCString &id)
Definition: docparser.h:1004
RetVal_OK
@ RetVal_OK
Command starting with \
Definition: doctokenizer.h:59
DocPara::markFirst
void markFirst(bool v=TRUE)
Definition: docparser.h:1186
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
RetVal_Subsection
@ RetVal_Subsection
Definition: doctokenizer.h:63
DocParser::tokenizer
DocTokenizer tokenizer
Definition: docparser.cpp:176
warn_doc_error
void warn_doc_error(const QCString &file, int line, const char *fmt,...)
Definition: message.cpp:186
DocNode::Kind_Section
@ Kind_Section
Definition: docparser.h:113
g_sectionLevelToName
static const char * g_sectionLevelToName[]
Definition: docparser.cpp:72
DocSection::m_title
QCString m_title
Definition: docparser.h:1017
DocSection::m_anchor
QCString m_anchor
Definition: docparser.h:1018
SectionInfo::label
QCString label() const
Definition: section.h:65
TK_LISTITEM
@ TK_LISTITEM
Definition: doctokenizer.h:49
DocParserContext::fileName
QCString fileName
Definition: docparser.cpp:110
DocSection::level
int level() const
Definition: docparser.h:1007
Doxygen::subpageNestingLevel
static int subpageNestingLevel
Definition: doxygen.h:115
DocPara::isEmpty
bool isEmpty() const
Definition: docparser.h:1185
DocTokenizer::retvalToString
static const char * retvalToString(int retval)
DocNode::m_parser
DocParser & m_parser
Definition: docparser.h:184
RetVal_Internal
@ RetVal_Internal
Definition: doctokenizer.h:76
DocInternal::parse
int parse(int)
Definition: docparser.cpp:3043
DocTokenizer::getLineNr
int getLineNr(void)
SectionInfo::fileName
QCString fileName() const
Definition: section.h:70
TRUE
#define TRUE
Definition: qcstring.h:36
LinkedMap::find
const T * find(const std::string &key) const
Find an object given the key.
Definition: linkedmap.h:60
RetVal_EndInternal
@ RetVal_EndInternal
Definition: doctokenizer.h:81
SectionInfo::title
QCString title() const
Definition: section.h:66
DocSection
Node representing a normal section
Definition: docparser.h:1001
DocPara::markLast
void markLast(bool v=TRUE)
Definition: docparser.h:1187
DocPara::parse
int parse()
Definition: docparser.cpp:6579
DocInternal
Node representing an internal section of documentation
Definition: docparser.h:1059
SectionManager::instance
static SectionManager & instance()
returns a reference to the singleton
Definition: section.h:172
DocSection::m_file
QCString m_file
Definition: docparser.h:1019
QCString::startsWith
bool startsWith(const char *s) const
Definition: qcstring.h:408
RetVal_Section
@ RetVal_Section
Definition: doctokenizer.h:62
DocSection::m_id
QCString m_id
Definition: docparser.h:1016
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
INTERNAL_ASSERT
#define INTERNAL_ASSERT(x)
Definition: docparser.cpp:67
RetVal_Paragraph
@ RetVal_Paragraph
Definition: doctokenizer.h:65
SectionInfo
class that provide information about a section.
Definition: section.h:49
TokenInfo::sectionId
QCString sectionId
Definition: doctokenizer.h:86
AutoNodeStack
Definition: docparser.cpp:186
DocNode::parent
DocNode * parent() const
Definition: docparser.h:166
DBG
#define DBG(x)
Definition: docparser.cpp:58
CompAccept< DocSection >::m_children
DocNodeList m_children
Definition: docparser.h:211
DocSection::m_level
int m_level
Definition: docparser.h:1015
DocNode::m_parent
DocNode * m_parent
Definition: docparser.h:182
DocSection::parse
int parse()
Definition: docparser.cpp:6904
FALSE
#define FALSE
Definition: qcstring.h:33