Doxygen
DocHtmlCaption类 参考

Node representing a HTML table caption 更多...

#include <docparser.h>

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

Public 成员函数

 DocHtmlCaption (DocParser &parser, DocNode *parent, const HtmlAttribList &attribs)
 
Kind kind () const override
 
const HtmlAttribListattribs () const
 
int parse ()
 
bool hasCaptionId () const
 
QCString file () const
 
QCString anchor () const
 
- Public 成员函数 继承自 CompAccept< DocHtmlCaption >
 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 属性

HtmlAttribList m_attribs
 
bool m_hasCaptionId = false
 
QCString m_file
 
QCString m_anchor
 

额外继承的成员函数

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

详细描述

Node representing a HTML table caption

在文件 docparser.h1352 行定义.

构造及析构函数说明

◆ DocHtmlCaption()

DocHtmlCaption::DocHtmlCaption ( DocParser parser,
DocNode parent,
const HtmlAttribList attribs 
)

在文件 docparser.cpp3196 行定义.

3197  : CompAccept<DocHtmlCaption>(parser)
3198 {
3200  for (const auto &opt : attribs)
3201  {
3202  if (opt.name=="id" && !opt.value.isEmpty()) // interpret id attribute as an anchor
3203  {
3204  const SectionInfo *sec = SectionManager::instance().find(opt.value);
3205  if (sec)
3206  {
3207  //printf("Found anchor %s\n",qPrint(id));
3208  m_file = sec->fileName();
3209  m_anchor = sec->label();
3210  m_hasCaptionId = TRUE;
3211  }
3212  else
3213  {
3214  warn_doc_error(parser.context.fileName,parser.tokenizer.getLineNr(),"Invalid caption id '%s'",qPrint(opt.value));
3215  }
3216  }
3217  else // copy attribute
3218  {
3219  m_attribs.push_back(opt);
3220  }
3221  }
3222  m_parent = parent;
3223 }

引用了 attribs(), DocParser::context, FALSE, SectionInfo::fileName(), DocParserContext::fileName, LinkedMap< T, Hash, KeyEqual, Map >::find(), DocTokenizer::getLineNr(), SectionManager::instance(), SectionInfo::label(), m_anchor, m_attribs, m_file, m_hasCaptionId, DocNode::m_parent, DocNode::parent(), qPrint(), DocParser::tokenizer, TRUE , 以及 warn_doc_error().

成员函数说明

◆ anchor()

QCString DocHtmlCaption::anchor ( ) const
inline

在文件 docparser.h1361 行定义.

1361 { return m_anchor; }

引用了 m_anchor.

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

◆ attribs()

const HtmlAttribList& DocHtmlCaption::attribs ( ) const
inline

在文件 docparser.h1357 行定义.

1357 { return m_attribs; }

引用了 m_attribs.

被这些函数引用 DocHtmlCaption() , 以及 HtmlDocVisitor::visitPre().

◆ file()

QCString DocHtmlCaption::file ( ) const
inline

在文件 docparser.h1360 行定义.

1360 { return m_file; }

引用了 m_file.

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

◆ hasCaptionId()

bool DocHtmlCaption::hasCaptionId ( ) const
inline

在文件 docparser.h1359 行定义.

1359 { return m_hasCaptionId; }

引用了 m_hasCaptionId.

◆ kind()

Kind DocHtmlCaption::kind ( ) const
inlineoverridevirtual

Returns the kind of node. Provides runtime type information

实现了 DocNode.

在文件 docparser.h1356 行定义.

1356 { return Kind_HtmlCaption; }

引用了 DocNode::Kind_HtmlCaption.

◆ parse()

int DocHtmlCaption::parse ( )

在文件 docparser.cpp3225 行定义.

3226 {
3227  int retval=0;
3228  auto ns = AutoNodeStack(m_parser,this);
3229  DBG(("DocHtmlCaption::parse() start\n"));
3230  int tok;
3231  while ((tok=m_parser.tokenizer.lex()))
3232  {
3233  if (!m_parser.defaultHandleToken(this,tok,m_children))
3234  {
3235  switch (tok)
3236  {
3237  case TK_HTMLTAG:
3238  {
3240  if (tagId==HTML_CAPTION && m_parser.context.token->endTag) // found </caption> tag
3241  {
3242  retval = RetVal_OK;
3243  goto endcaption;
3244  }
3245  else
3246  {
3247  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"Unexpected html tag <%s%s> found within <caption> context",
3249  }
3250  }
3251  break;
3252  default:
3253  m_parser.errorHandleDefaultToken(this,tok,m_children,"<caption> tag");
3254  break;
3255  }
3256  }
3257  }
3258  if (tok==0)
3259  {
3260  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"Unexpected end of comment while inside"
3261  " <caption> tag");
3262  }
3263 endcaption:
3265  DBG(("DocHtmlCaption::parse() end\n"));
3266  return retval;
3267 }

引用了 DocParser::context, DBG, DocParser::defaultHandleToken(), TokenInfo::endTag, DocParser::errorHandleDefaultToken(), DocParserContext::fileName, DocTokenizer::getLineNr(), DocParser::handlePendingStyleCommands(), HTML_CAPTION, Mappers::htmlTagMapper, DocTokenizer::lex(), CompAccept< DocHtmlCaption >::m_children, DocNode::m_parser, Mapper::map(), TokenInfo::name, qPrint(), RetVal_OK, TK_HTMLTAG, DocParserContext::token, DocParser::tokenizer , 以及 warn_doc_error().

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

类成员变量说明

◆ m_anchor

QCString DocHtmlCaption::m_anchor
private

在文件 docparser.h1367 行定义.

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

◆ m_attribs

HtmlAttribList DocHtmlCaption::m_attribs
private

在文件 docparser.h1364 行定义.

被这些函数引用 attribs() , 以及 DocHtmlCaption().

◆ m_file

QCString DocHtmlCaption::m_file
private

在文件 docparser.h1366 行定义.

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

◆ m_hasCaptionId

bool DocHtmlCaption::m_hasCaptionId = false
private

在文件 docparser.h1365 行定义.

被这些函数引用 DocHtmlCaption() , 以及 hasCaptionId().


该类的文档由以下文件生成:
TokenInfo::endTag
bool endTag
Definition: doctokenizer.h:100
DocParserContext::token
TokenInfo * token
Definition: docparser.cpp:129
DocParser::context
DocParserContext context
Definition: docparser.cpp:175
DocHtmlCaption::m_hasCaptionId
bool m_hasCaptionId
Definition: docparser.h:1365
DocHtmlCaption::m_attribs
HtmlAttribList m_attribs
Definition: docparser.h:1364
DocHtmlCaption::attribs
const HtmlAttribList & attribs() const
Definition: docparser.h:1357
CompAccept< DocHtmlCaption >
TokenInfo::name
QCString name
Definition: doctokenizer.h:74
RetVal_OK
@ RetVal_OK
Command starting with \
Definition: doctokenizer.h:59
DocHtmlCaption::m_file
QCString m_file
Definition: docparser.h:1366
DocParser::handlePendingStyleCommands
void handlePendingStyleCommands(DocNode *parent, DocNodeList &children)
Definition: docparser.cpp:912
DocHtmlCaption::m_anchor
QCString m_anchor
Definition: docparser.h:1367
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
HTML_CAPTION
@ HTML_CAPTION
Definition: cmdmapper.h:153
SectionInfo::label
QCString label() const
Definition: section.h:65
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::Kind_HtmlCaption
@ Kind_HtmlCaption
Definition: docparser.h:124
DocNode::m_parser
DocParser & m_parser
Definition: docparser.h:184
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
SectionManager::instance
static SectionManager & instance()
returns a reference to the singleton
Definition: section.h:172
TK_HTMLTAG
@ TK_HTMLTAG
Command starting with @
Definition: doctokenizer.h:52
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
SectionInfo
class that provide information about a section.
Definition: section.h:49
AutoNodeStack
Definition: docparser.cpp:186
Mapper::map
int map(const QCString &n)
Definition: cmdmapper.cpp:237
DocTokenizer::lex
int lex()
DocNode::parent
DocNode * parent() const
Definition: docparser.h:166
DBG
#define DBG(x)
Definition: docparser.cpp:58
CompAccept< DocHtmlCaption >::m_children
DocNodeList m_children
Definition: docparser.h:211
DocNode::m_parent
DocNode * m_parent
Definition: docparser.h:182
FALSE
#define FALSE
Definition: qcstring.h:33