Doxygen
Loading...
Searching...
No Matches
DocHtmlDetails Class Reference

Node Html details. More...

#include <src/docnode.h>

+ Inheritance diagram for DocHtmlDetails:
+ Collaboration diagram for DocHtmlDetails:

Public Member Functions

 DocHtmlDetails (DocParser *parser, DocNodeVariant *parent, const HtmlAttribList &attribs)
 
const HtmlAttribListattribs () const
 
Token parse ()
 
void parseSummary (DocNodeVariant *, HtmlAttribList &attribs)
 
const DocNodeVariantsummary () const
 
- Public Member Functions inherited from DocCompoundNode
 DocCompoundNode (DocParser *parser, DocNodeVariant *parent)
 
DocNodeListchildren ()
 
const DocNodeListchildren () const
 
- Public Member Functions inherited from DocNode
 DocNode (DocParser *parser, DocNodeVariant *parent)
 
 ~DocNode ()=default
 
DocNodeVariantparent ()
 
const DocNodeVariantparent () const
 
DocNodeVariantthisVariant ()
 
const DocNodeVariantthisVariant () const
 
void setThisVariant (DocNodeVariant *thisVariant)
 
DocParserparser ()
 
const DocParserparser () const
 
void setParent (DocNodeVariant *parent)
 
bool isPreformatted () const
 

Private Attributes

HtmlAttribList m_attribs
 
std::unique_ptr< DocNodeVariantm_summary
 

Additional Inherited Members

- Protected Types inherited from DocNode
enum  RefType { Unknown , Anchor , Section , Table }
 
- Protected Member Functions inherited from DocNode
void setInsidePreformatted (bool p)
 

Detailed Description

Node Html details.

Definition at line 850 of file docnode.h.

Constructor & Destructor Documentation

◆ DocHtmlDetails()

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

Definition at line 853 of file docnode.h.

853 :
DocCompoundNode(DocParser *parser, DocNodeVariant *parent)
Definition docnode.h:140
const HtmlAttribList & attribs() const
Definition docnode.h:855
HtmlAttribList m_attribs
Definition docnode.h:861
DocParser * parser()
Definition docnode.h:97
DocNodeVariant * parent()
Definition docnode.h:89

References attribs(), DocCompoundNode::DocCompoundNode(), m_attribs, DocNode::parent(), and DocNode::parser().

Member Function Documentation

◆ attribs()

const HtmlAttribList & DocHtmlDetails::attribs ( ) const
inline

Definition at line 855 of file docnode.h.

855{ return m_attribs; }

References m_attribs.

Referenced by DocHtmlDetails(), HtmlDocVisitor::operator()(), and parseSummary().

◆ parse()

Token DocHtmlDetails::parse ( )

Definition at line 1405 of file docnode.cpp.

1406{
1407 AUTO_TRACE();
1408 Token retval(TokenRetval::TK_NONE);
1409 auto ns = AutoNodeStack(parser(),thisVariant());
1410
1411 // parse one or more paragraphs
1412 bool isFirst=TRUE;
1413 DocPara *par=nullptr;
1414 do
1415 {
1416 children().append<DocPara>(parser(),thisVariant());
1417 par = children().get_last<DocPara>();
1418 if (isFirst) { par->markFirst(); isFirst=FALSE; }
1419 retval=par->parse();
1420 }
1421 while (retval.is(TokenRetval::TK_NEWPARA));
1422 if (par) par->markLast();
1423
1424 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1425 {
1426 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected end of comment while inside <details> block");
1427 }
1428
1429 if (!summary())
1430 {
1431 HtmlAttribList summaryAttribs;
1433 DocHtmlSummary *summary = &std::get<DocHtmlSummary>(*m_summary);
1434 summary->children().append<DocWord>(parser(),thisVariant(),theTranslator->trDetails());
1435 }
1436 AUTO_TRACE_EXIT("retval={}",retval.to_string());
1437 return retval.is(TokenRetval::RetVal_EndHtmlDetails) ? Token::make_RetVal_OK() : retval;
1438}
DocNodeList & children()
Definition docnode.h:142
const DocNodeVariant * summary() const
Definition docnode.h:858
std::unique_ptr< DocNodeVariant > m_summary
Definition docnode.h:862
DocNodeVariant * thisVariant()
Definition docnode.h:92
void markLast(bool v=TRUE)
Definition docnode.h:1080
void markFirst(bool v=TRUE)
Definition docnode.h:1079
Token parse()
Definition docnode.cpp:5459
virtual QCString trDetails()=0
#define AUTO_TRACE(...)
Definition docnode.cpp:46
#define AUTO_TRACE_EXIT(...)
Definition docnode.cpp:48
std::unique_ptr< DocNodeVariant > createDocNode(Args &&...args)
Definition docnode.h:1485
Translator * theTranslator
Definition language.cpp:71
#define warn_doc_error(file, line, fmt,...)
Definition message.h:74
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
void append(Args &&... args)
Append a new DocNodeVariant to the list by constructing it with type T and parameters Args.
Definition docnode.h:1393
T * get_last()
Returns a pointer to the last element in the list if that element exists and holds a T,...
Definition docnode.h:1404

References DocNodeList::append(), AUTO_TRACE, AUTO_TRACE_EXIT, DocCompoundNode::children(), createDocNode(), FALSE, DocNodeList::get_last(), Token::is(), Token::is_any_of(), m_summary, DocPara::markFirst(), DocPara::markLast(), DocPara::parse(), DocNode::parser(), summary(), theTranslator, DocNode::thisVariant(), Token::to_string(), TRUE, and warn_doc_error.

◆ parseSummary()

void DocHtmlDetails::parseSummary ( DocNodeVariant * parent,
HtmlAttribList & attribs )

Definition at line 1440 of file docnode.cpp.

1441{
1442 AUTO_TRACE();
1444 DocHtmlSummary *summary = &std::get<DocHtmlSummary>(*m_summary);
1445 summary->parse();
1446}

References attribs(), AUTO_TRACE, createDocNode(), m_summary, DocNode::parent(), DocNode::parser(), and summary().

Referenced by DocPara::handleHtmlStartTag().

◆ summary()

Member Data Documentation

◆ m_attribs

HtmlAttribList DocHtmlDetails::m_attribs
private

Definition at line 861 of file docnode.h.

Referenced by attribs(), and DocHtmlDetails().

◆ m_summary

std::unique_ptr<DocNodeVariant> DocHtmlDetails::m_summary
private

Definition at line 862 of file docnode.h.

Referenced by parse(), parseSummary(), and summary().


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