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

Node representing a citation of some bibliographic reference. More...

#include <src/docnode.h>

+ Inheritance diagram for DocCite:
+ Collaboration diagram for DocCite:

Public Member Functions

 DocCite (DocParser *parser, DocNodeVariant *parent, const QCString &target, const QCString &context)
 
QCString file () const
 
QCString relPath () const
 
QCString ref () const
 
QCString anchor () const
 
QCString text () 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

QCString m_file
 
QCString m_relPath
 
QCString m_ref
 
QCString m_anchor
 
QCString m_text
 

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 citation of some bibliographic reference.

Definition at line 243 of file docnode.h.

Constructor & Destructor Documentation

◆ DocCite()

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

Definition at line 887 of file docnode.cpp.

888{
889 size_t numBibFiles = Config_getList(CITE_BIB_FILES).size();
890 //printf("DocCite::DocCite(target=%s)\n",qPrint(target));
891 ASSERT(!target.isEmpty());
892 m_relPath = parser->context.relPath;
893 const CitationManager &ct = CitationManager::instance();
894 const CiteInfo *cite = ct.find(target);
895 //printf("cite=%p text='%s' numBibFiles=%d\n",cite,cite?qPrint(cite->text):"<null>",numBibFiles);
896 if (numBibFiles>0 && cite && !cite->text().isEmpty()) // ref to citation
897 {
898 m_text = cite->text();
899 m_ref = "";
900 m_anchor = ct.anchorPrefix()+cite->label();
902 //printf("CITE ==> m_text=%s,m_ref=%s,m_file=%s,m_anchor=%s\n",
903 // qPrint(m_text),qPrint(m_ref),qPrint(m_file),qPrint(m_anchor));
904 return;
905 }
906 m_text = target;
907 if (numBibFiles==0)
908 {
909 warn_doc_error(parser->context.fileName,parser->tokenizer.getLineNr(),"\\cite command found but no bib files specified via CITE_BIB_FILES!");
910 }
911 else if (cite==nullptr)
912 {
913 warn_doc_error(parser->context.fileName,parser->tokenizer.getLineNr(),"unable to resolve reference to '%s' for \\cite command",
914 qPrint(target));
915 }
916 else
917 {
918 warn_doc_error(parser->context.fileName,parser->tokenizer.getLineNr(),"\\cite command to '%s' does not have an associated number",
919 qPrint(target));
920 }
921}
QCString anchorPrefix() const
Definition cite.cpp:122
const CiteInfo * find(const QCString &label) const
Return the citation info for a given label.
Definition cite.cpp:96
static CitationManager & instance()
Definition cite.cpp:80
QCString fileName() const
Definition cite.cpp:117
QCString m_anchor
Definition docnode.h:257
QCString m_relPath
Definition docnode.h:255
QCString m_ref
Definition docnode.h:256
QCString m_file
Definition docnode.h:254
QCString m_text
Definition docnode.h:258
DocNode(DocParser *parser, DocNodeVariant *parent)
Definition docnode.h:84
DocParser * parser()
Definition docnode.h:97
DocNodeVariant * parent()
Definition docnode.h:89
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
#define Config_getList(name)
Definition config.h:38
#define warn_doc_error(file, line, fmt,...)
Definition message.h:74
const char * qPrint(const char *s)
Definition qcstring.h:661
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
#define ASSERT(x)
Definition qcstring.h:39
virtual QCString text() const =0
virtual QCString label() const =0
QCString convertNameToFile(const QCString &name, bool allowDots, bool allowUnderscore)
Definition util.cpp:3858

References CitationManager::anchorPrefix(), ASSERT, Config_getList, convertNameToFile(), DocNode::DocNode(), FALSE, CitationManager::fileName(), CitationManager::find(), CitationManager::instance(), QCString::isEmpty(), CiteInfo::label(), m_anchor, m_file, m_ref, m_relPath, m_text, DocNode::parent(), DocNode::parser(), qPrint(), CiteInfo::text(), TRUE, and warn_doc_error.

Member Function Documentation

◆ anchor()

◆ file()

◆ ref()

QCString DocCite::ref ( ) const
inline

◆ relPath()

QCString DocCite::relPath ( ) const
inline

Definition at line 248 of file docnode.h.

248{ return m_relPath; }

References m_relPath.

Referenced by HtmlDocVisitor::operator()().

◆ text()

Member Data Documentation

◆ m_anchor

QCString DocCite::m_anchor
private

Definition at line 257 of file docnode.h.

Referenced by anchor(), and DocCite().

◆ m_file

QCString DocCite::m_file
private

Definition at line 254 of file docnode.h.

Referenced by DocCite(), and file().

◆ m_ref

QCString DocCite::m_ref
private

Definition at line 256 of file docnode.h.

Referenced by DocCite(), and ref().

◆ m_relPath

QCString DocCite::m_relPath
private

Definition at line 255 of file docnode.h.

Referenced by DocCite(), and relPath().

◆ m_text

QCString DocCite::m_text
private

Definition at line 258 of file docnode.h.

Referenced by DocCite(), and text().


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