Doxygen
Loading...
Searching...
No Matches
DocAutoList Class Referencefinal

Node representing an auto List. More...

#include <src/docnode.h>

Inheritance diagram for DocAutoList:
Collaboration diagram for DocAutoList:

Public Types

enum  ListType { Unnumbered =1 , Unchecked =-2 , Checked_x =-3 , Checked_X =-4 }

Public Member Functions

 DocAutoList (DocParser *parser, DocNodeVariant *parent, int indent, bool isEnumList, int depth, bool isCheckedList)
bool isEnumList () const
int indent () const
bool isCheckedList () const
int depth () const
Token parse ()
Public Member Functions inherited from DocCompoundNode
 DocCompoundNode (DocParser *parser, DocNodeVariant *parent)
DocNodeList & children ()
const DocNodeList & children () const
Public Member Functions inherited from DocNode
 DocNode (DocParser *parser, DocNodeVariant *parent)
 ~DocNode ()=default
DocNodeVariant * parent ()
const DocNodeVariant * parent () const
DocNodeVariant * thisVariant ()
const DocNodeVariant * thisVariant () const
void setThisVariant (DocNodeVariant *thisVariant)
DocParser * parser ()
const DocParser * parser () const
void setParent (DocNodeVariant *parent)
bool isPreformatted () const

Private Attributes

int m_indent = 0
bool m_isEnumList = false
bool m_isCheckedList = false
int m_depth = 0

Additional Inherited Members

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

Detailed Description

Node representing an auto List.

Definition at line 570 of file docnode.h.

Member Enumeration Documentation

◆ ListType

Enumerator
Unnumbered 
Unchecked 
Checked_x 
Checked_X 

Definition at line 573 of file docnode.h.

574 {
575 Unnumbered=1, Unchecked=-2, Checked_x=-3, Checked_X=-4 // positive numbers give the label
576 };

Constructor & Destructor Documentation

◆ DocAutoList()

DocAutoList::DocAutoList ( DocParser * parser,
DocNodeVariant * parent,
int indent,
bool isEnumList,
int depth,
bool isCheckedList )

Definition at line 3139 of file docnode.cpp.

3140 :
3143{
3144}
int m_depth
Definition docnode.h:590
bool isCheckedList() const
Definition docnode.h:582
bool isEnumList() const
Definition docnode.h:580
int depth() const
Definition docnode.h:583
int m_indent
Definition docnode.h:587
bool m_isCheckedList
Definition docnode.h:589
int indent() const
Definition docnode.h:581
bool m_isEnumList
Definition docnode.h:588
DocCompoundNode(DocParser *parser, DocNodeVariant *parent)
Definition docnode.h:141
DocParser * parser()
Definition docnode.h:97
DocNodeVariant * parent()
Definition docnode.h:89

References depth(), DocCompoundNode::DocCompoundNode(), indent(), isCheckedList(), isEnumList(), m_depth, m_indent, m_isCheckedList, m_isEnumList, DocNode::parent(), and DocNode::parser().

Member Function Documentation

◆ depth()

int DocAutoList::depth ( ) const
inline

Definition at line 583 of file docnode.h.

583{ return m_depth; }

References m_depth.

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

◆ indent()

int DocAutoList::indent ( ) const
inline

Definition at line 581 of file docnode.h.

581{ return m_indent; }

References m_indent.

Referenced by DocAutoList(), and DocPara::parse().

◆ isCheckedList()

bool DocAutoList::isCheckedList ( ) const
inline

◆ isEnumList()

◆ parse()

Token DocAutoList::parse ( )

Definition at line 3146 of file docnode.cpp.

3147{
3148 AUTO_TRACE();
3149 Token retval = Token::make_RetVal_OK();
3150 int num=1;
3151 auto ns = AutoNodeStack(parser(),thisVariant());
3153 // first item or sub list => create new list
3154 do
3155 {
3156 switch (parser()->context.token->id)
3157 {
3158 case -1:
3159 break;
3160 case DocAutoList::Unchecked: // unchecked
3161 case DocAutoList::Checked_x: // checked with x
3162 case DocAutoList::Checked_X: // checked with X
3163 num = parser()->context.token->id;
3164 break;
3165 default: // explicitly numbered list
3166 num=parser()->context.token->id; // override num with real number given
3167 break;
3168 }
3169
3170 children().append<DocAutoListItem>(parser(),thisVariant(),m_indent,num++);
3171 retval = children().get_last<DocAutoListItem>()->parse();
3172 //printf("DocAutoList::parse(): retval=0x%x parser()->context.token->indent=%d m_indent=%d "
3173 // "m_isEnumList=%d parser()->context.token->isEnumList=%d parser()->context.token->name=%s\n",
3174 // retval,parser()->context.token->indent,m_indent,m_isEnumList,parser()->context.token->isEnumList,
3175 // qPrint(parser()->context.token->name));
3176 //printf("num=%d parser()->context.token->id=%d\n",num,parser()->context.token->id);
3177 }
3178 while (retval.is(TokenRetval::TK_LISTITEM) && // new list item
3179 m_indent==parser()->context.token->indent && // at same indent level
3180 m_isEnumList==parser()->context.token->isEnumList && // of the same kind
3181 m_isCheckedList==parser()->context.token->isCheckedList && // of the same kind
3182 (parser()->context.token->id==-1 || parser()->context.token->id>=num) // increasing number (or no number or checked list)
3183 );
3184
3186
3187 AUTO_TRACE_EXIT("retval={}",retval.to_string());
3188 return retval;
3189}
Token parse()
Definition docnode.cpp:3146
DocNodeList & children()
Definition docnode.h:143
DocNodeVariant * thisVariant()
Definition docnode.h:92
void append(Args &&... args)
Append a new DocNodeVariant to the list by constructing it with type T and parameters Args.
Definition docnode.h:1404
T * get_last()
Returns a pointer to the last element in the list if that element exists and holds a T,...
Definition docnode.h:1415
DocTokenizer tokenizer
DocParserContext context
void startAutoList()
bool is(TokenRetval rv) const
TOKEN_SPECIFICATIONS RETVAL_SPECIFICATIONS const char * to_string() const
#define AUTO_TRACE(...)
Definition docnode.cpp:53
#define AUTO_TRACE_EXIT(...)
Definition docnode.cpp:55
TokenInfo * token
Definition docparser_p.h:94

References DocNodeList::append(), AUTO_TRACE, AUTO_TRACE_EXIT, Checked_X, Checked_x, DocCompoundNode::children(), DocParser::context, DocTokenizer::endAutoList(), DocNodeList::get_last(), TokenInfo::id, Token::is(), m_indent, m_isCheckedList, m_isEnumList, parse(), DocNode::parser(), DocTokenizer::startAutoList(), DocNode::thisVariant(), Token::to_string(), DocParserContext::token, DocParser::tokenizer, and Unchecked.

Referenced by parse().

Member Data Documentation

◆ m_depth

int DocAutoList::m_depth = 0
private

Definition at line 590 of file docnode.h.

Referenced by depth(), and DocAutoList().

◆ m_indent

int DocAutoList::m_indent = 0
private

Definition at line 587 of file docnode.h.

Referenced by DocAutoList(), indent(), and parse().

◆ m_isCheckedList

bool DocAutoList::m_isCheckedList = false
private

Definition at line 589 of file docnode.h.

Referenced by DocAutoList(), isCheckedList(), and parse().

◆ m_isEnumList

bool DocAutoList::m_isEnumList = false
private

Definition at line 588 of file docnode.h.

Referenced by DocAutoList(), isEnumList(), and parse().


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