Skip to main content

The DocAnchor Class Reference

Node representing an anchor. More...

Declaration

class DocAnchor { ... }

Included Headers

#include <src/docnode.h>

Base class

classDocNode

Abstract node interface with type information. More...

Public Constructors Index

DocAnchor (DocParser *parser, DocNodeVariant *parent, const QCString &id, bool newAnchor)

Public Member Functions Index

QCStringanchor () const
QCStringfile () const
const HtmlAttribList &attribs () const

Private Member Attributes Index

QCStringm_anchor
QCStringm_file
HtmlAttribListm_attribs

Description

Node representing an anchor.

Definition at line 228 of file docnode.h.

Public Constructors

DocAnchor()

DocAnchor::DocAnchor (DocParser * parser, DocNodeVariant * parent, const QCString & id, bool newAnchor)

Declaration at line 231 of file docnode.h, definition at line 209 of file docnode.cpp.

210{
211 if (id.isEmpty())
212 {
213 warn_doc_error(parser->context.fileName,parser->tokenizer.getLineNr(),"Empty anchor label");
214 return;
215 }
216
218 QCString anchorPrefix = ct.anchorPrefix();
219 if (id.left(anchorPrefix.length()) == anchorPrefix)
220 {
221 const CiteInfo *cite = ct.find(id.mid(anchorPrefix.length()));
222 if (cite)
223 {
225 m_anchor = id;
226 }
227 else
228 {
229 warn_doc_error(parser->context.fileName,parser->tokenizer.getLineNr(),"Invalid cite anchor id '{}'",id);
230 m_anchor = "invalid";
231 m_file = "invalid";
232 }
233 }
234 else if (newAnchor) // found <a name="label">
235 {
236 m_anchor = id;
237 }
238 else // found \anchor label
239 {
240 const SectionInfo *sec = SectionManager::instance().find(id);
241 if (sec)
242 {
243 //printf("Found anchor %s\n",qPrint(id));
244 m_file = sec->fileName();
245 m_anchor = sec->label();
246 }
247 else
248 {
249 warn_doc_error(parser->context.fileName,parser->tokenizer.getLineNr(),"Invalid anchor id '{}'",id);
250 m_anchor = "invalid";
251 m_file = "invalid";
252 }
253 }
254}

References CitationManager::anchorPrefix, convertNameToFile, DocNode::DocNode, FALSE, CitationManager::fileName, SectionInfo::fileName, CitationManager::find, LinkedMap< T, Hash, KeyEqual, Map >::find, CitationManager::instance, SectionManager::instance, SectionInfo::label, QCString::length, m_anchor, m_file, DocNode::parent, DocNode::parser, TRUE and warn_doc_error.

Public Member Functions

anchor()

attribs()

const HtmlAttribList & DocAnchor::attribs ()
inline

Definition at line 235 of file docnode.h.

235 const HtmlAttribList &attribs() const { return m_attribs; }

Reference m_attribs.

Referenced by HtmlDocVisitor::operator().

file()

QCString DocAnchor::file ()
inline

Private Member Attributes

m_anchor

QCString DocAnchor::m_anchor

Definition at line 238 of file docnode.h.

Referenced by anchor and DocAnchor.

m_attribs

HtmlAttribList DocAnchor::m_attribs

Definition at line 240 of file docnode.h.

Referenced by attribs.

m_file

QCString DocAnchor::m_file

Definition at line 239 of file docnode.h.

Referenced by DocAnchor and file.


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


Generated via doxygen2docusaurus by Doxygen 1.14.0.