Doxygen
DocHtmlHeader类 参考

Node Html heading 更多...

#include <docparser.h>

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

Public 成员函数

 DocHtmlHeader (DocParser &parser, DocNode *parent, const HtmlAttribList &attribs, int level)
 
int level () const
 
Kind kind () const override
 
const HtmlAttribListattribs () const
 
int parse ()
 
- Public 成员函数 继承自 CompAccept< DocHtmlHeader >
 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
 
HtmlAttribList m_attribs
 

额外继承的成员函数

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

详细描述

Node Html heading

在文件 docparser.h957 行定义.

构造及析构函数说明

◆ DocHtmlHeader()

DocHtmlHeader::DocHtmlHeader ( DocParser parser,
DocNode parent,
const HtmlAttribList attribs,
int  level 
)
inline

在文件 docparser.h960 行定义.

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

成员函数说明

◆ attribs()

const HtmlAttribList& DocHtmlHeader::attribs ( ) const
inline

在文件 docparser.h964 行定义.

964 { return m_attribs; }

引用了 m_attribs.

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

◆ kind()

Kind DocHtmlHeader::kind ( ) const
inlineoverridevirtual

Returns the kind of node. Provides runtime type information

实现了 DocNode.

在文件 docparser.h963 行定义.

963 { return Kind_HtmlHeader; }

引用了 DocNode::Kind_HtmlHeader.

◆ level()

◆ parse()

int DocHtmlHeader::parse ( )

在文件 docparser.cpp2885 行定义.

2886 {
2887  int retval=RetVal_OK;
2888  auto ns = AutoNodeStack(m_parser,this);
2889  DBG(("DocHtmlHeader::parse() start\n"));
2890 
2891  int tok;
2892  while ((tok=m_parser.tokenizer.lex()))
2893  {
2894  if (!m_parser.defaultHandleToken(this,tok,m_children))
2895  {
2896  switch (tok)
2897  {
2898  case TK_HTMLTAG:
2899  {
2901  if (tagId==HTML_H1 && m_parser.context.token->endTag) // found </h1> tag
2902  {
2903  if (m_level!=1)
2904  {
2905  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"<h%d> ended with </h1>",
2906  m_level);
2907  }
2908  goto endheader;
2909  }
2910  else if (tagId==HTML_H2 && m_parser.context.token->endTag) // found </h2> tag
2911  {
2912  if (m_level!=2)
2913  {
2914  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"<h%d> ended with </h2>",
2915  m_level);
2916  }
2917  goto endheader;
2918  }
2919  else if (tagId==HTML_H3 && m_parser.context.token->endTag) // found </h3> tag
2920  {
2921  if (m_level!=3)
2922  {
2923  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"<h%d> ended with </h3>",
2924  m_level);
2925  }
2926  goto endheader;
2927  }
2928  else if (tagId==HTML_H4 && m_parser.context.token->endTag) // found </h4> tag
2929  {
2930  if (m_level!=4)
2931  {
2932  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"<h%d> ended with </h4>",
2933  m_level);
2934  }
2935  goto endheader;
2936  }
2937  else if (tagId==HTML_H5 && m_parser.context.token->endTag) // found </h5> tag
2938  {
2939  if (m_level!=5)
2940  {
2941  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"<h%d> ended with </h5>",
2942  m_level);
2943  }
2944  goto endheader;
2945  }
2946  else if (tagId==HTML_H6 && m_parser.context.token->endTag) // found </h6> tag
2947  {
2948  if (m_level!=6)
2949  {
2950  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"<h%d> ended with </h6>",
2951  m_level);
2952  }
2953  goto endheader;
2954  }
2955  else if (tagId==HTML_A)
2956  {
2957  if (!m_parser.context.token->endTag)
2958  {
2960  }
2961  }
2962  else if (tagId==HTML_BR)
2963  {
2964  m_children.push_back(std::make_unique<DocLineBreak>(m_parser,this,m_parser.context.token->attribs));
2965  }
2966  else
2967  {
2968  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"Unexpected html tag <%s%s> found within <h%d> context",
2970  }
2971  }
2972  break;
2973  default:
2974  char tmp[20];
2975  sprintf(tmp,"<h%d>tag",m_level);
2977  }
2978  }
2979  }
2980  if (tok==0)
2981  {
2982  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"Unexpected end of comment while inside"
2983  " <h%d> tag\n",m_level);
2984  }
2985 endheader:
2987  DBG(("DocHtmlHeader::parse() end\n"));
2988  return retval;
2989 }

引用了 TokenInfo::attribs, DocParser::context, DBG, DocParser::defaultHandleToken(), TokenInfo::endTag, DocParser::errorHandleDefaultToken(), DocParserContext::fileName, DocTokenizer::getLineNr(), DocParser::handleAHref(), DocParser::handlePendingStyleCommands(), HTML_A, HTML_BR, HTML_H1, HTML_H2, HTML_H3, HTML_H4, HTML_H5, HTML_H6, Mappers::htmlTagMapper, DocTokenizer::lex(), CompAccept< DocHtmlHeader >::m_children, m_level, DocNode::m_parser, Mapper::map(), TokenInfo::name, qPrint(), RetVal_OK, TK_HTMLTAG, DocParserContext::token, DocParser::tokenizer , 以及 warn_doc_error().

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

类成员变量说明

◆ m_attribs

HtmlAttribList DocHtmlHeader::m_attribs
private

在文件 docparser.h969 行定义.

被这些函数引用 attribs().

◆ m_level

int DocHtmlHeader::m_level = 0
private

在文件 docparser.h968 行定义.

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


该类的文档由以下文件生成:
TokenInfo::endTag
bool endTag
Definition: doctokenizer.h:100
HTML_H5
@ HTML_H5
Definition: cmdmapper.h:179
DocParserContext::token
TokenInfo * token
Definition: docparser.cpp:129
DocParser::context
DocParserContext context
Definition: docparser.cpp:175
CompAccept< DocHtmlHeader >
DocNode::Kind_HtmlHeader
@ Kind_HtmlHeader
Definition: docparser.h:133
TokenInfo::name
QCString name
Definition: doctokenizer.h:74
RetVal_OK
@ RetVal_OK
Command starting with \
Definition: doctokenizer.h:59
DocParser::handlePendingStyleCommands
void handlePendingStyleCommands(DocNode *parent, DocNodeList &children)
Definition: docparser.cpp:912
TokenInfo::attribs
HtmlAttribList attribs
Definition: doctokenizer.h:99
DocParser::tokenizer
DocTokenizer tokenizer
Definition: docparser.cpp:176
HTML_H4
@ HTML_H4
Definition: cmdmapper.h:178
warn_doc_error
void warn_doc_error(const QCString &file, int line, const char *fmt,...)
Definition: message.cpp:186
HTML_H6
@ HTML_H6
Definition: cmdmapper.h:180
DocParser::handleAHref
int handleAHref(DocNode *parent, DocNodeList &children, const HtmlAttribList &tagHtmlAttribs)
Definition: docparser.cpp:937
DocParser::defaultHandleToken
bool defaultHandleToken(DocNode *parent, int tok, DocNodeList &children, bool handleWord=TRUE)
Definition: docparser.cpp:1277
Mappers::htmlTagMapper
static Mapper * htmlTagMapper
Definition: cmdmapper.h:235
DocParserContext::fileName
QCString fileName
Definition: docparser.cpp:110
DocParser::errorHandleDefaultToken
void errorHandleDefaultToken(DocNode *parent, int tok, DocNodeList &children, const QCString &txt)
Definition: docparser.cpp:775
DocNode::m_parser
DocParser & m_parser
Definition: docparser.h:184
DocTokenizer::getLineNr
int getLineNr(void)
HTML_H1
@ HTML_H1
Definition: cmdmapper.h:175
HTML_A
@ HTML_A
Definition: cmdmapper.h:172
TK_HTMLTAG
@ TK_HTMLTAG
Command starting with @
Definition: doctokenizer.h:52
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
AutoNodeStack
Definition: docparser.cpp:186
Mapper::map
int map(const QCString &n)
Definition: cmdmapper.cpp:237
DocHtmlHeader::attribs
const HtmlAttribList & attribs() const
Definition: docparser.h:964
DocTokenizer::lex
int lex()
HTML_H3
@ HTML_H3
Definition: cmdmapper.h:177
DocNode::parent
DocNode * parent() const
Definition: docparser.h:166
DocHtmlHeader::m_level
int m_level
Definition: docparser.h:968
DocHtmlHeader::m_attribs
HtmlAttribList m_attribs
Definition: docparser.h:969
DBG
#define DBG(x)
Definition: docparser.cpp:58
HTML_H2
@ HTML_H2
Definition: cmdmapper.h:176
CompAccept< DocHtmlHeader >::m_children
DocNodeList m_children
Definition: docparser.h:211
HTML_BR
@ HTML_BR
Definition: cmdmapper.h:171
DocNode::m_parent
DocNode * m_parent
Definition: docparser.h:182
DocHtmlHeader::level
int level() const
Definition: docparser.h:962