Doxygen
DocHtmlRow类 参考

Node representing a HTML table row 更多...

#include <docparser.h>

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

Public 成员函数

 DocHtmlRow (DocParser &parser, DocNode *parent, const HtmlAttribList &attribs)
 
Kind kind () const override
 
size_t numCells () const
 
const HtmlAttribListattribs () const
 
int parse ()
 
int parseXml (bool header)
 
bool isHeading () const
 
void setVisibleCells (uint n)
 
uint visibleCells () const
 
uint rowIndex () const
 
- Public 成员函数 继承自 CompAccept< DocHtmlRow >
 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 成员函数

void setRowIndex (uint idx)
 

Private 属性

HtmlAttribList m_attribs
 
uint m_visibleCells = 0
 
uint m_rowIdx = (uint)-1
 

友元

class DocHtmlTable
 

额外继承的成员函数

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

详细描述

Node representing a HTML table row

在文件 docparser.h1371 行定义.

构造及析构函数说明

◆ DocHtmlRow()

DocHtmlRow::DocHtmlRow ( DocParser parser,
DocNode parent,
const HtmlAttribList attribs 
)
inline

在文件 docparser.h1375 行定义.

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

成员函数说明

◆ attribs()

const HtmlAttribList& DocHtmlRow::attribs ( ) const
inline

在文件 docparser.h1379 行定义.

1379 { return m_attribs; }

引用了 m_attribs.

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

◆ isHeading()

bool DocHtmlRow::isHeading ( ) const
inline

在文件 docparser.h1382 行定义.

1382  { // a row is a table heading if all cells are marked as such
1383  bool heading=TRUE;
1384  for (const auto &n : m_children)
1385  {
1386  if (n->kind()==Kind_HtmlCell)
1387  {
1388  heading = heading && ((DocHtmlCell*)n.get())->isHeading();
1389  }
1390  }
1391  return !m_children.empty() && heading;
1392  }

引用了 DocNode::Kind_HtmlCell, CompAccept< DocHtmlRow >::m_children , 以及 TRUE.

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

◆ kind()

Kind DocHtmlRow::kind ( ) const
inlineoverridevirtual

Returns the kind of node. Provides runtime type information

实现了 DocNode.

在文件 docparser.h1377 行定义.

1377 { return Kind_HtmlRow; }

引用了 DocNode::Kind_HtmlRow.

◆ numCells()

size_t DocHtmlRow::numCells ( ) const
inline

在文件 docparser.h1378 行定义.

1378 { return m_children.size(); }

引用了 CompAccept< DocHtmlRow >::m_children.

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

◆ parse()

int DocHtmlRow::parse ( )

在文件 docparser.cpp3425 行定义.

3426 {
3427  int retval=RetVal_OK;
3428  auto ns = AutoNodeStack(m_parser,this);
3429  DBG(("DocHtmlRow::parse() start\n"));
3430 
3431  bool isHeading=FALSE;
3432  bool isFirst=TRUE;
3433  DocHtmlCell *cell=0;
3434 
3435  // get next token
3436  int tok=m_parser.tokenizer.lex();
3437  // skip whitespace
3438  while (tok==TK_WHITESPACE || tok==TK_NEWPARA) tok=m_parser.tokenizer.lex();
3439  // should find a html tag now
3440  if (tok==TK_HTMLTAG)
3441  {
3443  if (tagId==HTML_TD && !m_parser.context.token->endTag) // found <td> tag
3444  {
3445  }
3446  else if (tagId==HTML_TH && !m_parser.context.token->endTag) // found <th> tag
3447  {
3448  isHeading=TRUE;
3449  }
3450  else // found some other tag
3451  {
3452  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"expected <td> or <th> tag but "
3453  "found <%s> instead!",qPrint(m_parser.context.token->name));
3455  goto endrow;
3456  }
3457  }
3458  else if (tok==0) // premature end of comment
3459  {
3460  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"unexpected end of comment while looking"
3461  " for a html description title");
3462  goto endrow;
3463  }
3464  else // token other than html token
3465  {
3466  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"expected <td> or <th> tag but found %s token instead!",
3468  goto endrow;
3469  }
3470 
3471  // parse one or more cells
3472  do
3473  {
3475  cell->markFirst(isFirst);
3476  isFirst=FALSE;
3477  m_children.push_back(std::unique_ptr<DocHtmlCell>(cell));
3478  retval=cell->parse();
3479  isHeading = retval==RetVal_TableHCell;
3480  }
3481  while (retval==RetVal_TableCell || retval==RetVal_TableHCell);
3482  if (cell) cell->markLast(TRUE);
3483 
3484 endrow:
3485  DBG(("DocHtmlRow::parse() end\n"));
3486  return retval;
3487 }

引用了 TokenInfo::attribs, DocParser::context, DBG, TokenInfo::endTag, FALSE, DocParserContext::fileName, DocTokenizer::getLineNr(), HTML_TD, HTML_TH, Mappers::htmlTagMapper, isHeading(), DocTokenizer::lex(), CompAccept< DocHtmlRow >::m_children, DocNode::m_parser, Mapper::map(), DocHtmlCell::markFirst(), DocHtmlCell::markLast(), TokenInfo::name, DocHtmlCell::parse(), DocTokenizer::pushBackHtmlTag(), qPrint(), RetVal_OK, RetVal_TableCell, RetVal_TableHCell, TK_HTMLTAG, TK_NEWPARA, TK_WHITESPACE, DocParserContext::token, DocParser::tokenizer, DocTokenizer::tokToString(), TRUE , 以及 warn_doc_error().

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

◆ parseXml()

int DocHtmlRow::parseXml ( bool  header)

在文件 docparser.cpp3489 行定义.

3490 {
3491  int retval=RetVal_OK;
3492  auto ns = AutoNodeStack(m_parser,this);
3493  DBG(("DocHtmlRow::parseXml() start\n"));
3494 
3495  bool isFirst=TRUE;
3496  DocHtmlCell *cell=0;
3497 
3498  // get next token
3499  int tok=m_parser.tokenizer.lex();
3500  // skip whitespace
3501  while (tok==TK_WHITESPACE || tok==TK_NEWPARA) tok=m_parser.tokenizer.lex();
3502  // should find a html tag now
3503  if (tok==TK_HTMLTAG)
3504  {
3506  if (tagId==XML_TERM && !m_parser.context.token->endTag) // found <term> tag
3507  {
3508  }
3509  else if (tagId==XML_DESCRIPTION && !m_parser.context.token->endTag) // found <description> tag
3510  {
3511  }
3512  else // found some other tag
3513  {
3514  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"expected <term> or <description> tag but "
3515  "found <%s> instead!",qPrint(m_parser.context.token->name));
3517  goto endrow;
3518  }
3519  }
3520  else if (tok==0) // premature end of comment
3521  {
3522  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"unexpected end of comment while looking"
3523  " for a html description title");
3524  goto endrow;
3525  }
3526  else // token other than html token
3527  {
3528  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"expected <td> or <th> tag but found %s token instead!",
3530  goto endrow;
3531  }
3532 
3533  do
3534  {
3536  cell->markFirst(isFirst);
3537  isFirst=FALSE;
3538  m_children.push_back(std::unique_ptr<DocHtmlCell>(cell));
3539  retval=cell->parseXml();
3540  }
3541  while (retval==RetVal_TableCell || retval==RetVal_TableHCell);
3542  if (cell) cell->markLast(TRUE);
3543 
3544 endrow:
3545  DBG(("DocHtmlRow::parseXml() end\n"));
3546  return retval;
3547 }

引用了 TokenInfo::attribs, DocParser::context, DBG, TokenInfo::endTag, FALSE, DocParserContext::fileName, DocTokenizer::getLineNr(), Mappers::htmlTagMapper, isHeading(), DocTokenizer::lex(), CompAccept< DocHtmlRow >::m_children, DocNode::m_parser, Mapper::map(), DocHtmlCell::markFirst(), DocHtmlCell::markLast(), TokenInfo::name, DocHtmlCell::parseXml(), DocTokenizer::pushBackHtmlTag(), qPrint(), RetVal_OK, RetVal_TableCell, RetVal_TableHCell, TK_HTMLTAG, TK_NEWPARA, TK_WHITESPACE, DocParserContext::token, DocParser::tokenizer, DocTokenizer::tokToString(), TRUE, warn_doc_error(), XML_DESCRIPTION , 以及 XML_TERM.

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

◆ rowIndex()

uint DocHtmlRow::rowIndex ( ) const
inline

在文件 docparser.h1395 行定义.

1395 { return m_rowIdx; }

引用了 m_rowIdx.

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

◆ setRowIndex()

void DocHtmlRow::setRowIndex ( uint  idx)
inlineprivate

在文件 docparser.h1398 行定义.

1398 { m_rowIdx = idx; }

引用了 m_rowIdx.

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

◆ setVisibleCells()

void DocHtmlRow::setVisibleCells ( uint  n)
inline

在文件 docparser.h1393 行定义.

1393 { m_visibleCells = n; }

引用了 m_visibleCells.

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

◆ visibleCells()

uint DocHtmlRow::visibleCells ( ) const
inline

在文件 docparser.h1394 行定义.

1394 { return m_visibleCells; }

引用了 m_visibleCells.

友元及相关函数文档

◆ DocHtmlTable

friend class DocHtmlTable
friend

在文件 docparser.h1373 行定义.

类成员变量说明

◆ m_attribs

HtmlAttribList DocHtmlRow::m_attribs
private

在文件 docparser.h1399 行定义.

被这些函数引用 attribs().

◆ m_rowIdx

uint DocHtmlRow::m_rowIdx = (uint)-1
private

在文件 docparser.h1401 行定义.

被这些函数引用 rowIndex() , 以及 setRowIndex().

◆ m_visibleCells

uint DocHtmlRow::m_visibleCells = 0
private

在文件 docparser.h1400 行定义.

被这些函数引用 setVisibleCells() , 以及 visibleCells().


该类的文档由以下文件生成:
TokenInfo::endTag
bool endTag
Definition: doctokenizer.h:100
RetVal_TableCell
@ RetVal_TableCell
Definition: doctokenizer.h:73
DocParserContext::token
TokenInfo * token
Definition: docparser.cpp:129
DocParser::context
DocParserContext context
Definition: docparser.cpp:175
DocTokenizer::tokToString
static const char * tokToString(int token)
DocHtmlRow::attribs
const HtmlAttribList & attribs() const
Definition: docparser.h:1379
CompAccept< DocHtmlRow >
DocHtmlRow::m_visibleCells
uint m_visibleCells
Definition: docparser.h:1400
TokenInfo::name
QCString name
Definition: doctokenizer.h:74
RetVal_OK
@ RetVal_OK
Command starting with \
Definition: doctokenizer.h:59
DocHtmlRow::isHeading
bool isHeading() const
Definition: docparser.h:1382
TokenInfo::attribs
HtmlAttribList attribs
Definition: doctokenizer.h:99
DocParser::tokenizer
DocTokenizer tokenizer
Definition: docparser.cpp:176
DocNode::Kind_HtmlCell
@ Kind_HtmlCell
Definition: docparser.h:123
warn_doc_error
void warn_doc_error(const QCString &file, int line, const char *fmt,...)
Definition: message.cpp:186
DocNode::Kind_HtmlRow
@ Kind_HtmlRow
Definition: docparser.h:122
DocHtmlCell::parseXml
int parseXml()
Definition: docparser.cpp:3306
TK_WHITESPACE
@ TK_WHITESPACE
Definition: doctokenizer.h:48
XML_TERM
@ XML_TERM
Definition: cmdmapper.h:210
DocTokenizer::pushBackHtmlTag
void pushBackHtmlTag(const QCString &tag)
Mappers::htmlTagMapper
static Mapper * htmlTagMapper
Definition: cmdmapper.h:235
DocParserContext::fileName
QCString fileName
Definition: docparser.cpp:110
DocHtmlCell::markLast
void markLast(bool v=TRUE)
Definition: docparser.h:1329
DocNode::m_parser
DocParser & m_parser
Definition: docparser.h:184
HTML_TD
@ HTML_TD
Definition: cmdmapper.h:161
DocTokenizer::getLineNr
int getLineNr(void)
TRUE
#define TRUE
Definition: qcstring.h:36
DocHtmlCell::markFirst
void markFirst(bool v=TRUE)
Definition: docparser.h:1328
XML_DESCRIPTION
@ XML_DESCRIPTION
Definition: cmdmapper.h:194
TK_HTMLTAG
@ TK_HTMLTAG
Command starting with @
Definition: doctokenizer.h:52
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
DocHtmlRow::m_rowIdx
uint m_rowIdx
Definition: docparser.h:1401
DocHtmlCell::parse
int parse()
Definition: docparser.cpp:3271
AutoNodeStack
Definition: docparser.cpp:186
Mapper::map
int map(const QCString &n)
Definition: cmdmapper.cpp:237
DocHtmlRow::m_attribs
HtmlAttribList m_attribs
Definition: docparser.h:1399
DocTokenizer::lex
int lex()
TK_NEWPARA
@ TK_NEWPARA
Definition: doctokenizer.h:54
DocNode::parent
DocNode * parent() const
Definition: docparser.h:166
DocHtmlCell
Node representing a HTML table cell
Definition: docparser.h:1316
DBG
#define DBG(x)
Definition: docparser.cpp:58
CompAccept< DocHtmlRow >::m_children
DocNodeList m_children
Definition: docparser.h:211
RetVal_TableHCell
@ RetVal_TableHCell
Definition: doctokenizer.h:74
HTML_TH
@ HTML_TH
Definition: cmdmapper.h:162
DocNode::m_parent
DocNode * m_parent
Definition: docparser.h:182
FALSE
#define FALSE
Definition: qcstring.h:33