My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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.

References DocNode::m_parent, and DocNode::parent().

: m_link(link),
m_copyBrief(copyBrief), m_copyDetails(copyDetails) { m_parent = parent; }

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.

{ /*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.

References DocNode::Kind_Copy.

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

Definition at line 605 of file docparser.h.

References m_link.

Referenced by XmlDocVisitor::visitPre(), and PrintDocVisitor::visitPre().

{ return m_link; }
void DocCopy::parse ( QList< DocNode > &  children)

Definition at line 2074 of file docparser.cpp.

References brief, DefinitionIntf::definitionType(), doc, docParserPopContext(), docParserPushContext(), doctokenizerYYlineno, findDocsForMemberOrCompound(), g_context, g_copyStack, g_fileName, g_hasParamCommand, g_hasReturnCommand, g_nodeStack, g_paramsFound, g_styleStack, Definition::getOuterScope(), Doxygen::globalScope, internalValidatingParseDoc(), m_copyBrief, m_copyDetails, m_link, DocNode::m_parent, Definition::name(), DefinitionIntf::TypeMember, and warn_doc_error().

{
QCString doc,brief;
Definition *def;
if (findDocsForMemberOrCompound(m_link,&doc,&brief,&def))
{
if (g_copyStack.findRef(def)==-1) // definition not parsed earlier
{
bool hasParamCommand = g_hasParamCommand;
bool hasReturnCommand = g_hasReturnCommand;
QDict<void> paramsFound = g_paramsFound;
//printf("..1 hasParamCommand=%d hasReturnCommand=%d paramsFound=%d\n",
// g_hasParamCommand,g_hasReturnCommand,g_paramsFound.count());
g_scope = def;
{
{
}
}
else if (def!=Doxygen::globalScope)
{
g_context=def->name();
}
g_styleStack.clear();
g_nodeStack.clear();
g_paramsFound.clear();
g_copyStack.append(def);
// make sure the descriptions end with a newline, so the parser will correctly
// handle them in all cases.
//printf("doc='%s'\n",doc.data());
//printf("brief='%s'\n",brief.data());
{
brief+='\n';
//printf("..2 hasParamCommand=%d hasReturnCommand=%d paramsFound=%d\n",
// g_hasParamCommand,g_hasReturnCommand,g_paramsFound.count());
hasParamCommand = hasParamCommand || g_hasParamCommand;
hasReturnCommand = hasReturnCommand || g_hasReturnCommand;
QDictIterator<void> it(g_paramsFound);
void *item;
for (;(item=it.current());++it)
{
paramsFound.insert(it.currentKey(),it.current());
}
}
{
doc+='\n';
//printf("..3 hasParamCommand=%d hasReturnCommand=%d paramsFound=%d\n",
// g_hasParamCommand,g_hasReturnCommand,g_paramsFound.count());
hasParamCommand = hasParamCommand || g_hasParamCommand;
hasReturnCommand = hasReturnCommand || g_hasReturnCommand;
QDictIterator<void> it(g_paramsFound);
void *item;
for (;(item=it.current());++it)
{
paramsFound.insert(it.currentKey(),it.current());
}
}
g_copyStack.remove(def);
ASSERT(g_styleStack.isEmpty());
ASSERT(g_nodeStack.isEmpty());
g_hasParamCommand = hasParamCommand;
g_hasReturnCommand = hasReturnCommand;
g_paramsFound = paramsFound;
//printf("..4 hasParamCommand=%d hasReturnCommand=%d paramsFound=%d\n",
// g_hasParamCommand,g_hasReturnCommand,g_paramsFound.count());
}
else // oops, recursion
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"recursive call chain of \\copydoc commands detected at %d\n",
doctokenizerYYlineno);
}
}
else
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"target %s of \\copydoc command not found",
qPrint(m_link));
}
}

Member Data Documentation

bool DocCopy::m_copyBrief
private

Definition at line 611 of file docparser.h.

Referenced by parse().

bool DocCopy::m_copyDetails
private

Definition at line 612 of file docparser.h.

Referenced by parse().

QCString DocCopy::m_link
private

Definition at line 610 of file docparser.h.

Referenced by link(), and parse().


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