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

#include <docparser.h>

Inheritance diagram for DocCopy:
DocNode

Public Member Functions

 DocCopy (DocNode *parent, const QCString &link, bool copyBrief, bool copyDetails)
 
Kind kind () const
 
QCString link () const
 
void accept (DocVisitor *)
 
void parse (QList< DocNode > &children)
 
- Public Member Functions inherited from DocNode
 DocNode ()
 
virtual ~DocNode ()
 
DocNodeparent () const
 
void setParent (DocNode *parent)
 
bool isPreformatted () const
 

Private Attributes

QCString m_link
 
bool m_copyBrief
 
bool m_copyDetails
 

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 a copy of documentation block.

Definition at line 598 of file docparser.h.

Constructor & Destructor Documentation

DocCopy::DocCopy ( DocNode parent,
const QCString link,
bool  copyBrief,
bool  copyDetails 
)
inline

Definition at line 601 of file docparser.h.

602  : m_link(link),
603  m_copyBrief(copyBrief), m_copyDetails(copyDetails) { m_parent = parent; }
DocNode * parent() const
Definition: docparser.h:147
QCString m_link
Definition: docparser.h:610
bool m_copyDetails
Definition: docparser.h:612
bool m_copyBrief
Definition: docparser.h:611
DocNode * m_parent
Definition: docparser.h:163

Member Function Documentation

void DocCopy::accept ( DocVisitor v)
inlinevirtual

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

Parameters
vAbstract visitor.

Implements DocNode.

Definition at line 606 of file docparser.h.

606 { /*CompAccept<DocCopy>::accept(this,v);*/ }
Kind DocCopy::kind ( ) const
inlinevirtual

Returns the kind of node. Provides runtime type information

Implements DocNode.

Definition at line 604 of file docparser.h.

604 { return Kind_Copy; }
QCString DocCopy::link ( ) const
inline

Definition at line 605 of file docparser.h.

605 { return m_link; }
QCString m_link
Definition: docparser.h:610
void DocCopy::parse ( QList< DocNode > &  children)

Definition at line 2059 of file docparser.cpp.

2060 {
2061  QCString doc,brief;
2062  Definition *def;
2063  if (findDocsForMemberOrCompound(m_link,&doc,&brief,&def))
2064  {
2065  if (g_copyStack.findRef(def)==-1) // definition not parsed earlier
2066  {
2067  bool hasParamCommand = g_hasParamCommand;
2068  bool hasReturnCommand = g_hasReturnCommand;
2069  QDict<void> paramsFound = g_paramsFound;
2070  //printf("..1 hasParamCommand=%d hasReturnCommand=%d paramsFound=%d\n",
2071  // g_hasParamCommand,g_hasReturnCommand,g_paramsFound.count());
2072 
2074  g_scope = def;
2075  if (def->definitionType()==Definition::TypeMember && def->getOuterScope())
2076  {
2077  if (def->getOuterScope()!=Doxygen::globalScope)
2078  {
2079  g_context=def->getOuterScope()->name();
2080  }
2081  }
2082  else if (def!=Doxygen::globalScope)
2083  {
2084  g_context=def->name();
2085  }
2086  g_styleStack.clear();
2087  g_nodeStack.clear();
2088  g_paramsFound.clear();
2089  g_copyStack.append(def);
2090  // make sure the descriptions end with a newline, so the parser will correctly
2091  // handle them in all cases.
2092  //printf("doc='%s'\n",doc.data());
2093  //printf("brief='%s'\n",brief.data());
2094  if (m_copyBrief)
2095  {
2096  brief+='\n';
2097  internalValidatingParseDoc(m_parent,children,brief);
2098 
2099  //printf("..2 hasParamCommand=%d hasReturnCommand=%d paramsFound=%d\n",
2100  // g_hasParamCommand,g_hasReturnCommand,g_paramsFound.count());
2101  hasParamCommand = hasParamCommand || g_hasParamCommand;
2102  hasReturnCommand = hasReturnCommand || g_hasReturnCommand;
2103  QDictIterator<void> it(g_paramsFound);
2104  void *item;
2105  for (;(item=it.current());++it)
2106  {
2107  paramsFound.insert(it.currentKey(),it.current());
2108  }
2109  }
2110  if (m_copyDetails)
2111  {
2112  doc+='\n';
2113  internalValidatingParseDoc(m_parent,children,doc);
2114 
2115  //printf("..3 hasParamCommand=%d hasReturnCommand=%d paramsFound=%d\n",
2116  // g_hasParamCommand,g_hasReturnCommand,g_paramsFound.count());
2117  hasParamCommand = hasParamCommand || g_hasParamCommand;
2118  hasReturnCommand = hasReturnCommand || g_hasReturnCommand;
2119  QDictIterator<void> it(g_paramsFound);
2120  void *item;
2121  for (;(item=it.current());++it)
2122  {
2123  paramsFound.insert(it.currentKey(),it.current());
2124  }
2125  }
2126  g_copyStack.remove(def);
2130 
2131  g_hasParamCommand = hasParamCommand;
2132  g_hasReturnCommand = hasReturnCommand;
2133  g_paramsFound = paramsFound;
2134 
2135  //printf("..4 hasParamCommand=%d hasReturnCommand=%d paramsFound=%d\n",
2136  // g_hasParamCommand,g_hasReturnCommand,g_paramsFound.count());
2137  }
2138  else // oops, recursion
2139  {
2140  warn_doc_error(g_fileName,doctokenizerYYlineno,"recursive call chain of \\copydoc commands detected at %d\n",
2142  }
2143  }
2144  else
2145  {
2146  warn_doc_error(g_fileName,doctokenizerYYlineno,"target %s of \\copydoc command not found",
2147  qPrint(m_link));
2148  }
2149 }
static QCString g_fileName
Definition: docparser.cpp:95
bool brief
static Definition * g_scope
Definition: docparser.cpp:86
void append(const type *d)
Definition: qlist.h:73
static QStack< DocStyleChange > g_styleStack
Definition: docparser.cpp:92
int findRef(const type *d) const
Definition: qlist.h:89
QCString m_link
Definition: docparser.h:610
bool m_copyDetails
Definition: docparser.h:612
int doctokenizerYYlineno
const bool FALSE
Definition: qglobal.h:370
void warn_doc_error(const char *file, int line, const char *fmt,...)
Definition: message.cpp:210
static bool g_hasReturnCommand
Definition: docparser.cpp:99
static QStack< DocNode > g_nodeStack
Definition: docparser.cpp:91
bool m_copyBrief
Definition: docparser.h:611
static NamespaceDef * globalScope
Definition: doxygen.h:128
virtual DefType definitionType() const =0
DocNode * m_parent
Definition: docparser.h:163
const QCString & name() const
Definition: definition.h:114
static bool g_hasParamCommand
Definition: docparser.cpp:98
bool isEmpty() const
Definition: qstack.h:57
static QList< Definition > g_copyStack
Definition: docparser.cpp:94
static QDict< void > g_paramsFound
Definition: docparser.cpp:100
static void docParserPopContext(bool keepParamInfo=FALSE)
Definition: docparser.cpp:191
static void docParserPushContext(bool saveParamInfo=TRUE)
Definition: docparser.cpp:148
virtual Definition * getOuterScope() const
static QCString g_context
Definition: docparser.cpp:87
static int internalValidatingParseDoc(DocNode *parent, QList< DocNode > &children, const QCString &doc)
Definition: docparser.cpp:1713
QCString doc
static bool findDocsForMemberOrCompound(const char *commandName, QCString *pDoc, QCString *pBrief, Definition **pDef)
Definition: docparser.cpp:716
void clear()
Definition: qstack.h:61
bool remove(uint i)
Definition: qlist.h:76
const char * qPrint(const char *s)
Definition: qcstring.h:797
const bool TRUE
Definition: qglobal.h:371
#define ASSERT(x)
Definition: qglobal.h:590

Member Data Documentation

bool DocCopy::m_copyBrief
private

Definition at line 611 of file docparser.h.

bool DocCopy::m_copyDetails
private

Definition at line 612 of file docparser.h.

QCString DocCopy::m_link
private

Definition at line 610 of file docparser.h.


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