Doxygen
DocAnchor类 参考

Node representing an anchor 更多...

#include <docparser.h>

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

Public 成员函数

 DocAnchor (DocParser &parser, DocNode *parent, const QCString &id, bool newAnchor)
 
Kind kind () const override
 
QCString anchor () const
 
QCString file () const
 
void accept (DocVisitor *v) override
 
const HtmlAttribListattribs () const
 
- Public 成员函数 继承自 DocNode
 DocNode (DocParser &parser)
 
virtual ~DocNode ()
 
DocNodeparent () const
 
void setParent (DocNode *parent)
 
bool isPreformatted () const
 

Private 属性

QCString m_anchor
 
QCString m_file
 
HtmlAttribList m_attribs
 

额外继承的成员函数

- 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 an anchor

在文件 docparser.h303 行定义.

构造及析构函数说明

◆ DocAnchor()

DocAnchor::DocAnchor ( DocParser parser,
DocNode parent,
const QCString id,
bool  newAnchor 
)

在文件 docparser.cpp1862 行定义.

1862  : DocNode(parser)
1863 {
1864  m_parent = parent;
1865  if (id.isEmpty())
1866  {
1867  warn_doc_error(parser.context.fileName,parser.tokenizer.getLineNr(),"Empty anchor label");
1868  return;
1869  }
1870 
1872  QCString anchorPrefix = ct.anchorPrefix();
1873  if (id.left(anchorPrefix.length()) == anchorPrefix)
1874  {
1875  const CiteInfo *cite = ct.find(id.mid(anchorPrefix.length()));
1876  if (cite)
1877  {
1879  m_anchor = id;
1880  }
1881  else
1882  {
1883  warn_doc_error(parser.context.fileName,parser.tokenizer.getLineNr(),"Invalid cite anchor id '%s'",qPrint(id));
1884  m_anchor = "invalid";
1885  m_file = "invalid";
1886  }
1887  }
1888  else if (newAnchor) // found <a name="label">
1889  {
1890  m_anchor = id;
1891  }
1892  else // found \anchor label
1893  {
1894  const SectionInfo *sec = SectionManager::instance().find(id);
1895  if (sec)
1896  {
1897  //printf("Found anchor %s\n",qPrint(id));
1898  m_file = sec->fileName();
1899  m_anchor = sec->label();
1900  }
1901  else
1902  {
1903  warn_doc_error(parser.context.fileName,parser.tokenizer.getLineNr(),"Invalid anchor id '%s'",qPrint(id));
1904  m_anchor = "invalid";
1905  m_file = "invalid";
1906  }
1907  }
1908 }

引用了 CitationManager::anchorPrefix(), DocParser::context, convertNameToFile(), FALSE, CitationManager::fileName(), SectionInfo::fileName(), DocParserContext::fileName, CitationManager::find(), LinkedMap< T, Hash, KeyEqual, Map >::find(), DocTokenizer::getLineNr(), CitationManager::instance(), SectionManager::instance(), SectionInfo::label(), QCString::length(), m_anchor, m_file, DocNode::m_parent, DocNode::parent(), qPrint(), DocParser::tokenizer, TRUE , 以及 warn_doc_error().

成员函数说明

◆ accept()

void DocAnchor::accept ( DocVisitor v)
inlineoverridevirtual

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

参数
vAbstract visitor.

实现了 DocNode.

在文件 docparser.h310 行定义.

310 { v->visit(this); }

引用了 DocVisitor::visit().

◆ anchor()

QCString DocAnchor::anchor ( ) const
inline

◆ attribs()

const HtmlAttribList& DocAnchor::attribs ( ) const
inline

在文件 docparser.h312 行定义.

312 { return m_attribs; }

引用了 m_attribs.

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

◆ file()

QCString DocAnchor::file ( ) const
inline

在文件 docparser.h309 行定义.

309 { return m_file; }

引用了 m_file.

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

◆ kind()

Kind DocAnchor::kind ( ) const
inlineoverridevirtual

Returns the kind of node. Provides runtime type information

实现了 DocNode.

在文件 docparser.h307 行定义.

307 { return Kind_Anchor; }

引用了 DocNode::Kind_Anchor.

类成员变量说明

◆ m_anchor

QCString DocAnchor::m_anchor
private

在文件 docparser.h315 行定义.

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

◆ m_attribs

HtmlAttribList DocAnchor::m_attribs
private

在文件 docparser.h317 行定义.

被这些函数引用 attribs().

◆ m_file

QCString DocAnchor::m_file
private

在文件 docparser.h316 行定义.

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


该类的文档由以下文件生成:
DocParser::context
DocParserContext context
Definition: docparser.cpp:175
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::length
uint length() const
Returns the length of the string, not counting the 0-terminator.
Definition: qcstring.h:147
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
SectionInfo::label
QCString label() const
Definition: section.h:65
DocParserContext::fileName
QCString fileName
Definition: docparser.cpp:110
DocAnchor::m_file
QCString m_file
Definition: docparser.h:316
CitationManager
Citation manager class.
Definition: cite.h:37
DocAnchor::m_anchor
QCString m_anchor
Definition: docparser.h:315
DocAnchor::m_attribs
HtmlAttribList m_attribs
Definition: docparser.h:317
DocTokenizer::getLineNr
int getLineNr(void)
SectionInfo::fileName
QCString fileName() const
Definition: section.h:70
TRUE
#define TRUE
Definition: qcstring.h:36
LinkedMap::find
const T * find(const std::string &key) const
Find an object given the key.
Definition: linkedmap.h:60
CiteInfo
Citation-related data.
Definition: cite.h:25
DocNode::Kind_Anchor
@ Kind_Anchor
Definition: docparser.h:127
SectionManager::instance
static SectionManager & instance()
returns a reference to the singleton
Definition: section.h:172
CitationManager::fileName
QCString fileName() const
Definition: cite.cpp:96
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
SectionInfo
class that provide information about a section.
Definition: section.h:49
convertNameToFile
QCString convertNameToFile(const QCString &name, bool allowDots, bool allowUnderscore)
Definition: util.cpp:3604
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
FALSE
#define FALSE
Definition: qcstring.h:33
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108