Doxygen
DocHRef类 参考

Node representing a Hypertext reference 更多...

#include <docparser.h>

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

Public 成员函数

 DocHRef (DocParser &parser, DocNode *parent, const HtmlAttribList &attribs, const QCString &url, const QCString &relPath, const QCString &file)
 
int parse ()
 
QCString url () const
 
QCString file () const
 
QCString relPath () const
 
Kind kind () const override
 
const HtmlAttribListattribs () const
 
- Public 成员函数 继承自 CompAccept< DocHRef >
 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 属性

HtmlAttribList m_attribs
 
QCString m_url
 
QCString m_relPath
 
QCString m_file
 

额外继承的成员函数

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

详细描述

Node representing a Hypertext reference

在文件 docparser.h936 行定义.

构造及析构函数说明

◆ DocHRef()

DocHRef::DocHRef ( DocParser parser,
DocNode parent,
const HtmlAttribList attribs,
const QCString url,
const QCString relPath,
const QCString file 
)
inline

在文件 docparser.h939 行定义.

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

成员函数说明

◆ attribs()

const HtmlAttribList& DocHRef::attribs ( ) const
inline

在文件 docparser.h947 行定义.

947 { return m_attribs; }

引用了 m_attribs.

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

◆ file()

QCString DocHRef::file ( ) const
inline

在文件 docparser.h944 行定义.

944 { return m_file; }

引用了 m_file.

被这些函数引用 DocbookDocVisitor::visitPre() , 以及 RTFDocVisitor::visitPre().

◆ kind()

Kind DocHRef::kind ( ) const
inlineoverridevirtual

Returns the kind of node. Provides runtime type information

实现了 DocNode.

在文件 docparser.h946 行定义.

946 { return Kind_HRef; }

引用了 DocNode::Kind_HRef.

◆ parse()

int DocHRef::parse ( )

在文件 docparser.cpp2993 行定义.

2994 {
2995  int retval=RetVal_OK;
2996  auto ns = AutoNodeStack(m_parser,this);
2997  DBG(("DocHRef::parse() start\n"));
2998 
2999  int tok;
3000  while ((tok=m_parser.tokenizer.lex()))
3001  {
3002  if (!m_parser.defaultHandleToken(this,tok,m_children))
3003  {
3004  switch (tok)
3005  {
3006  case TK_HTMLTAG:
3007  {
3009  if (tagId==HTML_A && m_parser.context.token->endTag) // found </a> tag
3010  {
3011  goto endhref;
3012  }
3013  else if (tagId==HTML_BR)
3014  {
3015  m_children.push_back(std::make_unique<DocLineBreak>(m_parser,this,m_parser.context.token->attribs));
3016  }
3017  else
3018  {
3019  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"Unexpected html tag <%s%s> found within <a href=...> context",
3021  }
3022  }
3023  break;
3024  default:
3025  m_parser.errorHandleDefaultToken(this,tok,m_children,"<a>..</a> block");
3026  break;
3027  }
3028  }
3029  }
3030  if (tok==0)
3031  {
3032  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"Unexpected end of comment while inside"
3033  " <a href=...> tag");
3034  }
3035 endhref:
3037  DBG(("DocHRef::parse() end\n"));
3038  return retval;
3039 }

引用了 TokenInfo::attribs, DocParser::context, DBG, DocParser::defaultHandleToken(), TokenInfo::endTag, DocParser::errorHandleDefaultToken(), DocParserContext::fileName, DocTokenizer::getLineNr(), DocParser::handlePendingStyleCommands(), HTML_A, HTML_BR, Mappers::htmlTagMapper, DocTokenizer::lex(), CompAccept< DocHRef >::m_children, DocNode::m_parser, Mapper::map(), TokenInfo::name, qPrint(), RetVal_OK, TK_HTMLTAG, DocParserContext::token, DocParser::tokenizer , 以及 warn_doc_error().

被这些函数引用 DocParser::handleAHref().

◆ relPath()

QCString DocHRef::relPath ( ) const
inline

在文件 docparser.h945 行定义.

945 { return m_relPath; }

引用了 m_relPath.

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

◆ url()

QCString DocHRef::url ( ) const
inline

类成员变量说明

◆ m_attribs

HtmlAttribList DocHRef::m_attribs
private

在文件 docparser.h950 行定义.

被这些函数引用 attribs().

◆ m_file

QCString DocHRef::m_file
private

在文件 docparser.h953 行定义.

被这些函数引用 file().

◆ m_relPath

QCString DocHRef::m_relPath
private

在文件 docparser.h952 行定义.

被这些函数引用 relPath().

◆ m_url

QCString DocHRef::m_url
private

在文件 docparser.h951 行定义.

被这些函数引用 url().


该类的文档由以下文件生成:
TokenInfo::endTag
bool endTag
Definition: doctokenizer.h:100
DocHRef::m_attribs
HtmlAttribList m_attribs
Definition: docparser.h:950
DocParserContext::token
TokenInfo * token
Definition: docparser.cpp:129
DocParser::context
DocParserContext context
Definition: docparser.cpp:175
CompAccept< DocHRef >
TokenInfo::name
QCString name
Definition: doctokenizer.h:74
RetVal_OK
@ RetVal_OK
Command starting with \
Definition: doctokenizer.h:59
DocParser::handlePendingStyleCommands
void handlePendingStyleCommands(DocNode *parent, DocNodeList &children)
Definition: docparser.cpp:912
DocHRef::attribs
const HtmlAttribList & attribs() const
Definition: docparser.h:947
DocHRef::file
QCString file() const
Definition: docparser.h:944
TokenInfo::attribs
HtmlAttribList attribs
Definition: doctokenizer.h:99
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
DocNode::Kind_HRef
@ Kind_HRef
Definition: docparser.h:130
DocParser::defaultHandleToken
bool defaultHandleToken(DocNode *parent, int tok, DocNodeList &children, bool handleWord=TRUE)
Definition: docparser.cpp:1277
Mappers::htmlTagMapper
static Mapper * htmlTagMapper
Definition: cmdmapper.h:235
DocParserContext::fileName
QCString fileName
Definition: docparser.cpp:110
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
DocHRef::url
QCString url() const
Definition: docparser.h:943
DocTokenizer::getLineNr
int getLineNr(void)
DocHRef::m_url
QCString m_url
Definition: docparser.h:951
HTML_A
@ HTML_A
Definition: cmdmapper.h:172
TK_HTMLTAG
@ TK_HTMLTAG
Command starting with @
Definition: doctokenizer.h:52
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
AutoNodeStack
Definition: docparser.cpp:186
Mapper::map
int map(const QCString &n)
Definition: cmdmapper.cpp:237
DocHRef::relPath
QCString relPath() const
Definition: docparser.h:945
DocTokenizer::lex
int lex()
DocNode::parent
DocNode * parent() const
Definition: docparser.h:166
DocHRef::m_relPath
QCString m_relPath
Definition: docparser.h:952
DBG
#define DBG(x)
Definition: docparser.cpp:58
DocHRef::m_file
QCString m_file
Definition: docparser.h:953
CompAccept< DocHRef >::m_children
DocNodeList m_children
Definition: docparser.h:211
HTML_BR
@ HTML_BR
Definition: cmdmapper.h:171
DocNode::m_parent
DocNode * m_parent
Definition: docparser.h:182