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

Node representing an HTML blockquote. More...

#include <src/docnode.h>

+ Inheritance diagram for DocHtmlBlockQuote:
+ Collaboration diagram for DocHtmlBlockQuote:

Public Member Functions

 DocHtmlBlockQuote (DocParser *parser, DocNodeVariant *parent, const HtmlAttribList &attribs)
 
Token parse ()
 
const HtmlAttribListattribs () 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
 

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 representing an HTML blockquote.

Definition at line 1270 of file docnode.h.

Constructor & Destructor Documentation

◆ DocHtmlBlockQuote()

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

Definition at line 1273 of file docnode.h.

DocCompoundNode(DocParser *parser, DocNodeVariant *parent)
Definition docnode.h:140
const HtmlAttribList & attribs() const
Definition docnode.h:1276
HtmlAttribList m_attribs
Definition docnode.h:1279
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 & DocHtmlBlockQuote::attribs ( ) const
inline

Definition at line 1276 of file docnode.h.

1276{ return m_attribs; }

References m_attribs.

Referenced by DocHtmlBlockQuote(), and HtmlDocVisitor::operator()().

◆ parse()

Token DocHtmlBlockQuote::parse ( )

Definition at line 2673 of file docnode.cpp.

2674{
2675 AUTO_TRACE();
2676 Token retval = Token::make_TK_NONE();
2677 auto ns = AutoNodeStack(parser(),thisVariant());
2678
2679 // parse one or more paragraphs
2680 bool isFirst=TRUE;
2681 DocPara *par=nullptr;
2682 do
2683 {
2684 children().append<DocPara>(parser(),thisVariant());
2685 par = children().get_last<DocPara>();
2686 if (isFirst) { par->markFirst(); isFirst=FALSE; }
2687 retval=par->parse();
2688 }
2689 while (retval.is(TokenRetval::TK_NEWPARA));
2690 if (par) par->markLast();
2691
2692 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
2693 {
2694 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected end of comment while inside <blockquote> block");
2695 }
2696
2697 AUTO_TRACE_EXIT("retval={}",retval.to_string());
2698 return retval.is(TokenRetval::RetVal_EndBlockQuote) ? Token::make_RetVal_OK() : retval;
2699}
DocNodeList & children()
Definition docnode.h:142
DocNodeVariant * thisVariant()
Definition docnode.h:92
void markLast(bool v=TRUE)
Definition docnode.h:1066
void markFirst(bool v=TRUE)
Definition docnode.h:1065
Token parse()
Definition docnode.cpp:5451
bool is(TokenRetval rv) const
TOKEN_SPECIFICATIONS RETVAL_SPECIFICATIONS const char * to_string() const
bool is_any_of(ARGS... args) const
#define AUTO_TRACE(...)
Definition docnode.cpp:46
#define AUTO_TRACE_EXIT(...)
Definition docnode.cpp:48
#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:1379
T * get_last()
Returns a pointer to the last element in the list if that element exists and holds a T,...
Definition docnode.h:1390

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

Member Data Documentation

◆ m_attribs

HtmlAttribList DocHtmlBlockQuote::m_attribs
private

Definition at line 1279 of file docnode.h.

Referenced by attribs(), and DocHtmlBlockQuote().


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