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

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)
 
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

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 }
 
- Protected Member Functions inherited from DocNode
void setInsidePreformatted (bool p)
 

Detailed Description

Node representing an auto List.

Definition at line 551 of file docnode.h.

Member Enumeration Documentation

◆ ListType

Enumerator
Unnumbered 
Unchecked 
Checked_x 
Checked_X 

Definition at line 554 of file docnode.h.

555 {
556 Unnumbered=1, Unchecked=-2, Checked_x=-3, Checked_X=-4 // positive numbers give the label
557 };

Constructor & Destructor Documentation

◆ DocAutoList()

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

Definition at line 2802 of file docnode.cpp.

2803 :
2806{
2807}
int m_depth
Definition docnode.h:571
bool isCheckedList() const
Definition docnode.h:563
bool isEnumList() const
Definition docnode.h:561
int depth() const
Definition docnode.h:564
int m_indent
Definition docnode.h:568
bool m_isCheckedList
Definition docnode.h:570
int indent() const
Definition docnode.h:562
bool m_isEnumList
Definition docnode.h:569
DocCompoundNode(DocParser *parser, DocNodeVariant *parent)
Definition docnode.h:140
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 564 of file docnode.h.

564{ return m_depth; }

References m_depth.

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

◆ indent()

int DocAutoList::indent ( ) const
inline

Definition at line 562 of file docnode.h.

562{ 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 2809 of file docnode.cpp.

2810{
2811 AUTO_TRACE();
2812 Token retval = Token::make_RetVal_OK();
2813 int num=1;
2814 auto ns = AutoNodeStack(parser(),thisVariant());
2816 // first item or sub list => create new list
2817 do
2818 {
2819 switch (parser()->context.token->id)
2820 {
2821 case -1:
2822 break;
2823 case DocAutoList::Unchecked: // unchecked
2824 case DocAutoList::Checked_x: // checked with x
2825 case DocAutoList::Checked_X: // checked with X
2826 num = parser()->context.token->id;
2827 break;
2828 default: // explicitly numbered list
2829 num=parser()->context.token->id; // override num with real number given
2830 break;
2831 }
2832
2833 children().append<DocAutoListItem>(parser(),thisVariant(),m_indent,num++);
2834 retval = children().get_last<DocAutoListItem>()->parse();
2835 //printf("DocAutoList::parse(): retval=0x%x parser()->context.token->indent=%d m_indent=%d "
2836 // "m_isEnumList=%d parser()->context.token->isEnumList=%d parser()->context.token->name=%s\n",
2837 // retval,parser()->context.token->indent,m_indent,m_isEnumList,parser()->context.token->isEnumList,
2838 // qPrint(parser()->context.token->name));
2839 //printf("num=%d parser()->context.token->id=%d\n",num,parser()->context.token->id);
2840 }
2841 while (retval.is(TokenRetval::TK_LISTITEM) && // new list item
2842 m_indent==parser()->context.token->indent && // at same indent level
2843 m_isEnumList==parser()->context.token->isEnumList && // of the same kind
2844 m_isCheckedList==parser()->context.token->isCheckedList && // of the same kind
2845 (parser()->context.token->id==-1 || parser()->context.token->id>=num) // increasing number (or no number or checked list)
2846 );
2847
2849 AUTO_TRACE_EXIT("retval={}",retval.to_string());
2850 return retval;
2851}
Token parse()
Definition docnode.cpp:2809
DocNodeList & children()
Definition docnode.h:142
DocNodeVariant * thisVariant()
Definition docnode.h:92
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:46
#define AUTO_TRACE_EXIT(...)
Definition docnode.cpp:48
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
TokenInfo * token
Definition docparser_p.h:92

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

Referenced by depth(), and DocAutoList().

◆ m_indent

int DocAutoList::m_indent = 0
private

Definition at line 568 of file docnode.h.

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

◆ m_isCheckedList

bool DocAutoList::m_isCheckedList = false
private

Definition at line 570 of file docnode.h.

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

◆ m_isEnumList

bool DocAutoList::m_isEnumList = false
private

Definition at line 569 of file docnode.h.

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


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