Doxygen
DocCite类 参考

Node representing a citation of some bibliographic reference 更多...

#include <docparser.h>

+ 类 DocCite 继承关系图:
+ DocCite 的协作图:

Public 成员函数

 DocCite (DocParser &parser, DocNode *parent, const QCString &target, const QCString &context)
 
Kind kind () const override
 
QCString file () const
 
QCString relPath () const
 
QCString ref () const
 
QCString anchor () const
 
QCString text () const
 
void accept (DocVisitor *v) override
 
- Public 成员函数 继承自 DocNode
 DocNode (DocParser &parser)
 
virtual ~DocNode ()
 
DocNodeparent () const
 
void setParent (DocNode *parent)
 
bool isPreformatted () const
 

Private 属性

QCString m_file
 
QCString m_relPath
 
QCString m_ref
 
QCString m_anchor
 
QCString m_text
 

额外继承的成员函数

- Public 类型 继承自 DocNode
enum  Kind {
  Kind_Root = 0, Kind_Word = 1, Kind_WhiteSpace = 2, Kind_Para = 3,
  Kind_AutoList = 4, Kind_AutoListItem = 5, Kind_Symbol = 6, Kind_URL = 7,
  Kind_StyleChange = 8, Kind_SimpleSect = 9, Kind_Title = 10, Kind_SimpleList = 11,
  Kind_SimpleListItem = 12, Kind_Section = 13, Kind_Verbatim = 14, Kind_XRefItem = 15,
  Kind_HtmlList = 16, Kind_HtmlListItem = 17, Kind_HtmlDescList = 18, Kind_HtmlDescData = 19,
  Kind_HtmlDescTitle = 20, Kind_HtmlTable = 21, Kind_HtmlRow = 22, Kind_HtmlCell = 23,
  Kind_HtmlCaption = 24, Kind_LineBreak = 25, Kind_HorRuler = 26, Kind_Anchor = 27,
  Kind_IndexEntry = 28, Kind_Internal = 29, Kind_HRef = 30, Kind_Include = 31,
  Kind_IncOperator = 32, Kind_HtmlHeader = 33, Kind_Image = 34, Kind_DotFile = 35,
  Kind_Link = 36, Kind_Ref = 37, Kind_Formula = 38, Kind_SecRefItem = 39,
  Kind_SecRefList = 40, Kind_SimpleSectSep = 41, Kind_LinkedWord = 42, Kind_ParamSect = 43,
  Kind_ParamList = 44, Kind_InternalRef = 45, Kind_Copy = 46, Kind_Text = 47,
  Kind_MscFile = 48, Kind_HtmlBlockQuote = 49, Kind_VhdlFlow = 50, Kind_ParBlock = 51,
  Kind_DiaFile = 52, Kind_Emoji = 53, Kind_Sep = 54
}
 
- Protected 类型 继承自 DocNode
enum  RefType { Unknown, Anchor, Section, Table }
 
- Protected 成员函数 继承自 DocNode
void setInsidePreformatted (bool p)
 
- Protected 属性 继承自 DocNode
DocNodem_parent = 0
 
DocParserm_parser
 

详细描述

Node representing a citation of some bibliographic reference

在文件 docparser.h321 行定义.

构造及析构函数说明

◆ DocCite()

DocCite::DocCite ( DocParser parser,
DocNode parent,
const QCString target,
const QCString context 
)

在文件 docparser.cpp2540 行定义.

2540  : DocNode(parser)
2541 {
2542  size_t numBibFiles = Config_getList(CITE_BIB_FILES).size();
2543  m_parent = parent;
2544  //printf("DocCite::DocCite(target=%s)\n",qPrint(target));
2545  ASSERT(!target.isEmpty());
2546  m_relPath = parser.context.relPath;
2548  const CiteInfo *cite = ct.find(target);
2549  //printf("cite=%p text='%s' numBibFiles=%d\n",cite,cite?qPrint(cite->text):"<null>",numBibFiles);
2550  if (numBibFiles>0 && cite && !cite->text().isEmpty()) // ref to citation
2551  {
2552  m_text = cite->text();
2553  m_ref = "";
2554  m_anchor = ct.anchorPrefix()+cite->label();
2556  //printf("CITE ==> m_text=%s,m_ref=%s,m_file=%s,m_anchor=%s\n",
2557  // qPrint(m_text),qPrint(m_ref),qPrint(m_file),qPrint(m_anchor));
2558  return;
2559  }
2560  m_text = target;
2561  if (numBibFiles==0)
2562  {
2563  warn_doc_error(parser.context.fileName,parser.tokenizer.getLineNr(),"\\cite command found but no bib files specified via CITE_BIB_FILES!");
2564  }
2565  else if (cite==0)
2566  {
2567  warn_doc_error(parser.context.fileName,parser.tokenizer.getLineNr(),"unable to resolve reference to '%s' for \\cite command",
2568  qPrint(target));
2569  }
2570  else
2571  {
2572  warn_doc_error(parser.context.fileName,parser.tokenizer.getLineNr(),"\\cite command to '%s' does not have an associated number",
2573  qPrint(target));
2574  }
2575 }

引用了 CitationManager::anchorPrefix(), ASSERT, Config_getList, DocParser::context, convertNameToFile(), FALSE, CitationManager::fileName(), DocParserContext::fileName, CitationManager::find(), DocTokenizer::getLineNr(), CitationManager::instance(), QCString::isEmpty(), CiteInfo::label(), m_anchor, m_file, DocNode::m_parent, m_ref, m_relPath, m_text, DocNode::parent(), qPrint(), DocParserContext::relPath, CiteInfo::text(), DocParser::tokenizer, TRUE , 以及 warn_doc_error().

成员函数说明

◆ accept()

void DocCite::accept ( DocVisitor v)
inlineoverridevirtual

Acceptor function for node visitors. Part of the visitor pattern.

参数
vAbstract visitor.

实现了 DocNode.

在文件 docparser.h331 行定义.

331 { v->visit(this); }

引用了 DocVisitor::visit().

◆ anchor()

QCString DocCite::anchor ( ) const
inline

在文件 docparser.h329 行定义.

329 { return m_anchor; }

引用了 m_anchor.

被这些函数引用 HtmlDocVisitor::visit(), DocbookDocVisitor::visit(), LatexDocVisitor::visit(), RTFDocVisitor::visit() , 以及 XmlDocVisitor::visit().

◆ file()

QCString DocCite::file ( ) const
inline

◆ kind()

Kind DocCite::kind ( ) const
inlineoverridevirtual

Returns the kind of node. Provides runtime type information

实现了 DocNode.

在文件 docparser.h325 行定义.

325 { return Kind_Ref; }

引用了 DocNode::Kind_Ref.

◆ ref()

QCString DocCite::ref ( ) const
inline

在文件 docparser.h328 行定义.

328 { return m_ref; }

引用了 m_ref.

被这些函数引用 HtmlDocVisitor::visit(), RTFDocVisitor::visit() , 以及 XmlDocVisitor::visit().

◆ relPath()

QCString DocCite::relPath ( ) const
inline

在文件 docparser.h327 行定义.

327 { return m_relPath; }

引用了 m_relPath.

被这些函数引用 HtmlDocVisitor::visit().

◆ text()

QCString DocCite::text ( ) const
inline

类成员变量说明

◆ m_anchor

QCString DocCite::m_anchor
private

在文件 docparser.h337 行定义.

被这些函数引用 anchor() , 以及 DocCite().

◆ m_file

QCString DocCite::m_file
private

在文件 docparser.h334 行定义.

被这些函数引用 DocCite() , 以及 file().

◆ m_ref

QCString DocCite::m_ref
private

在文件 docparser.h336 行定义.

被这些函数引用 DocCite() , 以及 ref().

◆ m_relPath

QCString DocCite::m_relPath
private

在文件 docparser.h335 行定义.

被这些函数引用 DocCite() , 以及 relPath().

◆ m_text

QCString DocCite::m_text
private

在文件 docparser.h338 行定义.

被这些函数引用 DocCite() , 以及 text().


该类的文档由以下文件生成:
DocCite::m_text
QCString m_text
Definition: docparser.h:338
DocParser::context
DocParserContext context
Definition: docparser.cpp:175
DocParserContext::relPath
QCString relPath
Definition: docparser.cpp:111
CitationManager::find
const CiteInfo * find(const QCString &label) const
Return the citation info for a given label.
Definition: cite.cpp:75
DocVisitor::visit
virtual void visit(DocWord *)=0
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
DocParser::tokenizer
DocTokenizer tokenizer
Definition: docparser.cpp:176
warn_doc_error
void warn_doc_error(const QCString &file, int line, const char *fmt,...)
Definition: message.cpp:186
CitationManager::instance
static CitationManager & instance()
Definition: cite.cpp:56
DocNode::Kind_Ref
@ Kind_Ref
Definition: docparser.h:137
DocCite::m_file
QCString m_file
Definition: docparser.h:334
DocCite::m_relPath
QCString m_relPath
Definition: docparser.h:335
DocParserContext::fileName
QCString fileName
Definition: docparser.cpp:110
CitationManager
Citation manager class.
Definition: cite.h:37
DocCite::m_ref
QCString m_ref
Definition: docparser.h:336
CiteInfo::label
virtual QCString label() const =0
DocTokenizer::getLineNr
int getLineNr(void)
TRUE
#define TRUE
Definition: qcstring.h:36
CiteInfo
Citation-related data.
Definition: cite.h:25
DocCite::m_anchor
QCString m_anchor
Definition: docparser.h:337
CitationManager::fileName
QCString fileName() const
Definition: cite.cpp:96
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
convertNameToFile
QCString convertNameToFile(const QCString &name, bool allowDots, bool allowUnderscore)
Definition: util.cpp:3604
ASSERT
#define ASSERT(x)
Definition: qcstring.h:44
CiteInfo::text
virtual QCString text() const =0
DocNode::DocNode
DocNode(DocParser &parser)
Definition: docparser.h:157
DocNode::parent
DocNode * parent() const
Definition: docparser.h:166
CitationManager::anchorPrefix
QCString anchorPrefix() const
Definition: cite.cpp:101
DocNode::m_parent
DocNode * m_parent
Definition: docparser.h:182
Config_getList
#define Config_getList(name)
Definition: config.h:37
FALSE
#define FALSE
Definition: qcstring.h:33