Doxygen
DocSimpleSect类 参考

Node representing a simple section 更多...

#include <docparser.h>

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

Public 类型

enum  Type {
  Unknown, See, Return, Author,
  Authors, Version, Since, Date,
  Note, Warning, Copyright, Pre,
  Post, Invar, Remark, Attention,
  User, Rcs
}
 
- 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
}
 

Public 成员函数

 DocSimpleSect (DocParser &parser, DocNode *parent, Type t)
 
virtual ~DocSimpleSect ()
 
Kind kind () const override
 
Type type () const
 
QCString typeString () const
 
void accept (DocVisitor *v) override
 
int parse (bool userTitle, bool needsSeparator)
 
int parseRcs ()
 
int parseXml ()
 
void appendLinkWord (const QCString &word)
 
bool hasTitle () const
 
- Public 成员函数 继承自 CompAccept< DocSimpleSect >
 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 属性

Type m_type = Unknown
 
DocTitlem_title = 0
 

额外继承的成员函数

- Protected 类型 继承自 DocNode
enum  RefType { Unknown, Anchor, Section, Table }
 
- Protected 成员函数 继承自 DocNode
void setInsidePreformatted (bool p)
 
- Protected 属性 继承自 CompAccept< DocSimpleSect >
DocNodeList m_children
 
- Protected 属性 继承自 DocNode
DocNodem_parent = 0
 
DocParserm_parser
 

详细描述

Node representing a simple section

在文件 docparser.h1111 行定义.

成员枚举类型说明

◆ Type

枚举值
Unknown 
See 
Return 
Author 
Authors 
Version 
Since 
Date 
Note 
Warning 
Copyright 
Pre 
Post 
Invar 
Remark 
Attention 
User 
Rcs 

在文件 docparser.h1114 行定义.

1115  {
1118  };

构造及析构函数说明

◆ DocSimpleSect()

DocSimpleSect::DocSimpleSect ( DocParser parser,
DocNode parent,
Type  t 
)

在文件 docparser.cpp4371 行定义.

4371  :
4372  CompAccept<DocSimpleSect>(parser), m_type(t)
4373 {
4374  m_parent = parent;
4375  m_title=0;
4376 }

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

◆ ~DocSimpleSect()

DocSimpleSect::~DocSimpleSect ( )
virtual

在文件 docparser.cpp4378 行定义.

4379 {
4380  delete m_title;
4381 }

引用了 m_title.

成员函数说明

◆ accept()

void DocSimpleSect::accept ( DocVisitor v)
overridevirtual

Acceptor function for node visitors. Part of the visitor pattern.

参数
vAbstract visitor.

实现了 DocNode.

在文件 docparser.cpp4383 行定义.

4384 {
4385  v->visitPre(this);
4386  if (m_title) m_title->accept(v);
4387  for (const auto &n : m_children) n->accept(v);
4388  v->visitPost(this);
4389 }

引用了 CompAccept< T >::accept(), CompAccept< DocSimpleSect >::m_children, m_title, DocVisitor::visitPost() , 以及 DocVisitor::visitPre().

◆ appendLinkWord()

void DocSimpleSect::appendLinkWord ( const QCString word)

在文件 docparser.cpp4478 行定义.

4479 {
4480  DocPara *p;
4481  if (m_children.empty() || m_children.back()->kind()!=DocNode::Kind_Para)
4482  {
4483  p = new DocPara(m_parser,this);
4484  m_children.push_back(std::unique_ptr<DocPara>(p));
4485  }
4486  else
4487  {
4488  p = (DocPara *)m_children.back().get();
4489 
4490  // Comma-separate <seealso> links.
4491  p->injectToken(TK_WORD,",");
4492  p->injectToken(TK_WHITESPACE," ");
4493  }
4494 
4496  p->injectToken(TK_LNKWORD,word);
4498 }

引用了 DocParser::context, FALSE, DocPara::injectToken(), DocParserContext::inSeeBlock, DocNode::Kind_Para, CompAccept< DocSimpleSect >::m_children, DocNode::m_parser, TK_LNKWORD, TK_WHITESPACE, TK_WORD , 以及 TRUE.

被这些函数引用 DocPara::handleHtmlStartTag().

◆ hasTitle()

bool DocSimpleSect::hasTitle ( ) const
inline

在文件 docparser.h1129 行定义.

1129 { return m_title->hasTitle(); }

引用了 DocTitle::hasTitle() , 以及 m_title.

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

◆ kind()

Kind DocSimpleSect::kind ( ) const
inlineoverridevirtual

Returns the kind of node. Provides runtime type information

实现了 DocNode.

在文件 docparser.h1121 行定义.

1121 { return Kind_SimpleSect; }

引用了 DocNode::Kind_SimpleSect.

◆ parse()

int DocSimpleSect::parse ( bool  userTitle,
bool  needsSeparator 
)

在文件 docparser.cpp4391 行定义.

4392 {
4393  DBG(("DocSimpleSect::parse() start\n"));
4394  auto ns = AutoNodeStack(m_parser,this);
4395 
4396  // handle case for user defined title
4397  if (userTitle)
4398  {
4399  m_title = new DocTitle(m_parser,this);
4400  m_title->parse();
4401  }
4402 
4403  // add new paragraph as child
4404  DocPara *par = new DocPara(m_parser,this);
4405  if (m_children.empty())
4406  {
4407  par->markFirst();
4408  }
4409  else
4410  {
4411  ASSERT(m_children.back()->kind()==DocNode::Kind_Para);
4412  ((DocPara *)m_children.back().get())->markLast(FALSE);
4413  }
4414  par->markLast();
4415  if (needsSeparator) m_children.push_back(std::make_unique<DocSimpleSectSep>(m_parser,this));
4416  m_children.push_back(std::unique_ptr<DocPara>(par));
4417 
4418  // parse the contents of the paragraph
4419  int retval = par->parse();
4420 
4421  DBG(("DocSimpleSect::parse() end retval=%d\n",retval));
4422  return retval; // 0==EOF, TK_NEWPARA, TK_LISTITEM, TK_ENDLIST, RetVal_SimpleSec
4423 }

引用了 ASSERT, DBG, FALSE, DocNode::Kind_Para, CompAccept< DocSimpleSect >::m_children, DocNode::m_parser, m_title, DocPara::markFirst(), DocPara::markLast(), DocTitle::parse() , 以及 DocPara::parse().

被这些函数引用 DocPara::handleSimpleSection().

◆ parseRcs()

int DocSimpleSect::parseRcs ( )

在文件 docparser.cpp4425 行定义.

4426 {
4427  DBG(("DocSimpleSect::parseRcs() start\n"));
4428  auto ns = AutoNodeStack(m_parser,this);
4429 
4430  m_title = new DocTitle(m_parser,this);
4432 
4434  m_parser.pushContext(); // this will create a new parser.context.token
4436  m_parser.popContext(); // this will restore the old parser.context.token
4437 
4438  DBG(("DocSimpleSect::parseRcs()\n"));
4439  return RetVal_OK;
4440 }

引用了 DocParser::context, DBG, DocParser::internalValidatingParseDoc(), CompAccept< DocSimpleSect >::m_children, DocNode::m_parser, m_title, TokenInfo::name, DocTitle::parseFromString(), DocParser::popContext(), DocParser::pushContext(), RetVal_OK, TokenInfo::text , 以及 DocParserContext::token.

被这些函数引用 DocPara::parse().

◆ parseXml()

int DocSimpleSect::parseXml ( )

在文件 docparser.cpp4442 行定义.

4443 {
4444  DBG(("DocSimpleSect::parse() start\n"));
4445  auto ns = AutoNodeStack(m_parser,this);
4446 
4447  int retval = RetVal_OK;
4448  for (;;)
4449  {
4450  // add new paragraph as child
4451  DocPara *par = new DocPara(m_parser,this);
4452  if (m_children.empty())
4453  {
4454  par->markFirst();
4455  }
4456  else
4457  {
4458  ASSERT(m_children.back()->kind()==DocNode::Kind_Para);
4459  ((DocPara *)m_children.back().get())->markLast(FALSE);
4460  }
4461  par->markLast();
4462  m_children.push_back(std::unique_ptr<DocPara>(par));
4463 
4464  // parse the contents of the paragraph
4465  retval = par->parse();
4466  if (retval == 0) break;
4467  if (retval == RetVal_CloseXml)
4468  {
4469  retval = RetVal_OK;
4470  break;
4471  }
4472  }
4473 
4474  DBG(("DocSimpleSect::parseXml() end retval=%d\n",retval));
4475  return retval;
4476 }

引用了 ASSERT, DBG, FALSE, DocNode::Kind_Para, CompAccept< DocSimpleSect >::m_children, DocNode::m_parser, DocPara::markFirst(), DocPara::markLast(), DocPara::parse(), RetVal_CloseXml , 以及 RetVal_OK.

被这些函数引用 DocPara::handleSimpleSection().

◆ type()

◆ typeString()

QCString DocSimpleSect::typeString ( ) const

在文件 docparser.cpp4500 行定义.

4501 {
4502  switch (m_type)
4503  {
4504  case Unknown: break;
4505  case See: return "see";
4506  case Return: return "return";
4507  case Author: // fall through
4508  case Authors: return "author";
4509  case Version: return "version";
4510  case Since: return "since";
4511  case Date: return "date";
4512  case Note: return "note";
4513  case Warning: return "warning";
4514  case Pre: return "pre";
4515  case Post: return "post";
4516  case Copyright: return "copyright";
4517  case Invar: return "invariant";
4518  case Remark: return "remark";
4519  case Attention: return "attention";
4520  case User: return "user";
4521  case Rcs: return "rcs";
4522  }
4523  return "unknown";
4524 }

引用了 Attention, Author, Authors, Copyright, Date, Invar, m_type, Note, Post, Pre, Rcs, Remark, Return, See, Since, Unknown, User, Version , 以及 Warning.

被这些函数引用 HtmlDocVisitor::visitPre().

类成员变量说明

◆ m_title

DocTitle* DocSimpleSect::m_title = 0
private

在文件 docparser.h1133 行定义.

被这些函数引用 accept(), DocSimpleSect(), hasTitle(), parse(), parseRcs() , 以及 ~DocSimpleSect().

◆ m_type

Type DocSimpleSect::m_type = Unknown
private

在文件 docparser.h1132 行定义.

被这些函数引用 type() , 以及 typeString().


该类的文档由以下文件生成:
DocTitle
Node representing a simple section title
Definition: docparser.h:736
DocParser::popContext
void popContext()
Definition: docparser.cpp:222
DocPara
Node representing a paragraph in the documentation tree
Definition: docparser.h:1178
DocSimpleSect::Return
@ Return
Definition: docparser.h:1116
DocParserContext::token
TokenInfo * token
Definition: docparser.cpp:129
DocParser::context
DocParserContext context
Definition: docparser.cpp:175
TK_WORD
@ TK_WORD
Definition: doctokenizer.h:46
CompAccept< DocSimpleSect >
DocSimpleSect::Warning
@ Warning
Definition: docparser.h:1117
DocSimpleSect::Unknown
@ Unknown
Definition: docparser.h:1116
TokenInfo::name
QCString name
Definition: doctokenizer.h:74
RetVal_OK
@ RetVal_OK
Command starting with \
Definition: doctokenizer.h:59
RetVal_CloseXml
@ RetVal_CloseXml
Definition: doctokenizer.h:78
DocParser::internalValidatingParseDoc
int internalValidatingParseDoc(DocNode *parent, DocNodeList &children, const QCString &doc)
Definition: docparser.cpp:1742
DocPara::markFirst
void markFirst(bool v=TRUE)
Definition: docparser.h:1186
CompAccept::accept
void accept(DocVisitor *v) override
Definition: docparser.h:200
DocSimpleSect::Author
@ Author
Definition: docparser.h:1116
DocSimpleSect::Note
@ Note
Definition: docparser.h:1117
TK_WHITESPACE
@ TK_WHITESPACE
Definition: doctokenizer.h:48
DocSimpleSect::User
@ User
Definition: docparser.h:1117
DocPara::injectToken
bool injectToken(int tok, const QCString &tokText)
Definition: docparser.cpp:5286
DocParserContext::inSeeBlock
bool inSeeBlock
Definition: docparser.cpp:103
TokenInfo::text
QCString text
Definition: doctokenizer.h:77
DocSimpleSect::See
@ See
Definition: docparser.h:1116
DocSimpleSect::Rcs
@ Rcs
Definition: docparser.h:1117
DocNode::Kind_Para
@ Kind_Para
Definition: docparser.h:103
DocSimpleSect::m_title
DocTitle * m_title
Definition: docparser.h:1133
DocNode::m_parser
DocParser & m_parser
Definition: docparser.h:184
DocSimpleSect::Date
@ Date
Definition: docparser.h:1116
TRUE
#define TRUE
Definition: qcstring.h:36
DocSimpleSect::Authors
@ Authors
Definition: docparser.h:1116
DocSimpleSect::m_type
Type m_type
Definition: docparser.h:1132
TK_LNKWORD
@ TK_LNKWORD
Definition: doctokenizer.h:47
DocParser::pushContext
void pushContext()
Definition: docparser.cpp:208
DocPara::markLast
void markLast(bool v=TRUE)
Definition: docparser.h:1187
DocPara::parse
int parse()
Definition: docparser.cpp:6579
DocVisitor::visitPost
virtual void visitPost(DocAutoList *)=0
DocTitle::parse
void parse()
Definition: docparser.cpp:4346
DocSimpleSect::Copyright
@ Copyright
Definition: docparser.h:1117
DocSimpleSect::Post
@ Post
Definition: docparser.h:1117
DocSimpleSect::Pre
@ Pre
Definition: docparser.h:1117
DocSimpleSect::Remark
@ Remark
Definition: docparser.h:1117
AutoNodeStack
Definition: docparser.cpp:186
ASSERT
#define ASSERT(x)
Definition: qcstring.h:44
DocNode::parent
DocNode * parent() const
Definition: docparser.h:166
DocNode::Kind_SimpleSect
@ Kind_SimpleSect
Definition: docparser.h:109
DBG
#define DBG(x)
Definition: docparser.cpp:58
DocTitle::hasTitle
bool hasTitle() const
Definition: docparser.h:743
CompAccept< DocSimpleSect >::m_children
DocNodeList m_children
Definition: docparser.h:211
DocVisitor::visitPre
virtual void visitPre(DocAutoList *)=0
DocSimpleSect::Invar
@ Invar
Definition: docparser.h:1117
DocSimpleSect::Version
@ Version
Definition: docparser.h:1116
DocTitle::parseFromString
void parseFromString(const QCString &title)
Definition: docparser.cpp:4364
DocNode::m_parent
DocNode * m_parent
Definition: docparser.h:182
FALSE
#define FALSE
Definition: qcstring.h:33
DocSimpleSect::Since
@ Since
Definition: docparser.h:1116
DocSimpleSect::Attention
@ Attention
Definition: docparser.h:1117
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108