Skip to main content

The DocSecRefItem Class Reference

Node representing a reference to a section. More...

Declaration

class DocSecRefItem { ... }

Included Headers

#include <src/docnode.h>

Base class

classDocCompoundNode

Base class for nodes with children. More...

Public Constructors Index

DocSecRefItem (DocParser *parser, DocNodeVariant *parent, const QCString &target)

Public Member Functions Index

QCStringtarget () const
QCStringfile () const
QCStringanchor () const
QCStringrelPath () const
QCStringref () const
boolrefToTable () const
boolisSubPage () const
voidparse ()

Private Member Attributes Index

QCStringm_target
RefTypem_refType = Unknown
boolm_isSubPage = false
QCStringm_file
QCStringm_relPath
QCStringm_ref
QCStringm_anchor

Description

Node representing a reference to a section.

Definition at line 934 of file docnode.h.

Public Constructors

DocSecRefItem()

DocSecRefItem::DocSecRefItem (DocParser * parser, DocNodeVariant * parent, const QCString & target)

Public Member Functions

anchor()

QCString DocSecRefItem::anchor ()
inline

file()

QCString DocSecRefItem::file ()
inline

isSubPage()

bool DocSecRefItem::isSubPage ()
inline

Definition at line 944 of file docnode.h.

944 bool isSubPage() const { return m_isSubPage; }

Reference m_isSubPage.

Referenced by HtmlDocVisitor::operator() and LatexDocVisitor::operator().

parse()

void DocSecRefItem::parse ()

Declaration at line 945 of file docnode.h, definition at line 539 of file docnode.cpp.

540{
541 AUTO_TRACE();
542 auto ns = AutoNodeStack(parser(),thisVariant());
543
545 Token tok = parser()->tokenizer.lex();
546 while (!tok.is_any_of(TokenRetval::TK_NONE, TokenRetval::TK_EOF))
547 {
548 if (!parser()->defaultHandleToken(thisVariant(),tok,children()))
549 {
550 parser()->errorHandleDefaultToken(thisVariant(),tok,children(),"\\refitem");
551 }
552 tok = parser()->tokenizer.lex();
553 }
556
557 if (!m_target.isEmpty())
558 {
560 if (sec==nullptr && parser()->context.lang==SrcLangExt::Markdown) // lookup as markdown file
561 {
563 }
564 if (sec) // ref to section or anchor
565 {
566 // set defaults
567 m_ref = sec->ref();
570 m_anchor = sec->label();
571 m_isSubPage = false;
572 // adjust if needed
573 switch (sec->type().level())
574 {
576 {
578 m_isSubPage = pd && pd->hasParentPage();
579 if (!m_isSubPage)
580 {
581 m_anchor="";
582 }
583 }
584 break;
587 break;
590 break;
591 default:
592 break;
593 }
594 //printf("m_ref=%s,m_file=%s,type=%d\n",
595 // qPrint(m_ref),qPrint(m_file),m_refType);
596 }
597 else
598 {
599 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"reference to unknown section {}",m_target);
600 }
601 }
602 else
603 {
604 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"reference to empty target");
605 }
606}

References DocNode::Anchor, SectionType::Anchor, AUTO_TRACE, DocCompoundNode::children, DocParser::errorHandleDefaultToken, SectionInfo::fileName, LinkedMap< T, Hash, KeyEqual, Map >::find, DocParser::handlePendingStyleCommands, PageDef::hasParentPage, SectionManager::instance, Token::is_any_of, SectionInfo::label, SectionType::level, DocTokenizer::lex, m_anchor, m_file, m_isSubPage, m_ref, m_refType, m_target, markdownFileNameToId, SectionType::Page, Doxygen::pageLinkedMap, DocNode::parser, SectionInfo::ref, DocNode::Section, DocTokenizer::setStatePara, DocTokenizer::setStateTitle, stripKnownExtensions, DocNode::Table, SectionType::Table, DocNode::thisVariant, DocParser::tokenizer, SectionInfo::type and warn_doc_error.

ref()

QCString DocSecRefItem::ref ()
inline

Definition at line 942 of file docnode.h.

942 QCString ref() const { return m_ref; }

Reference m_ref.

Referenced by HtmlDocVisitor::operator() and LatexDocVisitor::operator().

refToTable()

bool DocSecRefItem::refToTable ()
inline

Definition at line 943 of file docnode.h.

943 bool refToTable() const { return m_refType==Table; }

References m_refType and DocNode::Table.

Referenced by LatexDocVisitor::operator().

relPath()

QCString DocSecRefItem::relPath ()
inline

Definition at line 941 of file docnode.h.

941 QCString relPath() const { return m_relPath; }

Reference m_relPath.

Referenced by DocSecRefItem and HtmlDocVisitor::operator().

target()

QCString DocSecRefItem::target ()
inline

Definition at line 938 of file docnode.h.

938 QCString target() const { return m_target; }

Reference m_target.

Referenced by DocSecRefItem and PrintDocVisitor::operator().

Private Member Attributes

m_anchor

QCString DocSecRefItem::m_anchor

Definition at line 954 of file docnode.h.

Referenced by anchor and parse.

m_file

QCString DocSecRefItem::m_file

Definition at line 951 of file docnode.h.

Referenced by file and parse.

m_isSubPage

bool DocSecRefItem::m_isSubPage = false

Definition at line 950 of file docnode.h.

950 bool m_isSubPage = false;

Referenced by isSubPage and parse.

m_ref

QCString DocSecRefItem::m_ref

Definition at line 953 of file docnode.h.

Referenced by parse and ref.

m_refType

RefType DocSecRefItem::m_refType = Unknown

Definition at line 949 of file docnode.h.

Referenced by parse and refToTable.

m_relPath

QCString DocSecRefItem::m_relPath

Definition at line 952 of file docnode.h.

Referenced by DocSecRefItem and relPath.

m_target

QCString DocSecRefItem::m_target

Definition at line 948 of file docnode.h.

Referenced by DocSecRefItem, parse and target.


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


Generated via doxygen2docusaurus by Doxygen 1.14.0.