Doxygen
DocRoot类 参考

Root node of documentation tree 更多...

#include <docparser.h>

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

Public 成员函数

 DocRoot (DocParser &parser, bool indent, bool sl)
 
Kind kind () const override
 
void parse ()
 
bool indent () const
 
bool singleLine () const
 
bool isEmpty () const
 
- Public 成员函数 继承自 CompAccept< DocRoot >
 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 属性

bool m_indent = false
 
bool m_singleLine = false
 

额外继承的成员函数

- 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< DocRoot >
DocNodeList m_children
 
- Protected 属性 继承自 DocNode
DocNodem_parent = 0
 
DocParserm_parser
 

详细描述

Root node of documentation tree

在文件 docparser.h1457 行定义.

构造及析构函数说明

◆ DocRoot()

DocRoot::DocRoot ( DocParser parser,
bool  indent,
bool  sl 
)
inline

在文件 docparser.h1460 行定义.

1460 : CompAccept<DocRoot>(parser), m_indent(indent), m_singleLine(sl) {}

成员函数说明

◆ indent()

bool DocRoot::indent ( ) const
inline

在文件 docparser.h1463 行定义.

1463 { return m_indent; }

引用了 m_indent.

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

◆ isEmpty()

bool DocRoot::isEmpty ( ) const
inline

在文件 docparser.h1465 行定义.

1465 { return m_children.empty(); }

引用了 CompAccept< DocRoot >::m_children.

◆ kind()

Kind DocRoot::kind ( ) const
inlineoverridevirtual

Returns the kind of node. Provides runtime type information

实现了 DocNode.

在文件 docparser.h1461 行定义.

1461 { return Kind_Root; }

引用了 DocNode::Kind_Root.

◆ parse()

void DocRoot::parse ( )

在文件 docparser.cpp7136 行定义.

7137 {
7138  DBG(("DocRoot::parse() start\n"));
7139  auto ns = AutoNodeStack(m_parser,this);
7141  int retval=0;
7142 
7143  // first parse any number of paragraphs
7144  bool isFirst=TRUE;
7145  DocPara *lastPar=0;
7146  do
7147  {
7148  DocPara *par = new DocPara(m_parser,this);
7149  if (isFirst) { par->markFirst(); isFirst=FALSE; }
7150  retval=par->parse();
7151  if (!par->isEmpty() || !par->attribs().empty())
7152  {
7153  m_children.push_back(std::unique_ptr<DocPara>(par));
7154  lastPar=par;
7155  }
7156  else
7157  {
7158  delete par;
7159  }
7160  if (retval==RetVal_Paragraph)
7161  {
7162  if (!m_parser.context.token->sectionId.startsWith("autotoc_md"))
7163  {
7164  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"found paragraph command (id: '%s') outside of subsubsection context!",qPrint(m_parser.context.token->sectionId));
7165  }
7166  while (retval==RetVal_Paragraph)
7167  {
7169  {
7171  if (sec)
7172  {
7173  DocSection *s=new DocSection(m_parser,this,
7175  m_children.push_back(std::unique_ptr<DocSection>(s));
7176  retval = s->parse();
7177  }
7178  else
7179  {
7180  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"Invalid paragraph id '%s'; ignoring paragraph",qPrint(m_parser.context.token->sectionId));
7181  retval = 0;
7182  }
7183  }
7184  else
7185  {
7186  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"Missing id for paragraph; ignoring paragraph");
7187  retval = 0;
7188  }
7189  }
7190  }
7191  if (retval==RetVal_Subsubsection)
7192  {
7193  if (!(m_parser.context.token->sectionId.startsWith("autotoc_md")))
7194  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"found subsubsection command (id: '%s') outside of subsection context!",qPrint(m_parser.context.token->sectionId));
7195  while (retval==RetVal_Subsubsection)
7196  {
7198  {
7200  if (sec)
7201  {
7202  DocSection *s=new DocSection(m_parser,this,
7204  m_children.push_back(std::unique_ptr<DocSection>(s));
7205  retval = s->parse();
7206  }
7207  else
7208  {
7209  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"Invalid subsubsection id '%s'; ignoring subsubsection",qPrint(m_parser.context.token->sectionId));
7210  retval = 0;
7211  }
7212  }
7213  else
7214  {
7215  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"Missing id for subsubsection; ignoring subsubsection");
7216  retval = 0;
7217  }
7218  }
7219  }
7220  if (retval==RetVal_Subsection)
7221  {
7222  if (!m_parser.context.token->sectionId.startsWith("autotoc_md"))
7223  {
7224  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"found subsection command (id: '%s') outside of section context!",qPrint(m_parser.context.token->sectionId));
7225  }
7226  while (retval==RetVal_Subsection)
7227  {
7229  {
7231  if (sec)
7232  {
7233  DocSection *s=new DocSection(m_parser,this,
7235  m_children.push_back(std::unique_ptr<DocSection>(s));
7236  retval = s->parse();
7237  }
7238  else
7239  {
7240  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"Invalid subsection id '%s'; ignoring subsection",qPrint(m_parser.context.token->sectionId));
7241  retval = 0;
7242  }
7243  }
7244  else
7245  {
7246  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"Missing id for subsection; ignoring subsection");
7247  retval = 0;
7248  }
7249  }
7250  }
7251  if (retval==TK_LISTITEM)
7252  {
7253  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"Invalid list item found");
7254  }
7255  if (retval==RetVal_Internal)
7256  {
7257  DocInternal *in = new DocInternal(m_parser,this);
7258  m_children.push_back(std::unique_ptr<DocInternal>(in));
7259  retval = in->parse(1);
7260  }
7261  } while (retval!=0 && retval!=RetVal_Section);
7262  if (lastPar) lastPar->markLast();
7263 
7264  //printf("DocRoot::parse() retval=%d %d\n",retval,RetVal_Section);
7265  // then parse any number of level1 sections
7266  while (retval==RetVal_Section)
7267  {
7269  {
7271  if (sec)
7272  {
7273  DocSection *s=new DocSection(m_parser,this,
7275  m_children.push_back(std::unique_ptr<DocSection>(s));
7276  retval = s->parse();
7277  }
7278  else
7279  {
7280  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"Invalid section id '%s'; ignoring section",qPrint(m_parser.context.token->sectionId));
7281  retval = 0;
7282  }
7283  }
7284  else
7285  {
7286  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"Missing id for section; ignoring section");
7287  retval = 0;
7288  }
7289  }
7290 
7292 
7293  DBG(("DocRoot::parse() end\n"));
7294 }

引用了 DocPara::attribs(), DocParser::context, DBG, FALSE, DocParserContext::fileName, LinkedMap< T, Hash, KeyEqual, Map >::find(), DocTokenizer::getLineNr(), DocParser::handleUnclosedStyleCommands(), SectionManager::instance(), QCString::isEmpty(), DocPara::isEmpty(), CompAccept< DocRoot >::m_children, DocNode::m_parser, DocPara::markFirst(), DocPara::markLast(), DocSection::parse(), DocInternal::parse(), DocPara::parse(), qPrint(), RetVal_Internal, RetVal_Paragraph, RetVal_Section, RetVal_Subsection, RetVal_Subsubsection, TokenInfo::sectionId, DocTokenizer::setStatePara(), QCString::startsWith(), Doxygen::subpageNestingLevel, TK_LISTITEM, DocParserContext::token, DocParser::tokenizer, TRUE , 以及 warn_doc_error().

被这些函数引用 validatingParseDoc().

◆ singleLine()

bool DocRoot::singleLine ( ) const
inline

在文件 docparser.h1464 行定义.

1464 { return m_singleLine; }

引用了 m_singleLine.

被这些函数引用 RTFDocVisitor::visitPost().

类成员变量说明

◆ m_indent

bool DocRoot::m_indent = false
private

在文件 docparser.h1468 行定义.

被这些函数引用 indent().

◆ m_singleLine

bool DocRoot::m_singleLine = false
private

在文件 docparser.h1469 行定义.

被这些函数引用 singleLine().


该类的文档由以下文件生成:
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< DocRoot >
DocPara::attribs
const HtmlAttribList & attribs() const
Definition: docparser.h:1215
DocRoot::m_singleLine
bool m_singleLine
Definition: docparser.h:1469
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
DocNode::Kind_Root
@ Kind_Root
Definition: docparser.h:100
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
TK_LISTITEM
@ TK_LISTITEM
Definition: doctokenizer.h:49
DocRoot::indent
bool indent() const
Definition: docparser.h:1463
DocParserContext::fileName
QCString fileName
Definition: docparser.cpp:110
Doxygen::subpageNestingLevel
static int subpageNestingLevel
Definition: doxygen.h:115
DocPara::isEmpty
bool isEmpty() const
Definition: docparser.h:1185
DocNode::m_parser
DocParser & m_parser
Definition: docparser.h:184
RetVal_Internal
@ RetVal_Internal
Definition: doctokenizer.h:76
DocParser::handleUnclosedStyleCommands
void handleUnclosedStyleCommands()
Definition: docparser.cpp:1002
DocInternal::parse
int parse(int)
Definition: docparser.cpp:3043
DocTokenizer::getLineNr
int getLineNr(void)
DocRoot::m_indent
bool m_indent
Definition: docparser.h:1468
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
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
QCString::startsWith
bool startsWith(const char *s) const
Definition: qcstring.h:408
RetVal_Section
@ RetVal_Section
Definition: doctokenizer.h:62
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
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
DocTokenizer::setStatePara
void setStatePara()
DBG
#define DBG(x)
Definition: docparser.cpp:58
CompAccept< DocRoot >::m_children
DocNodeList m_children
Definition: docparser.h:211
DocSection::parse
int parse()
Definition: docparser.cpp:6904
FALSE
#define FALSE
Definition: qcstring.h:33