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

Node representing an item of a cross-referenced list. More...

#include <src/docnode.h>

+ Inheritance diagram for DocXRefItem:
+ Collaboration diagram for DocXRefItem:

Public Member Functions

 DocXRefItem (DocParser *parser, DocNodeVariant *parent, int id, const QCString &key)
 
QCString file () const
 
QCString anchor () const
 
QCString title () const
 
QCString relPath () const
 
QCString key () const
 
bool 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_id = 0
 
QCString m_key
 
QCString m_file
 
QCString m_anchor
 
QCString m_title
 
QCString m_relPath
 

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 item of a cross-referenced list.

Definition at line 614 of file docnode.h.

Constructor & Destructor Documentation

◆ DocXRefItem()

DocXRefItem::DocXRefItem ( DocParser * parser,
DocNodeVariant * parent,
int id,
const QCString & key )

Definition at line 472 of file docnode.cpp.

472 :
473 DocCompoundNode(parser,parent), m_id(id), m_key(key), m_relPath(parser->context.relPath)
474{
475}
DocCompoundNode(DocParser *parser, DocNodeVariant *parent)
Definition docnode.h:140
DocParser * parser()
Definition docnode.h:97
DocNodeVariant * parent()
Definition docnode.h:89
QCString key() const
Definition docnode.h:622
QCString m_key
Definition docnode.h:627
QCString m_relPath
Definition docnode.h:631

References DocCompoundNode::DocCompoundNode(), key(), m_id, m_key, m_relPath, DocNode::parent(), DocNode::parser(), and relPath().

Member Function Documentation

◆ anchor()

◆ file()

◆ key()

QCString DocXRefItem::key ( ) const
inline

Definition at line 622 of file docnode.h.

622{ return m_key; }

References m_key.

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

◆ parse()

bool DocXRefItem::parse ( )

Definition at line 477 of file docnode.cpp.

478{
479 RefList *refList = RefListManager::instance().find(m_key);
480 if (refList && refList->isEnabled())
481 {
482 RefItem *item = refList->find(m_id);
483 ASSERT(item!=nullptr);
484 if (item)
485 {
486 if (parser()->context.memberDef && parser()->context.memberDef->name().at(0)=='@')
487 {
488 m_file = "@"; // can't cross reference anonymous enum
489 m_anchor = "@";
490 }
491 else
492 {
493 m_file = refList->fileName();
494 m_anchor = item->anchor();
495 }
496 m_title = refList->sectionTitle();
497 //printf("DocXRefItem: file=%s anchor=%s title=%s\n",
498 // qPrint(m_file),qPrint(m_anchor),qPrint(m_title));
499
500 if (!item->text().isEmpty())
501 {
502 parser()->pushContext();
504 parser()->popContext();
505 }
506 }
507 return TRUE;
508 }
509 return FALSE;
510}
DocNodeList & children()
Definition docnode.h:142
DocNodeVariant * thisVariant()
Definition docnode.h:92
Token internalValidatingParseDoc(DocNodeVariant *parent, DocNodeList &children, const QCString &doc)
void popContext()
Definition docparser.cpp:73
void pushContext()
Definition docparser.cpp:59
QCString m_title
Definition docnode.h:630
const T * find(const std::string &key) const
Find an object given the key.
Definition linkedmap.h:47
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
QCString text() const
Definition reflist.h:45
QCString anchor() const
Definition reflist.h:46
QCString sectionTitle() const
Definition reflist.h:104
QCString fileName() const
Definition reflist.h:102
RefItem * find(int itemId)
Definition reflist.cpp:40
bool isEnabled() const
Definition reflist.cpp:46
static RefListManager & instance()
Definition reflist.h:121
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
#define ASSERT(x)
Definition qcstring.h:39

References RefItem::anchor(), ASSERT, DocCompoundNode::children(), FALSE, RefList::fileName(), LinkedMap< T, Hash, KeyEqual, Map >::find(), RefList::find(), RefListManager::instance(), DocParser::internalValidatingParseDoc(), QCString::isEmpty(), RefList::isEnabled(), m_anchor, m_file, m_id, m_key, m_title, DocNode::parser(), DocParser::popContext(), DocParser::pushContext(), RefList::sectionTitle(), RefItem::text(), DocNode::thisVariant(), and TRUE.

◆ relPath()

QCString DocXRefItem::relPath ( ) const
inline

Definition at line 621 of file docnode.h.

621{ return m_relPath; }

References m_relPath.

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

◆ title()

Member Data Documentation

◆ m_anchor

QCString DocXRefItem::m_anchor
private

Definition at line 629 of file docnode.h.

Referenced by anchor(), and parse().

◆ m_file

QCString DocXRefItem::m_file
private

Definition at line 628 of file docnode.h.

Referenced by file(), and parse().

◆ m_id

int DocXRefItem::m_id = 0
private

Definition at line 626 of file docnode.h.

Referenced by DocXRefItem(), and parse().

◆ m_key

QCString DocXRefItem::m_key
private

Definition at line 627 of file docnode.h.

Referenced by DocXRefItem(), key(), and parse().

◆ m_relPath

QCString DocXRefItem::m_relPath
private

Definition at line 631 of file docnode.h.

Referenced by DocXRefItem(), and relPath().

◆ m_title

QCString DocXRefItem::m_title
private

Definition at line 630 of file docnode.h.

Referenced by parse(), and title().


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