Doxygen
Loading...
Searching...
No Matches
DocHRef Class Reference

Node representing a Hypertext reference. More...

#include <src/docnode.h>

+ Inheritance diagram for DocHRef:
+ Collaboration diagram for DocHRef:

Public Member Functions

 DocHRef (DocParser *parser, DocNodeVariant *parent, const HtmlAttribList &attribs, const QCString &url, const QCString &relPath, const QCString &file)
 
Token parse ()
 
QCString url () const
 
QCString file () const
 
QCString relPath () const
 
const HtmlAttribListattribs () const
 
- Public Member Functions inherited from DocCompoundNode
 DocCompoundNode (DocParser *parser, DocNodeVariant *parent)
 
DocNodeListchildren ()
 
const DocNodeListchildren () const
 
- Public Member Functions inherited from DocNode
 DocNode (DocParser *parser, DocNodeVariant *parent)
 
 ~DocNode ()=default
 
DocNodeVariantparent ()
 
const DocNodeVariantparent () const
 
DocNodeVariantthisVariant ()
 
const DocNodeVariantthisVariant () const
 
void setThisVariant (DocNodeVariant *thisVariant)
 
DocParserparser ()
 
const DocParserparser () const
 
void setParent (DocNodeVariant *parent)
 
bool isPreformatted () const
 

Private Attributes

HtmlAttribList m_attribs
 
QCString m_url
 
QCString m_relPath
 
QCString m_file
 

Additional Inherited Members

- Protected Types inherited from DocNode
enum  RefType { Unknown , Anchor , Section , Table }
 
- Protected Member Functions inherited from DocNode
void setInsidePreformatted (bool p)
 

Detailed Description

Node representing a Hypertext reference.

Definition at line 816 of file docnode.h.

Constructor & Destructor Documentation

◆ DocHRef()

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

Definition at line 819 of file docnode.h.

DocCompoundNode(DocParser *parser, DocNodeVariant *parent)
Definition docnode.h:140
HtmlAttribList m_attribs
Definition docnode.h:830
QCString url() const
Definition docnode.h:824
QCString m_file
Definition docnode.h:833
QCString relPath() const
Definition docnode.h:826
QCString file() const
Definition docnode.h:825
const HtmlAttribList & attribs() const
Definition docnode.h:827
QCString m_url
Definition docnode.h:831
QCString m_relPath
Definition docnode.h:832
DocParser * parser()
Definition docnode.h:97
DocNodeVariant * parent()
Definition docnode.h:89

References attribs(), DocCompoundNode::DocCompoundNode(), file(), m_attribs, m_file, m_relPath, m_url, DocNode::parent(), DocNode::parser(), relPath(), and url().

Member Function Documentation

◆ attribs()

const HtmlAttribList & DocHRef::attribs ( ) const
inline

Definition at line 827 of file docnode.h.

827{ return m_attribs; }

References m_attribs.

Referenced by DocHRef(), and HtmlDocVisitor::operator()().

◆ file()

QCString DocHRef::file ( ) const
inline

Definition at line 825 of file docnode.h.

825{ return m_file; }

References m_file.

Referenced by DocHRef(), DocbookDocVisitor::operator()(), and RTFDocVisitor::operator()().

◆ parse()

Token DocHRef::parse ( )

Definition at line 1450 of file docnode.cpp.

1451{
1452 AUTO_TRACE();
1453 Token retval(TokenRetval::RetVal_OK);
1454 auto ns = AutoNodeStack(parser(),thisVariant());
1455
1456 Token tok = parser()->tokenizer.lex();
1457 while (!tok.is_any_of(TokenRetval::TK_NONE, TokenRetval::TK_EOF))
1458 {
1459 if (!parser()->defaultHandleToken(thisVariant(),tok,children()))
1460 {
1461 switch (tok.value())
1462 {
1463 case TokenRetval::TK_HTMLTAG:
1464 {
1465 HtmlTagType tagId=Mappers::htmlTagMapper->map(parser()->context.token->name);
1466 if (tagId==HtmlTagType::HTML_A && parser()->context.token->endTag) // found </a> tag
1467 {
1468 goto endhref;
1469 }
1470 else if (tagId==HtmlTagType::HTML_BR)
1471 {
1472 children().append<DocLineBreak>(parser(),thisVariant(),parser()->context.token->attribs);
1473 }
1474 else
1475 {
1476 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected html tag <%s%s> found within <a href=...> context",
1477 parser()->context.token->endTag?"/":"",qPrint(parser()->context.token->name));
1478 }
1479 }
1480 break;
1481 default:
1482 parser()->errorHandleDefaultToken(thisVariant(),tok,children(),"<a>..</a> block");
1483 break;
1484 }
1485 }
1486 tok = parser()->tokenizer.lex();
1487 }
1488 if (tok.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1489 {
1490 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected end of comment while inside"
1491 " <a href=...> tag");
1492 }
1493endhref:
1495 return retval;
1496}
DocNodeList & children()
Definition docnode.h:142
DocNodeVariant * thisVariant()
Definition docnode.h:92
DocTokenizer tokenizer
void handlePendingStyleCommands(DocNodeVariant *parent, DocNodeList &children)
DocParserContext context
void errorHandleDefaultToken(DocNodeVariant *parent, Token tok, DocNodeList &children, const QCString &txt)
TokenRetval value() const
bool is_any_of(ARGS... args) const
HtmlTagType
Definition cmdmapper.h:169
#define AUTO_TRACE(...)
Definition docnode.cpp:46
#define warn_doc_error(file, line, fmt,...)
Definition message.h:74
const Mapper< HtmlTagType > * htmlTagMapper
const char * qPrint(const char *s)
Definition qcstring.h:672
void append(Args &&... args)
Append a new DocNodeVariant to the list by constructing it with type T and parameters Args.
Definition docnode.h:1393
TokenInfo * token
Definition docparser_p.h:92
HtmlAttribList attribs

References DocNodeList::append(), TokenInfo::attribs, AUTO_TRACE, DocCompoundNode::children(), DocParser::context, DocParser::errorHandleDefaultToken(), DocParser::handlePendingStyleCommands(), HTML_A, HTML_BR, Mappers::htmlTagMapper, Token::is_any_of(), DocTokenizer::lex(), DocNode::parser(), qPrint(), DocNode::thisVariant(), DocParserContext::token, DocParser::tokenizer, Token::value(), and warn_doc_error.

◆ relPath()

QCString DocHRef::relPath ( ) const
inline

Definition at line 826 of file docnode.h.

826{ return m_relPath; }

References m_relPath.

Referenced by DocHRef(), and HtmlDocVisitor::operator()().

◆ url()

Member Data Documentation

◆ m_attribs

HtmlAttribList DocHRef::m_attribs
private

Definition at line 830 of file docnode.h.

Referenced by attribs(), and DocHRef().

◆ m_file

QCString DocHRef::m_file
private

Definition at line 833 of file docnode.h.

Referenced by DocHRef(), and file().

◆ m_relPath

QCString DocHRef::m_relPath
private

Definition at line 832 of file docnode.h.

Referenced by DocHRef(), and relPath().

◆ m_url

QCString DocHRef::m_url
private

Definition at line 831 of file docnode.h.

Referenced by DocHRef(), and url().


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