Skip to main content

DocCite Class

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

Declaration​

class DocCite { ... }

Included Headers​

#include <src/docnode.h>

Base class​

classDocNode

Abstract node interface with type information. More...

Public Constructors Index​

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

Public Member Functions Index​

QCStringfile () const
QCStringrelPath () const
QCStringref () const
QCStringanchor () const
QCStringtarget () const
CiteInfoOptionoption () const
QCStringgetText () const

Private Member Attributes Index​

QCStringm_file
QCStringm_relPath
QCStringm_ref
QCStringm_anchor
QCStringm_target
CiteInfoOptionm_option

Description​

Node representing a citation of some bibliographic reference.

Definition at line 244 of file docnode.h.

Public Constructors​

DocCite()​

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

Declaration at line 247 of file docnode.h, definition at line 903 of file docnode.cpp.

904{
905 size_t numBibFiles = Config_getList(CITE_BIB_FILES).size();
906 //printf("DocCite::DocCite(target=%s)\n",qPrint(target));
907 ASSERT(!target.isEmpty());
908 m_relPath = parser->context.relPath;
910 const CiteInfo *cite = ct.find(target);
911 //printf("cite=%p text='%s' numBibFiles=%d\n",cite,cite?qPrint(cite->text):"<null>",numBibFiles);
912 m_option = opt;
914 if (numBibFiles>0 && cite && !cite->text().isEmpty()) // ref to citation
915 {
916 m_ref = "";
917 m_anchor = ct.anchorPrefix()+cite->label();
919 //printf("CITE ==> m_text=%s,m_ref=%s,m_file=%s,m_anchor=%s\n",
920 // qPrint(m_text),qPrint(m_ref),qPrint(m_file),qPrint(m_anchor));
921 return;
922 }
923 if (numBibFiles==0)
924 {
925 warn_doc_error(parser->context.fileName,parser->tokenizer.getLineNr(),"\\cite command found but no bib files specified via CITE_BIB_FILES!");
926 }
927 else if (cite==nullptr)
928 {
929 warn_doc_error(parser->context.fileName,parser->tokenizer.getLineNr(),"unable to resolve reference to '{}' for \\cite command",
930 target);
931 }
932 else
933 {
934 warn_doc_error(parser->context.fileName,parser->tokenizer.getLineNr(),"\\cite command to '{}' does not have an associated number",
935 target);
936 }
937}

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_option, m_ref, m_relPath, m_target, DocNode::parent, DocNode::parser, target, CiteInfo::text, TRUE and warn_doc_error.

Public Member Functions​

anchor()​

file()​

getText()​

QCString DocCite::getText ()

Declaration at line 254 of file docnode.h, definition at line 939 of file docnode.cpp.

940{
941 QCString txt;
942 auto opt = m_option;
944 const CiteInfo *citeInfo = ct.find(m_target);
945
946 if (!opt.noPar()) txt += "[";
947
948 if (citeInfo)
949 {
950 if (opt.isNumber()) txt += citeInfo->text();
951 else if (opt.isShortAuthor()) txt += citeInfo->shortAuthor();
952 else if (opt.isYear()) txt += citeInfo->year();
953 }
954
955 if (!opt.noPar()) txt += "]";
956 return txt;
957}

References CitationManager::find, CitationManager::instance, m_option, m_target, CiteInfo::shortAuthor, CiteInfo::text and CiteInfo::year.

Referenced by DocbookDocVisitor::operator(), HtmlDocVisitor::operator(), LatexDocVisitor::operator(), ManDocVisitor::operator(), PerlModDocVisitor::operator(), PrintDocVisitor::operator(), RTFDocVisitor::operator() and XmlDocVisitor::operator().

option()​

ref()​

QCString DocCite::ref ()
inline

Definition at line 250 of file docnode.h.

250 QCString ref() const { return m_ref; }

Reference m_ref.

Referenced by HtmlDocVisitor::operator(), PrintDocVisitor::operator(), RTFDocVisitor::operator() and XmlDocVisitor::operator().

relPath()​

QCString DocCite::relPath ()
inline

Definition at line 249 of file docnode.h.

249 QCString relPath() const { return m_relPath; }

Reference m_relPath.

Referenced by HtmlDocVisitor::operator().

target()​

Private Member Attributes​

m_anchor​

QCString DocCite::m_anchor

Definition at line 260 of file docnode.h.

Referenced by anchor and DocCite.

m_file​

QCString DocCite::m_file

Definition at line 257 of file docnode.h.

Referenced by DocCite and file.

m_option​

CiteInfoOption DocCite::m_option

Definition at line 262 of file docnode.h.

Referenced by DocCite, getText and option.

m_ref​

QCString DocCite::m_ref

Definition at line 259 of file docnode.h.

Referenced by DocCite and ref.

m_relPath​

QCString DocCite::m_relPath

Definition at line 258 of file docnode.h.

Referenced by DocCite and relPath.

m_target​

QCString DocCite::m_target

Definition at line 261 of file docnode.h.

Referenced by DocCite, getText and target.


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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.14.0.