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

Node representing a simple section title. More...

#include <src/docnode.h>

+ Inheritance diagram for DocTitle:
+ Collaboration diagram for DocTitle:

Public Member Functions

 DocTitle (DocParser *parser, DocNodeVariant *parent)
 
void parse ()
 
void parseFromString (DocNodeVariant *, const QCString &title)
 
bool hasTitle () 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
 

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 a simple section title.

Definition at line 602 of file docnode.h.

Constructor & Destructor Documentation

◆ DocTitle()

DocTitle::DocTitle ( DocParser * parser,
DocNodeVariant * parent )
inline

Definition at line 605 of file docnode.h.

DocCompoundNode(DocParser *parser, DocNodeVariant *parent)
Definition docnode.h:140
DocParser * parser()
Definition docnode.h:97
DocNodeVariant * parent()
Definition docnode.h:89

References DocCompoundNode::DocCompoundNode(), DocNode::parent(), and DocNode::parser().

Member Function Documentation

◆ hasTitle()

bool DocTitle::hasTitle ( ) const
inline

Definition at line 608 of file docnode.h.

608{ return !children().empty(); }
DocNodeList & children()
Definition docnode.h:142
bool empty() const
checks whether the container is empty
Definition growvector.h:140

References DocCompoundNode::children(), and GrowVector< T >::empty().

Referenced by DocbookDocVisitor::operator()().

◆ parse()

void DocTitle::parse ( )

Definition at line 2857 of file docnode.cpp.

2858{
2859 AUTO_TRACE();
2860 auto ns = AutoNodeStack(parser(),thisVariant());
2862 Token tok = parser()->tokenizer.lex();
2863 while (!tok.is_any_of(TokenRetval::TK_NONE, TokenRetval::TK_EOF))
2864 {
2865 if (!parser()->defaultHandleToken(thisVariant(),tok,children()))
2866 {
2867 parser()->errorHandleDefaultToken(thisVariant(),tok,children(),"title section");
2868 }
2869 tok = parser()->tokenizer.lex();
2870 }
2873}
DocNodeVariant * thisVariant()
Definition docnode.h:92
DocTokenizer tokenizer
void handlePendingStyleCommands(DocNodeVariant *parent, DocNodeList &children)
void errorHandleDefaultToken(DocNodeVariant *parent, Token tok, DocNodeList &children, const QCString &txt)
void setStateTitle()
void setStatePara()
bool is_any_of(ARGS... args) const
#define AUTO_TRACE(...)
Definition docnode.cpp:46

References AUTO_TRACE, DocCompoundNode::children(), DocParser::errorHandleDefaultToken(), DocParser::handlePendingStyleCommands(), Token::is_any_of(), DocTokenizer::lex(), DocNode::parser(), DocTokenizer::setStatePara(), DocTokenizer::setStateTitle(), DocNode::thisVariant(), and DocParser::tokenizer.

◆ parseFromString()

void DocTitle::parseFromString ( DocNodeVariant * parent,
const QCString & title )

Definition at line 2875 of file docnode.cpp.

2876{
2878 parser()->pushContext(); // this will create a new parser->context.token
2880 parser()->popContext(); // this will restore the old parser->context.token
2884}
Token internalValidatingParseDoc(DocNodeVariant *parent, DocNodeList &children, const QCString &doc)
void popContext()
Definition docparser.cpp:73
DocParserContext context
void pushContext()
Definition docparser.cpp:59
static void flattenParagraphs(DocNodeVariant *root, DocNodeList &children)
Definition docnode.cpp:809
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34

References DocCompoundNode::children(), DocParser::context, FALSE, flattenParagraphs(), DocParserContext::insideHtmlLink, DocParser::internalValidatingParseDoc(), DocNode::parent(), DocNode::parser(), DocParser::popContext(), DocParser::pushContext(), DocTokenizer::setStatePara(), DocNode::thisVariant(), DocParser::tokenizer, and TRUE.


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