Doxygen
DocSecRefItem类 参考

Node representing a reference to a section 更多...

#include <docparser.h>

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

Public 成员函数

 DocSecRefItem (DocParser &parser, DocNode *parent, const QCString &target)
 
Kind kind () const override
 
QCString target () const
 
QCString file () const
 
QCString anchor () const
 
QCString relPath () const
 
QCString ref () const
 
bool refToTable () const
 
bool isSubPage () const
 
void parse ()
 
- Public 成员函数 继承自 CompAccept< DocSecRefItem >
 CompAccept (DocParser &parser)
 
void accept (DocVisitor *v) override
 
const DocNodeListchildren () const
 
DocNodeListchildren ()
 
- Public 成员函数 继承自 DocNode
 DocNode (DocParser &parser)
 
virtual ~DocNode ()
 
DocNodeparent () const
 
void setParent (DocNode *parent)
 
bool isPreformatted () const
 

Private 属性

QCString m_target
 
RefType m_refType = Unknown
 
bool m_isSubPage = false
 
QCString m_file
 
QCString m_relPath
 
QCString m_ref
 
QCString m_anchor
 

额外继承的成员函数

- 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 属性 继承自 CompAccept< DocSecRefItem >
DocNodeList m_children
 
- Protected 属性 继承自 DocNode
DocNodem_parent = 0
 
DocParserm_parser
 

详细描述

Node representing a reference to a section

在文件 docparser.h1023 行定义.

构造及析构函数说明

◆ DocSecRefItem()

DocSecRefItem::DocSecRefItem ( DocParser parser,
DocNode parent,
const QCString target 
)

在文件 docparser.cpp2206 行定义.

2206  :
2208 {
2209  m_parent = parent;
2210 }

引用了 DocNode::m_parent , 以及 DocNode::parent().

成员函数说明

◆ anchor()

QCString DocSecRefItem::anchor ( ) const
inline

在文件 docparser.h1030 行定义.

1030 { return m_anchor; }

引用了 m_anchor.

被这些函数引用 LatexDocVisitor::visitPost(), HtmlDocVisitor::visitPre(), LatexDocVisitor::visitPre() , 以及 XmlDocVisitor::visitPre().

◆ file()

QCString DocSecRefItem::file ( ) const
inline

◆ isSubPage()

bool DocSecRefItem::isSubPage ( ) const
inline

在文件 docparser.h1034 行定义.

1034 { return m_isSubPage; }

引用了 m_isSubPage.

被这些函数引用 LatexDocVisitor::visitPost(), HtmlDocVisitor::visitPre() , 以及 LatexDocVisitor::visitPre().

◆ kind()

Kind DocSecRefItem::kind ( ) const
inlineoverridevirtual

Returns the kind of node. Provides runtime type information

实现了 DocNode.

在文件 docparser.h1027 行定义.

1027 { return Kind_SecRefItem; }

引用了 DocNode::Kind_SecRefItem.

◆ parse()

void DocSecRefItem::parse ( )

在文件 docparser.cpp2212 行定义.

2213 {
2214  DBG(("DocSecRefItem::parse() start\n"));
2215  auto ns = AutoNodeStack(m_parser,this);
2216 
2218  int tok;
2219  while ((tok=m_parser.tokenizer.lex()))
2220  {
2221  if (!m_parser.defaultHandleToken(this,tok,m_children))
2222  {
2223  m_parser.errorHandleDefaultToken(this,tok,m_children,"\\refitem");
2224  }
2225  }
2228 
2229  if (!m_target.isEmpty())
2230  {
2233  if (sec==0 && lang==SrcLangExt_Markdown) // lookup as markdown file
2234  {
2236  }
2237  if (sec) // ref to section or anchor
2238  {
2239  // set defaults
2240  m_ref = sec->ref();
2242  m_refType = Section;
2243  m_anchor = sec->label();
2244  m_isSubPage = false;
2245  // adjust if needed
2246  switch (sec->type())
2247  {
2248  case SectionType::Page:
2249  {
2251  m_isSubPage = pd && pd->hasParentPage();
2252  if (!m_isSubPage)
2253  {
2254  m_anchor="";
2255  }
2256  }
2257  break;
2258  case SectionType::Anchor:
2259  m_refType = Anchor;
2260  break;
2261  case SectionType::Table:
2262  m_refType = Table;
2263  break;
2264  default:
2265  break;
2266  }
2267  //printf("m_ref=%s,m_file=%s,type=%d\n",
2268  // qPrint(m_ref),qPrint(m_file),m_refType);
2269  }
2270  else
2271  {
2272  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"reference to unknown section %s",
2273  qPrint(m_target));
2274  }
2275  }
2276  else
2277  {
2278  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"reference to empty target");
2279  }
2280 
2281  DBG(("DocSecRefItem::parse() end\n"));
2282 }

引用了 Anchor, DocNode::Anchor, DocParser::context, DBG, DocParser::defaultHandleToken(), DocParser::errorHandleDefaultToken(), SectionInfo::fileName(), DocParserContext::fileName, LinkedMap< T, Hash, KeyEqual, Map >::find(), getLanguageFromFileName(), DocTokenizer::getLineNr(), DocParser::handlePendingStyleCommands(), PageDef::hasParentPage(), SectionManager::instance(), QCString::isEmpty(), SectionInfo::label(), DocTokenizer::lex(), m_anchor, CompAccept< DocSecRefItem >::m_children, m_file, m_isSubPage, DocNode::m_parser, m_ref, m_refType, m_target, markdownFileNameToId(), Page, Doxygen::pageLinkedMap, qPrint(), SectionInfo::ref(), DocNode::Section, DocTokenizer::setStatePara(), DocTokenizer::setStateTitle(), SrcLangExt_Markdown, stripKnownExtensions(), Table, DocNode::Table, DocParser::tokenizer, SectionInfo::type() , 以及 warn_doc_error().

被这些函数引用 DocSecRefList::parse().

◆ ref()

QCString DocSecRefItem::ref ( ) const
inline

在文件 docparser.h1032 行定义.

1032 { return m_ref; }

引用了 m_ref.

被这些函数引用 LatexDocVisitor::visitPost(), HtmlDocVisitor::visitPre() , 以及 LatexDocVisitor::visitPre().

◆ refToTable()

bool DocSecRefItem::refToTable ( ) const
inline

在文件 docparser.h1033 行定义.

1033 { return m_refType==Table; }

引用了 m_refType , 以及 DocNode::Table.

被这些函数引用 LatexDocVisitor::visitPost() , 以及 LatexDocVisitor::visitPre().

◆ relPath()

QCString DocSecRefItem::relPath ( ) const
inline

在文件 docparser.h1031 行定义.

1031 { return m_relPath; }

引用了 m_relPath.

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

◆ target()

QCString DocSecRefItem::target ( ) const
inline

在文件 docparser.h1028 行定义.

1028 { return m_target; }

引用了 m_target.

被这些函数引用 PrintDocVisitor::visitPre().

类成员变量说明

◆ m_anchor

QCString DocSecRefItem::m_anchor
private

在文件 docparser.h1044 行定义.

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

◆ m_file

QCString DocSecRefItem::m_file
private

在文件 docparser.h1041 行定义.

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

◆ m_isSubPage

bool DocSecRefItem::m_isSubPage = false
private

在文件 docparser.h1040 行定义.

被这些函数引用 isSubPage() , 以及 parse().

◆ m_ref

QCString DocSecRefItem::m_ref
private

在文件 docparser.h1043 行定义.

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

◆ m_refType

RefType DocSecRefItem::m_refType = Unknown
private

在文件 docparser.h1039 行定义.

被这些函数引用 parse() , 以及 refToTable().

◆ m_relPath

QCString DocSecRefItem::m_relPath
private

在文件 docparser.h1042 行定义.

被这些函数引用 relPath().

◆ m_target

QCString DocSecRefItem::m_target
private

在文件 docparser.h1038 行定义.

被这些函数引用 parse() , 以及 target().


该类的文档由以下文件生成:
markdownFileNameToId
QCString markdownFileNameToId(const QCString &fileName)
processes string s and converts markdown into doxygen/html commands.
Definition: markdown.cpp:3053
DocSecRefItem::target
QCString target() const
Definition: docparser.h:1028
DocParser::context
DocParserContext context
Definition: docparser.cpp:175
DocSecRefItem::m_file
QCString m_file
Definition: docparser.h:1041
DocParserContext::relPath
QCString relPath
Definition: docparser.cpp:111
CompAccept< DocSecRefItem >
DocSecRefItem::m_anchor
QCString m_anchor
Definition: docparser.h:1044
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
DocParser::handlePendingStyleCommands
void handlePendingStyleCommands(DocNode *parent, DocNodeList &children)
Definition: docparser.cpp:912
Doxygen::pageLinkedMap
static PageLinkedMap * pageLinkedMap
Definition: doxygen.h:82
SrcLangExt
SrcLangExt
Language as given by extension
Definition: types.h:41
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
DocSecRefItem::m_target
QCString m_target
Definition: docparser.h:1038
SectionType::Table
@ Table
DocNode::Kind_SecRefItem
@ Kind_SecRefItem
Definition: docparser.h:139
SectionInfo::label
QCString label() const
Definition: section.h:65
SectionInfo::ref
QCString ref() const
Definition: section.h:68
DocSecRefItem::m_relPath
QCString m_relPath
Definition: docparser.h:1042
PageDef
A model of a page symbol.
Definition: pagedef.h:25
DocParser::defaultHandleToken
bool defaultHandleToken(DocNode *parent, int tok, DocNodeList &children, bool handleWord=TRUE)
Definition: docparser.cpp:1277
DocNode::Section
@ Section
Definition: docparser.h:183
DocParserContext::fileName
QCString fileName
Definition: docparser.cpp:110
DocNode::Anchor
@ Anchor
Definition: docparser.h:183
DocParser::errorHandleDefaultToken
void errorHandleDefaultToken(DocNode *parent, int tok, DocNodeList &children, const QCString &txt)
Definition: docparser.cpp:775
DocNode::m_parser
DocParser & m_parser
Definition: docparser.h:184
DocTokenizer::getLineNr
int getLineNr(void)
SectionInfo::fileName
QCString fileName() const
Definition: section.h:70
getLanguageFromFileName
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition: util.cpp:5574
LinkedMap::find
const T * find(const std::string &key) const
Find an object given the key.
Definition: linkedmap.h:60
SectionType::Page
@ Page
DocSecRefItem::m_isSubPage
bool m_isSubPage
Definition: docparser.h:1040
DocSecRefItem::m_refType
RefType m_refType
Definition: docparser.h:1039
SectionType::Anchor
@ Anchor
stripKnownExtensions
static QCString stripKnownExtensions(const QCString &text)
Definition: docparser.cpp:539
SectionManager::instance
static SectionManager & instance()
returns a reference to the singleton
Definition: section.h:172
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
SectionInfo
class that provide information about a section.
Definition: section.h:49
DocTokenizer::setStateTitle
void setStateTitle()
AutoNodeStack
Definition: docparser.cpp:186
SrcLangExt_Markdown
@ SrcLangExt_Markdown
Definition: types.h:57
DocTokenizer::lex
int lex()
DocNode::parent
DocNode * parent() const
Definition: docparser.h:166
DocTokenizer::setStatePara
void setStatePara()
DBG
#define DBG(x)
Definition: docparser.cpp:58
DocNode::Table
@ Table
Definition: docparser.h:183
SectionInfo::type
SectionType type() const
Definition: section.h:67
CompAccept< DocSecRefItem >::m_children
DocNodeList m_children
Definition: docparser.h:211
DocSecRefItem::m_ref
QCString m_ref
Definition: docparser.h:1043
DocNode::m_parent
DocNode * m_parent
Definition: docparser.h:182
PageDef::hasParentPage
virtual bool hasParentPage() const =0