Public Member Functions | Private Attributes | List of all members
DocAnchor Class Reference

#include <docparser.h>

Inheritance diagram for DocAnchor:
DocNode

Public Member Functions

 DocAnchor (DocNode *parent, const QCString &id, bool newAnchor)
 
Kind kind () const
 
QCString anchor () const
 
QCString file () const
 
void accept (DocVisitor *v)
 
- Public Member Functions inherited from DocNode
 DocNode ()
 
virtual ~DocNode ()
 
DocNodeparent () const
 
void setParent (DocNode *parent)
 
bool isPreformatted () const
 

Private Attributes

QCString m_anchor
 
QCString m_file
 

Additional Inherited Members

- Public Types inherited from 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
}
 
- Protected Member Functions inherited from DocNode
void setInsidePreformatted (bool p)
 
- Protected Attributes inherited from DocNode
DocNodem_parent
 

Detailed Description

Node representing an anchor

Definition at line 272 of file docparser.h.

Constructor & Destructor Documentation

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

Definition at line 1835 of file docparser.cpp.

1836 {
1837  m_parent = parent;
1838  if (id.isEmpty())
1839  {
1840  warn_doc_error(g_fileName,doctokenizerYYlineno,"Empty anchor label");
1841  }
1842  if (newAnchor) // found <a name="label">
1843  {
1844  m_anchor = id;
1845  }
1846  else if (id.left(CiteConsts::anchorPrefix.length()) == CiteConsts::anchorPrefix)
1847  {
1848  CiteInfo *cite = Doxygen::citeDict->find(id.mid(CiteConsts::anchorPrefix.length()));
1849  if (cite)
1850  {
1852  m_anchor = id;
1853  }
1854  else
1855  {
1856  warn_doc_error(g_fileName,doctokenizerYYlineno,"Invalid cite anchor id `%s'",qPrint(id));
1857  m_anchor = "invalid";
1858  m_file = "invalid";
1859  }
1860  }
1861  else // found \anchor label
1862  {
1864  if (sec)
1865  {
1866  //printf("Found anchor %s\n",id.data());
1867  m_file = sec->fileName;
1868  m_anchor = sec->label;
1869  if (g_sectionDict && g_sectionDict->find(id)==0)
1870  {
1871  //printf("Inserting in dictionary!\n");
1872  g_sectionDict->append(id,sec);
1873  }
1874  }
1875  else
1876  {
1877  warn_doc_error(g_fileName,doctokenizerYYlineno,"Invalid anchor id `%s'",qPrint(id));
1878  m_anchor = "invalid";
1879  m_file = "invalid";
1880  }
1881  }
1882 }
DocNode * parent() const
Definition: docparser.h:147
static QCString g_fileName
Definition: docparser.cpp:95
static CiteDict * citeDict
Definition: doxygen.h:146
static SectionDict * g_sectionDict
Definition: docparser.cpp:104
QCString m_file
Definition: docparser.h:283
int doctokenizerYYlineno
const bool FALSE
Definition: qglobal.h:370
QCString label
Definition: section.h:56
void warn_doc_error(const char *file, int line, const char *fmt,...)
Definition: message.cpp:210
void append(const char *key, const T *d)
Definition: sortdict.h:135
DocNode * m_parent
Definition: docparser.h:163
Citation-related data.
Definition: cite.h:34
QCString fileName
Definition: section.h:61
static SectionDict * sectionDict
Definition: doxygen.h:117
QCString m_anchor
Definition: docparser.h:282
static const QCString anchorPrefix
Definition: cite.h:30
CiteInfo * find(const char *label) const
Definition: cite.cpp:98
QCString convertNameToFile(const char *name, bool allowDots, bool allowUnderscore)
Definition: util.cpp:5354
static const QCString fileName
Definition: cite.h:29
T * find(const char *key)
Definition: sortdict.h:232
const char * qPrint(const char *s)
Definition: qcstring.h:797
const bool TRUE
Definition: qglobal.h:371

Member Function Documentation

void DocAnchor::accept ( DocVisitor v)
inlinevirtual

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

Parameters
vAbstract visitor.

Implements DocNode.

Definition at line 279 of file docparser.h.

279 { v->visit(this); }
virtual void visit(DocWord *)=0
QCString DocAnchor::anchor ( ) const
inline

Definition at line 277 of file docparser.h.

277 { return m_anchor; }
QCString m_anchor
Definition: docparser.h:282
QCString DocAnchor::file ( ) const
inline

Definition at line 278 of file docparser.h.

278 { return m_file; }
QCString m_file
Definition: docparser.h:283
Kind DocAnchor::kind ( ) const
inlinevirtual

Returns the kind of node. Provides runtime type information

Implements DocNode.

Definition at line 276 of file docparser.h.

276 { return Kind_Anchor; }

Member Data Documentation

QCString DocAnchor::m_anchor
private

Definition at line 282 of file docparser.h.

QCString DocAnchor::m_file
private

Definition at line 283 of file docparser.h.


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