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 1284 of file docnode.h.

Constructor & Destructor Documentation

◆ DocHtmlBlockQuote()

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

Definition at line 1287 of file docnode.h.

DocCompoundNode(DocParser *parser, DocNodeVariant *parent)
Definition docnode.h:140
const HtmlAttribList & attribs() const
Definition docnode.h:1290
HtmlAttribList m_attribs
Definition docnode.h:1293
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 1290 of file docnode.h.

1290{ return m_attribs; }

References m_attribs.

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

◆ parse()

Token DocHtmlBlockQuote::parse ( )

Definition at line 2675 of file docnode.cpp.

2676{
2677 AUTO_TRACE();
2678 Token retval = Token::make_TK_NONE();
2679 auto ns = AutoNodeStack(parser(),thisVariant());
2680
2681 // parse one or more paragraphs
2682 bool isFirst=TRUE;
2683 DocPara *par=nullptr;
2684 do
2685 {
2686 children().append<DocPara>(parser(),thisVariant());
2687 par = children().get_last<DocPara>();
2688 if (isFirst) { par->markFirst(); isFirst=FALSE; }
2689 retval=par->parse();
2690 }
2691 while (retval.is(TokenRetval::TK_NEWPARA));
2692 if (par) par->markLast();
2693
2694 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
2695 {
2696 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected end of comment while inside <blockquote> block");
2697 }
2698
2699 AUTO_TRACE_EXIT("retval={}",retval.to_string());
2700 return retval.is(TokenRetval::RetVal_EndBlockQuote) ? Token::make_RetVal_OK() : retval;
2701}
DocNodeList & children()
Definition docnode.h:142
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
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: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(), 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 1293 of file docnode.h.

Referenced by attribs(), and DocHtmlBlockQuote().


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