Skip to main content

The DocAutoListItem Class Reference

Node representing an item of a auto list. More...

Declaration

class DocAutoListItem { ... }

Included Headers

#include <src/docnode.h>

Base class

classDocCompoundNode

Base class for nodes with children. More...

Public Constructors Index

DocAutoListItem (DocParser *parser, DocNodeVariant *parent, int indent, int num)

Public Member Functions Index

intitemNumber () const
Tokenparse ()

Private Member Attributes Index

intm_indent = 0
intm_itemNum = 0

Description

Node representing an item of a auto list.

Definition at line 594 of file docnode.h.

Public Constructors

DocAutoListItem()

DocAutoListItem::DocAutoListItem (DocParser * parser, DocNodeVariant * parent, int indent, int num)

Declaration at line 597 of file docnode.h, definition at line 2875 of file docnode.cpp.

References DocCompoundNode::DocCompoundNode, m_indent, m_itemNum, DocNode::parent and DocNode::parser.

Public Member Functions

itemNumber()

parse()

Token DocAutoListItem::parse ()

Declaration at line 599 of file docnode.h, definition at line 2880 of file docnode.cpp.

2881{
2882 AUTO_TRACE();
2883 Token retval = Token::make_RetVal_OK();
2884 auto ns = AutoNodeStack(parser(),thisVariant());
2885
2886 // first parse any number of paragraphs
2887 bool isFirst=TRUE;
2888 DocPara *lastPar=nullptr;
2889 do
2890 {
2892 DocPara *par = children().get_last<DocPara>();
2893 if (isFirst) { par->markFirst(); isFirst=FALSE; }
2894 retval=par->parse();
2895 if (!par->isEmpty())
2896 {
2897 if (lastPar) lastPar->markLast(FALSE);
2898 lastPar=par;
2899 }
2900 else
2901 {
2902 children().pop_back();
2903 }
2904 // next paragraph should be more indented than the - marker to belong
2905 // to this item
2906 } while (retval.is(TokenRetval::TK_NEWPARA) && parser()->context.token->indent>m_indent);
2907 if (lastPar) lastPar->markLast();
2908
2909 AUTO_TRACE_EXIT("retval={}",retval.to_string());
2910 return retval;
2911}

References DocNodeList::append, AUTO_TRACE, AUTO_TRACE_EXIT, DocCompoundNode::children, FALSE, DocNodeList::get_last, Token::is, m_indent, DocPara::markLast, DocNode::parser, GrowVector< T >::pop_back, DocNode::thisVariant, Token::to_string and TRUE.

Private Member Attributes

m_indent

int DocAutoListItem::m_indent = 0

Definition at line 602 of file docnode.h.

602 int m_indent = 0;

Referenced by DocAutoListItem and parse.

m_itemNum

int DocAutoListItem::m_itemNum = 0

Definition at line 603 of file docnode.h.

603 int m_itemNum = 0;

Referenced by DocAutoListItem and itemNumber.


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


Generated via doxygen2docusaurus by Doxygen 1.14.0.