Skip to main content

The DocHtmlCaption Class Reference

Node representing a HTML table caption. More...

Declaration

class DocHtmlCaption { ... }

Included Headers

#include <src/docnode.h>

Base class

classDocCompoundNode

Base class for nodes with children. More...

Public Constructors Index

DocHtmlCaption (DocParser *parser, DocNodeVariant *parent, const HtmlAttribList &attribs)

Public Member Functions Index

const HtmlAttribList &attribs () const
Tokenparse ()
boolhasCaptionId () const
QCStringfile () const
QCStringanchor () const

Private Member Attributes Index

HtmlAttribListm_attribs
boolm_hasCaptionId = false
QCStringm_file
QCStringm_anchor

Description

Node representing a HTML table caption.

Definition at line 1227 of file docnode.h.

Public Constructors

DocHtmlCaption()

DocHtmlCaption::DocHtmlCaption (DocParser * parser, DocNodeVariant * parent, const HtmlAttribList & attribs)

Declaration at line 1230 of file docnode.h, definition at line 1696 of file docnode.cpp.

1698{
1700 for (const auto &opt : attribs)
1701 {
1702 if (opt.name=="id" && !opt.value.isEmpty()) // interpret id attribute as an anchor
1703 {
1704 const SectionInfo *sec = SectionManager::instance().find(opt.value);
1705 if (sec)
1706 {
1707 //printf("Found anchor %s\n",qPrint(id));
1708 m_file = sec->fileName();
1709 m_anchor = sec->label();
1711 }
1712 else
1713 {
1714 warn_doc_error(parser->context.fileName,parser->tokenizer.getLineNr(),"Invalid caption id '{}'",opt.value);
1715 }
1716 }
1717 else // copy attribute
1718 {
1719 m_attribs.push_back(opt);
1720 }
1721 }
1722}

References attribs, DocCompoundNode::DocCompoundNode, FALSE, SectionInfo::fileName, LinkedMap< T, Hash, KeyEqual, Map >::find, SectionManager::instance, SectionInfo::label, m_anchor, m_attribs, m_file, m_hasCaptionId, DocNode::parent, DocNode::parser, TRUE and warn_doc_error.

Public Member Functions

anchor()

QCString DocHtmlCaption::anchor ()
inline

attribs()

const HtmlAttribList & DocHtmlCaption::attribs ()
inline

Definition at line 1231 of file docnode.h.

1231 const HtmlAttribList &attribs() const { return m_attribs; }

Reference m_attribs.

Referenced by DocHtmlCaption and HtmlDocVisitor::operator().

file()

QCString DocHtmlCaption::file ()
inline

Definition at line 1234 of file docnode.h.

1234 QCString file() const { return m_file; }

Reference m_file.

Referenced by DocbookDocVisitor::operator(), LatexDocVisitor::operator(), RTFDocVisitor::operator() and XmlDocVisitor::operator().

hasCaptionId()

bool DocHtmlCaption::hasCaptionId ()
inline

Definition at line 1233 of file docnode.h.

1233 bool hasCaptionId() const { return m_hasCaptionId; }

Reference m_hasCaptionId.

parse()

Token DocHtmlCaption::parse ()

Declaration at line 1232 of file docnode.h, definition at line 1724 of file docnode.cpp.

1725{
1726 AUTO_TRACE();
1727 Token retval = Token::make_TK_NONE();
1728 auto ns = AutoNodeStack(parser(),thisVariant());
1729 Token tok = parser()->tokenizer.lex();
1730 while (!tok.is_any_of(TokenRetval::TK_NONE, TokenRetval::TK_EOF))
1731 {
1732 if (!parser()->defaultHandleToken(thisVariant(),tok,children()))
1733 {
1734 switch (tok.value())
1735 {
1736 case TokenRetval::TK_HTMLTAG:
1737 {
1738 HtmlTagType tagId=Mappers::htmlTagMapper->map(parser()->context.token->name);
1739 if (tagId==HtmlTagType::HTML_CAPTION && parser()->context.token->endTag) // found </caption> tag
1740 {
1741 retval = Token::make_RetVal_OK();
1742 goto endcaption;
1743 }
1744 else
1745 {
1746 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected html tag <{}{}> found within <caption> context",
1747 parser()->context.token->endTag?"/":"",parser()->context.token->name);
1748 }
1749 }
1750 break;
1751 default:
1752 parser()->errorHandleDefaultToken(thisVariant(),tok,children(),"<caption> tag");
1753 break;
1754 }
1755 }
1756 tok = parser()->tokenizer.lex();
1757 }
1758 if (tok.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1759 {
1760 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected end of comment while inside"
1761 " <caption> tag");
1762 }
1763endcaption:
1765 return retval;
1766}

References AUTO_TRACE, DocCompoundNode::children, DocParser::errorHandleDefaultToken, DocParser::handlePendingStyleCommands, HTML_CAPTION, Mappers::htmlTagMapper, Token::is_any_of, DocTokenizer::lex, DocNode::parser, DocNode::thisVariant, DocParser::tokenizer, Token::value and warn_doc_error.

Private Member Attributes

m_anchor

QCString DocHtmlCaption::m_anchor

Definition at line 1241 of file docnode.h.

Referenced by anchor and DocHtmlCaption.

m_attribs

HtmlAttribList DocHtmlCaption::m_attribs

Definition at line 1238 of file docnode.h.

Referenced by attribs and DocHtmlCaption.

m_file

QCString DocHtmlCaption::m_file

Definition at line 1240 of file docnode.h.

Referenced by DocHtmlCaption and file.

m_hasCaptionId

bool DocHtmlCaption::m_hasCaptionId = false

Definition at line 1239 of file docnode.h.

1239 bool m_hasCaptionId = false;

Referenced by DocHtmlCaption and hasCaptionId.


The documentation for this class was generated from the following files:


Generated via doxygen2docusaurus by Doxygen 1.14.0.