Commit 21587da4 authored by dimitri's avatar dimitri

Release-1.2.14-20020324

parent ca3fb0a6
DOXYGEN Version 1.2.14-20020317 DOXYGEN Version 1.2.14-20020324
Please read the installation section of the manual for instructions. Please read the installation section of the manual for instructions.
-------- --------
Dimitri van Heesch (17 March 2002) Dimitri van Heesch (24 March 2002)
DOXYGEN Version 1.2.14_20020317 DOXYGEN Version 1.2.14_20020324
Please read INSTALL for compilation instructions. Please read INSTALL for compilation instructions.
...@@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives. ...@@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives.
Enjoy, Enjoy,
Dimitri van Heesch (dimitri@stack.nl) (17 March 2002) Dimitri van Heesch (dimitri@stack.nl) (24 March 2002)
1.2.14-20020317 1.2.14-20020324
...@@ -391,7 +391,7 @@ class IDocIterator ...@@ -391,7 +391,7 @@ class IDocIterator
class IEdgeLabel class IEdgeLabel
{ {
public: public:
virtual QString label() = 0; virtual QString label() const = 0;
}; };
class IEdgeLabelIterator class IEdgeLabelIterator
...@@ -409,10 +409,11 @@ class IChildNode ...@@ -409,10 +409,11 @@ class IChildNode
{ {
public: public:
enum NodeRelation { PublicInheritance, ProtectedInheritance, enum NodeRelation { PublicInheritance, ProtectedInheritance,
PrivateInheritance, Usage, TemplateInstace PrivateInheritance, Usage, TemplateInstance
}; };
virtual QString id() const = 0; virtual QString id() const = 0;
virtual NodeRelation relation() const = 0; virtual NodeRelation relation() const = 0;
virtual QString relationString() const = 0;
virtual IEdgeLabelIterator *edgeLabels() const = 0; virtual IEdgeLabelIterator *edgeLabels() const = 0;
}; };
...@@ -551,6 +552,8 @@ class ICompound ...@@ -551,6 +552,8 @@ class ICompound
virtual ISectionIterator *sections() const = 0; virtual ISectionIterator *sections() const = 0;
virtual IDocRoot *briefDescription() const = 0; virtual IDocRoot *briefDescription() const = 0;
virtual IDocRoot *detailedDescription() const = 0; virtual IDocRoot *detailedDescription() const = 0;
virtual IGraph *inheritanceGraph() const = 0;
virtual IGraph *collaborationGraph() const = 0;
/*! Returns an interface to a member given its id. /*! Returns an interface to a member given its id.
* @param id The member id. * @param id The member id.
......
...@@ -98,7 +98,7 @@ void compoundhandler_exit() ...@@ -98,7 +98,7 @@ void compoundhandler_exit()
CompoundHandler::CompoundHandler(const QString &xmlDir) CompoundHandler::CompoundHandler(const QString &xmlDir)
: m_brief(0), m_detailed(0), m_programListing(0), : m_brief(0), m_detailed(0), m_programListing(0),
m_xmlDir(xmlDir), m_refCount(1), m_memberDict(257), m_memberNameDict(257), m_xmlDir(xmlDir), m_refCount(1), m_memberDict(257), m_memberNameDict(257),
m_mainHandler(0) m_mainHandler(0), m_inheritanceGraph(0), m_collaborationGraph(0)
{ {
m_superClasses.setAutoDelete(TRUE); m_superClasses.setAutoDelete(TRUE);
m_subClasses.setAutoDelete(TRUE); m_subClasses.setAutoDelete(TRUE);
...@@ -311,3 +311,13 @@ IMember *CompoundHandler::memberById(const QString &id) const ...@@ -311,3 +311,13 @@ IMember *CompoundHandler::memberById(const QString &id) const
return m_memberDict[id]; return m_memberDict[id];
} }
IGraph *CompoundHandler::inheritanceGraph() const
{
return m_inheritanceGraph;
}
IGraph *CompoundHandler::collaborationGraph() const
{
return m_collaborationGraph;
}
...@@ -60,6 +60,8 @@ class CompoundHandler : public ICompound, public BaseHandler<CompoundHandler> ...@@ -60,6 +60,8 @@ class CompoundHandler : public ICompound, public BaseHandler<CompoundHandler>
ISectionIterator *sections() const; ISectionIterator *sections() const;
IDocRoot *briefDescription() const; IDocRoot *briefDescription() const;
IDocRoot *detailedDescription() const; IDocRoot *detailedDescription() const;
IGraph *inheritanceGraph() const;
IGraph *collaborationGraph() const;
IMember *memberById(const QString &id) const; IMember *memberById(const QString &id) const;
IMemberIterator *memberByName(const QString &name) const; IMemberIterator *memberByName(const QString &name) const;
void release(); void release();
......
...@@ -391,7 +391,7 @@ class IDocIterator ...@@ -391,7 +391,7 @@ class IDocIterator
class IEdgeLabel class IEdgeLabel
{ {
public: public:
virtual QString label() = 0; virtual QString label() const = 0;
}; };
class IEdgeLabelIterator class IEdgeLabelIterator
...@@ -409,10 +409,11 @@ class IChildNode ...@@ -409,10 +409,11 @@ class IChildNode
{ {
public: public:
enum NodeRelation { PublicInheritance, ProtectedInheritance, enum NodeRelation { PublicInheritance, ProtectedInheritance,
PrivateInheritance, Usage, TemplateInstace PrivateInheritance, Usage, TemplateInstance
}; };
virtual QString id() const = 0; virtual QString id() const = 0;
virtual NodeRelation relation() const = 0; virtual NodeRelation relation() const = 0;
virtual QString relationString() const = 0;
virtual IEdgeLabelIterator *edgeLabels() const = 0; virtual IEdgeLabelIterator *edgeLabels() const = 0;
}; };
...@@ -551,6 +552,8 @@ class ICompound ...@@ -551,6 +552,8 @@ class ICompound
virtual ISectionIterator *sections() const = 0; virtual ISectionIterator *sections() const = 0;
virtual IDocRoot *briefDescription() const = 0; virtual IDocRoot *briefDescription() const = 0;
virtual IDocRoot *detailedDescription() const = 0; virtual IDocRoot *detailedDescription() const = 0;
virtual IGraph *inheritanceGraph() const = 0;
virtual IGraph *collaborationGraph() const = 0;
/*! Returns an interface to a member given its id. /*! Returns an interface to a member given its id.
* @param id The member id. * @param id The member id.
......
#include "graphhandler.h" #include "graphhandler.h"
class EdgeRelationMapper
{
public:
EdgeRelationMapper()
{
m_map.insert("public-inheritance", IChildNode::PublicInheritance);
m_map.insert("protected-inheritance", IChildNode::ProtectedInheritance);
m_map.insert("private-inheritance", IChildNode::PrivateInheritance);
m_map.insert("usage", IChildNode::Usage);
m_map.insert("template-instance", IChildNode::TemplateInstance);
}
IChildNode::NodeRelation stringToNodeRelation(const QString &nrStr)
{
return m_map[nrStr];
}
private:
QMap<QString,IChildNode::NodeRelation> m_map;
};
static EdgeRelationMapper *s_edgeRelationMapper;
void graphhandler_init()
{
s_edgeRelationMapper = new EdgeRelationMapper;
}
void graphhandler_exit()
{
delete s_edgeRelationMapper;
}
//------------------------------------------------------------------------
GraphHandler::GraphHandler(IBaseHandler *parent,const char *endTag) GraphHandler::GraphHandler(IBaseHandler *parent,const char *endTag)
: m_parent(parent) : m_parent(parent)
{ {
...@@ -44,6 +77,8 @@ NodeHandler::NodeHandler(IBaseHandler *parent) ...@@ -44,6 +77,8 @@ NodeHandler::NodeHandler(IBaseHandler *parent)
addEndHandler("link",this,&NodeHandler::endLink); addEndHandler("link",this,&NodeHandler::endLink);
addStartHandler("label",this,&NodeHandler::startLabel); addStartHandler("label",this,&NodeHandler::startLabel);
addEndHandler("label",this,&NodeHandler::endLabel); addEndHandler("label",this,&NodeHandler::endLabel);
addStartHandler("childnode",this,&NodeHandler::startChildNode);
m_children.setAutoDelete(TRUE);
} }
NodeHandler::~NodeHandler() NodeHandler::~NodeHandler()
...@@ -80,6 +115,81 @@ void NodeHandler::endLabel() ...@@ -80,6 +115,81 @@ void NodeHandler::endLabel()
m_label = m_curString; m_label = m_curString;
} }
void NodeHandler::startChildNode(const QXmlAttributes &attrib)
{
ChildNodeHandler *cnh = new ChildNodeHandler(this);
cnh->startChildNode(attrib);
m_children.append(cnh);
}
IChildNodeIterator *NodeHandler::children() const
{
return new ChildNodeIterator(*this);
}
//------------------------------------------------------------------------
ChildNodeHandler::ChildNodeHandler(IBaseHandler *parent)
: m_parent(parent)
{
addStartHandler("edgelabel",this,&ChildNodeHandler::startEdgeLabel);
m_edgeLabels.setAutoDelete(TRUE);
}
ChildNodeHandler::~ChildNodeHandler()
{
}
void ChildNodeHandler::startChildNode(const QXmlAttributes &attrib)
{
m_id = attrib.value("id");
m_relationString = attrib.value("relation");
m_relation = s_edgeRelationMapper->stringToNodeRelation(m_relationString);
m_parent->setDelegate(this);
}
void ChildNodeHandler::endChildNode()
{
m_parent->setDelegate(0);
}
void ChildNodeHandler::startEdgeLabel(const QXmlAttributes &attrib)
{
EdgeLabelHandler *elh = new EdgeLabelHandler(this);
elh->startEdgeLabel(attrib);
m_edgeLabels.append(elh);
}
IEdgeLabelIterator *ChildNodeHandler::edgeLabels() const
{
return new EdgeLabelIterator(*this);
}
//-----------------------------------------------------------------------
EdgeLabelHandler::EdgeLabelHandler(IBaseHandler *parent)
: m_parent(parent)
{
}
EdgeLabelHandler::~EdgeLabelHandler()
{
}
void EdgeLabelHandler::startEdgeLabel(const QXmlAttributes &)
{
m_parent->setDelegate(this);
m_curString="";
}
void EdgeLabelHandler::endEdgeLabel()
{
m_label=m_curString;
m_parent->setDelegate(0);
}
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
class NodeHandler; class NodeHandler;
class ChildNodeHandler; class ChildNodeHandler;
class EdgeLabelHandler;
class GraphHandler : public IGraph, public BaseHandler<GraphHandler> class GraphHandler : public IGraph, public BaseHandler<GraphHandler>
{ {
...@@ -57,12 +58,13 @@ class NodeHandler : public INode, public BaseHandler<NodeHandler> ...@@ -57,12 +58,13 @@ class NodeHandler : public INode, public BaseHandler<NodeHandler>
void endLabel(); void endLabel();
void startLink(const QXmlAttributes &attrib); void startLink(const QXmlAttributes &attrib);
void endLink(); void endLink();
void startChildNode(const QXmlAttributes &attrib);
// INode // INode
virtual QString id() const { return m_id; } virtual QString id() const { return m_id; }
virtual QString label() const { return m_label; } virtual QString label() const { return m_label; }
virtual QString linkId() const { return m_link; } virtual QString linkId() const { return m_link; }
virtual IChildNodeIterator *children() const { return 0; } // TODO: implement virtual IChildNodeIterator *children() const;
private: private:
IBaseHandler *m_parent; IBaseHandler *m_parent;
...@@ -83,19 +85,27 @@ class NodeIterator : public BaseIterator<INodeIterator,INode,NodeHandler> ...@@ -83,19 +85,27 @@ class NodeIterator : public BaseIterator<INodeIterator,INode,NodeHandler>
class ChildNodeHandler : public IChildNode, public BaseHandler<ChildNodeHandler> class ChildNodeHandler : public IChildNode, public BaseHandler<ChildNodeHandler>
{ {
friend class EdgeLabelIterator;
public: public:
ChildNodeHandler(IBaseHandler *parent); ChildNodeHandler(IBaseHandler *parent);
virtual ~ChildNodeHandler(); virtual ~ChildNodeHandler();
void startChildNode(const QXmlAttributes &attrib); void startChildNode(const QXmlAttributes &attrib);
void endChildNode(); void endChildNode();
void startEdgeLabel(const QXmlAttributes &attrib);
// IChildNode // IChildNode
virtual QString id() const { return m_id; } virtual QString id() const { return m_id; }
virtual NodeRelation relation() const { return m_relation; }
virtual QString relationString() const { return m_relationString; }
virtual IEdgeLabelIterator *edgeLabels() const;
private: private:
IBaseHandler *m_parent; IBaseHandler *m_parent;
QString m_id; QString m_id;
NodeRelation m_relation;
QString m_relationString;
QList<EdgeLabelHandler> m_edgeLabels;
}; };
class ChildNodeIterator : public BaseIterator<IChildNodeIterator,IChildNode,ChildNodeHandler> class ChildNodeIterator : public BaseIterator<IChildNodeIterator,IChildNode,ChildNodeHandler>
...@@ -105,6 +115,35 @@ class ChildNodeIterator : public BaseIterator<IChildNodeIterator,IChildNode,Chil ...@@ -105,6 +115,35 @@ class ChildNodeIterator : public BaseIterator<IChildNodeIterator,IChildNode,Chil
BaseIterator<IChildNodeIterator,IChildNode,ChildNodeHandler>(handler.m_children) {} BaseIterator<IChildNodeIterator,IChildNode,ChildNodeHandler>(handler.m_children) {}
}; };
//----------------------------------------------------------------------
class EdgeLabelHandler : public IEdgeLabel, public BaseHandler<EdgeLabelHandler>
{
friend class EdgeLabelIterator;
public:
EdgeLabelHandler(IBaseHandler *parent);
virtual ~EdgeLabelHandler();
void startEdgeLabel(const QXmlAttributes &attrib);
void endEdgeLabel();
// IEdgeLabel
virtual QString label() const { return m_label; }
private:
IBaseHandler *m_parent;
QString m_label;
};
class EdgeLabelIterator : public BaseIterator<IEdgeLabelIterator,IEdgeLabel,EdgeLabelHandler>
{
public:
EdgeLabelIterator(const ChildNodeHandler &handler) :
BaseIterator<IEdgeLabelIterator,IEdgeLabel,EdgeLabelHandler>(handler.m_edgeLabels) {}
};
void graphhandler_init();
void graphhandler_exit();
#endif #endif
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "mainhandler.h" #include "mainhandler.h"
#include "compoundhandler.h" #include "compoundhandler.h"
#include "sectionhandler.h" #include "sectionhandler.h"
#include "graphhandler.h"
#include "debug.h" #include "debug.h"
class ErrorHandler : public QXmlErrorHandler class ErrorHandler : public QXmlErrorHandler
...@@ -256,6 +257,7 @@ IDoxygen *createObjectModel() ...@@ -256,6 +257,7 @@ IDoxygen *createObjectModel()
sectionhandler_init(); sectionhandler_init();
memberhandler_init(); memberhandler_init();
dochandler_init(); dochandler_init();
graphhandler_init();
return new MainHandler; return new MainHandler;
} }
...@@ -267,6 +269,7 @@ void MainHandler::release() ...@@ -267,6 +269,7 @@ void MainHandler::release()
{ {
debug(1,"Compound %s not released\n",ch->name().data()); debug(1,"Compound %s not released\n",ch->name().data());
} }
graphhandler_exit();
dochandler_exit(); dochandler_exit();
memberhandler_exit(); memberhandler_exit();
sectionhandler_exit(); sectionhandler_exit();
......
...@@ -155,6 +155,7 @@ followed by the descriptions of the tags grouped by category. ...@@ -155,6 +155,7 @@ followed by the descriptions of the tags grouped by category.
<li> \refitem cfg_max_dot_graph_width MAX_DOT_GRAPH_WIDTH <li> \refitem cfg_max_dot_graph_width MAX_DOT_GRAPH_WIDTH
<li> \refitem cfg_max_initializer_lines MAX_INITIALIZER_LINES <li> \refitem cfg_max_initializer_lines MAX_INITIALIZER_LINES
<li> \refitem cfg_optimize_output_for_c OPTIMIZE_OUTPUT_FOR_C <li> \refitem cfg_optimize_output_for_c OPTIMIZE_OUTPUT_FOR_C
<li> \refitem cfg_optimize_output_java OPTIMIZE_OUTPUT_JAVA
<li> \refitem cfg_output_directory OUTPUT_DIRECTORY <li> \refitem cfg_output_directory OUTPUT_DIRECTORY
<li> \refitem cfg_output_language OUTPUT_LANGUAGE <li> \refitem cfg_output_language OUTPUT_LANGUAGE
<li> \refitem cfg_paper_type PAPER_TYPE <li> \refitem cfg_paper_type PAPER_TYPE
...@@ -498,6 +499,14 @@ followed by the descriptions of the tags grouped by category. ...@@ -498,6 +499,14 @@ followed by the descriptions of the tags grouped by category.
for C. For instance some of the names that are used will be different. for C. For instance some of the names that are used will be different.
The list of all members will be omitted, etc. The list of all members will be omitted, etc.
\anchor cfg_optimize_output_java
<dt>\c OPTIMIZE_OUTPUT_JAVA <dd>
\addindex OPTIMIZE_OUTPUT_JAVA
Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources
only. Doxygen will then generate output that is more tailored for Java.
For instance namespaces will be presented as packages, qualified scopes
will look different, etc.
\anchor cfg_show_used_files \anchor cfg_show_used_files
<dt>\c SHOW_USED_FILES <dd> <dt>\c SHOW_USED_FILES <dd>
\addindex SHOW_USED_FILES \addindex SHOW_USED_FILES
......
...@@ -178,8 +178,9 @@ Thanks go to: ...@@ -178,8 +178,9 @@ Thanks go to:
<li>Ken Wong for providing the HTML tree view code. <li>Ken Wong for providing the HTML tree view code.
<li>Petr Prikryl for coordinating the internationalisation support. <li>Petr Prikryl for coordinating the internationalisation support.
All language maintainers for providing translations into many languages. All language maintainers for providing translations into many languages.
<li>Erik Jan Lingen of <a href="http://www.habanera.nl/">Habanera</a> for <li>Erik Jan Lingen of <a href="http://www.habanera.nl/">Habanera</a>, Mark
donating money. Roddy, Paul Schwartz, Charles Duffy, and Vadym Voznyuk
for donating money.
<li>The Comms group of <a href="http://www.symbian.com">Symbian</a> for donating <li>The Comms group of <a href="http://www.symbian.com">Symbian</a> for donating
an ultra cool <a href="http://www.psion.com/revoplus>Revo plus</a> an ultra cool <a href="http://www.psion.com/revoplus>Revo plus</a>
organizer! organizer!
......
...@@ -25,7 +25,7 @@ Doxygen has built-in support for multiple languages. This means ...@@ -25,7 +25,7 @@ Doxygen has built-in support for multiple languages. This means
that the text fragments that doxygen generates can be produced in that the text fragments that doxygen generates can be produced in
languages other than English (the default) at configuration time. languages other than English (the default) at configuration time.
Currently (version 1.2.14-20020310), 25 languages Currently (version 1.2.14-20020317), 25 languages
are supported (sorted alphabetically): are supported (sorted alphabetically):
Brazilian Portuguese, Chinese, Croatian, Czech, Danish, Brazilian Portuguese, Chinese, Croatian, Czech, Danish,
Dutch, English, Finnish, French, German, Dutch, English, Finnish, French, German,
......
...@@ -184,7 +184,12 @@ basically two options: ...@@ -184,7 +184,12 @@ basically two options:
namespace or file). See section \ref structuralcommands to learn more namespace or file). See section \ref structuralcommands to learn more
about structural commands. about structural commands.
</ol> </ol>
Files can only be documented using the second option. Files can only be documented using the second option, since there is
no way to but a documentation block before a file. Of course, file members
(functions, variable, typedefs, defines) do not need an explicit
structural command; just putting a special documentation block in front or
behind them will do.
The text inside a special documentation block is parsed The text inside a special documentation block is parsed
before it is written to the HTML and/or \f$\mbox{\LaTeX}\f$ output files. before it is written to the HTML and/or \f$\mbox{\LaTeX}\f$ output files.
......
Summary: A documentation system for C/C++. Summary: A documentation system for C/C++.
Name: doxygen Name: doxygen
Version: 1.2.14_20020317 Version: 1.2.14_20020324
Release: 1 Release: 1
Epoch: 1 Epoch: 1
Source0: ftp://ftp.stack.nl/pub/users/dimitri/%{name}-%{version}.src.tar.gz Source0: ftp://ftp.stack.nl/pub/users/dimitri/%{name}-%{version}.src.tar.gz
......
...@@ -700,7 +700,7 @@ void ClassDef::writeDocumentation(OutputList &ol) ...@@ -700,7 +700,7 @@ void ClassDef::writeDocumentation(OutputList &ol)
if (outerTempArgList) pageTitle.prepend(" Template"); if (outerTempArgList) pageTitle.prepend(" Template");
startFile(ol,getOutputFileBase(),name(),pageTitle); startFile(ol,getOutputFileBase(),name(),pageTitle);
startTitle(ol,getOutputFileBase()); startTitle(ol,getOutputFileBase());
parseText(ol,theTranslator->trCompoundReference(name(),m_compType,outerTempArgList!=0)); parseText(ol,theTranslator->trCompoundReference(displayName(),m_compType,outerTempArgList!=0));
addGroupListToTitle(ol,this); addGroupListToTitle(ol,this);
endTitle(ol,getOutputFileBase(),name()); endTitle(ol,getOutputFileBase(),name());
...@@ -844,11 +844,11 @@ void ClassDef::writeDocumentation(OutputList &ol) ...@@ -844,11 +844,11 @@ void ClassDef::writeDocumentation(OutputList &ol)
} }
Doxygen::tagFile << ">" << convertToXML(cd->name()) << "</base>" << endl; Doxygen::tagFile << ">" << convertToXML(cd->name()) << "</base>" << endl;
} }
ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,cd->name()+bcd->templSpecifiers); ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,cd->displayName()+bcd->templSpecifiers);
} }
else else
{ {
ol.docify(cd->name()); ol.docify(cd->displayName());
} }
} }
else else
...@@ -879,11 +879,11 @@ void ClassDef::writeDocumentation(OutputList &ol) ...@@ -879,11 +879,11 @@ void ClassDef::writeDocumentation(OutputList &ol)
ClassDef *cd=bcd->classDef; ClassDef *cd=bcd->classDef;
if (cd->isLinkable()) if (cd->isLinkable())
{ {
ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,cd->name()); ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,cd->displayName());
} }
else else
{ {
ol.docify(cd->name()); ol.docify(cd->displayName());
} }
writeInheritanceSpecifier(ol,bcd); writeInheritanceSpecifier(ol,bcd);
} }
...@@ -945,9 +945,9 @@ void ClassDef::writeDocumentation(OutputList &ol) ...@@ -945,9 +945,9 @@ void ClassDef::writeDocumentation(OutputList &ol)
ClassDiagram diagram(this); // create a diagram of this class. ClassDiagram diagram(this); // create a diagram of this class.
ol.startClassDiagram(); ol.startClassDiagram();
ol.disable(OutputGenerator::Man); ol.disable(OutputGenerator::Man);
parseText(ol,theTranslator->trClassDiagram(name())); parseText(ol,theTranslator->trClassDiagram(displayName()));
ol.enable(OutputGenerator::Man); ol.enable(OutputGenerator::Man);
ol.endClassDiagram(diagram,getOutputFileBase(),name()); ol.endClassDiagram(diagram,getOutputFileBase(),displayName());
} }
if (Config_getBool("HAVE_DOT") && Config_getBool("COLLABORATION_GRAPH")) if (Config_getBool("HAVE_DOT") && Config_getBool("COLLABORATION_GRAPH"))
...@@ -958,7 +958,7 @@ void ClassDef::writeDocumentation(OutputList &ol) ...@@ -958,7 +958,7 @@ void ClassDef::writeDocumentation(OutputList &ol)
ol.pushGeneratorState(); ol.pushGeneratorState();
ol.disable(OutputGenerator::Man); ol.disable(OutputGenerator::Man);
ol.startDotGraph(); ol.startDotGraph();
parseText(ol,theTranslator->trCollaborationDiagram(name())); parseText(ol,theTranslator->trCollaborationDiagram(displayName()));
ol.endDotGraph(usageImplGraph); ol.endDotGraph(usageImplGraph);
if (Config_getBool("GENERATE_LEGEND")) if (Config_getBool("GENERATE_LEGEND"))
{ {
...@@ -1251,10 +1251,10 @@ void ClassDef::writeMemberList(OutputList &ol) ...@@ -1251,10 +1251,10 @@ void ClassDef::writeMemberList(OutputList &ol)
startFile(ol,m_memListFileName,m_memListFileName, startFile(ol,m_memListFileName,m_memListFileName,
theTranslator->trMemberList()); theTranslator->trMemberList());
startTitle(ol,0); startTitle(ol,0);
parseText(ol,name()+" "+theTranslator->trMemberList()); parseText(ol,displayName()+" "+theTranslator->trMemberList());
endTitle(ol,0,0); endTitle(ol,0,0);
parseText(ol,theTranslator->trThisIsTheListOfAllMembers()); parseText(ol,theTranslator->trThisIsTheListOfAllMembers());
ol.writeObjectLink(getReference(),getOutputFileBase(),0,name()); ol.writeObjectLink(getReference(),getOutputFileBase(),0,displayName());
parseText(ol,theTranslator->trIncludingInheritedMembers()); parseText(ol,theTranslator->trIncludingInheritedMembers());
//ol.startItemList(); //ol.startItemList();
...@@ -1328,12 +1328,12 @@ void ClassDef::writeMemberList(OutputList &ol) ...@@ -1328,12 +1328,12 @@ void ClassDef::writeMemberList(OutputList &ol)
parseText(ol,theTranslator->trDefinedIn()+" "); parseText(ol,theTranslator->trDefinedIn()+" ");
if (cd->isLinkable()) if (cd->isLinkable())
{ {
ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,cd->name()); ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,cd->displayName());
} }
else else
{ {
ol.startBold(); ol.startBold();
ol.docify(cd->name()); ol.docify(cd->displayName());
ol.endBold(); ol.endBold();
} }
ol.writeString(")"); ol.writeString(")");
...@@ -1344,7 +1344,7 @@ void ClassDef::writeMemberList(OutputList &ol) ...@@ -1344,7 +1344,7 @@ void ClassDef::writeMemberList(OutputList &ol)
{ {
ol.writeString("<td>"); ol.writeString("<td>");
ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(), ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),
0,cd->name()); 0,cd->displayName());
ol.writeString("</td>"); ol.writeString("</td>");
ol.writeString("<td>"); ol.writeString("<td>");
} }
...@@ -2383,7 +2383,14 @@ QCString ClassDef::qualifiedNameWithTemplateParameters( ...@@ -2383,7 +2383,14 @@ QCString ClassDef::qualifiedNameWithTemplateParameters(
scName = d->qualifiedName(); scName = d->qualifiedName();
} }
} }
if (!scName.isEmpty()) scName+="::";
QCString scopeSeparator;
if (Config_getBool("OPTIMIZE_OUTPUT_JAVA"))
scopeSeparator=".";
else
scopeSeparator="::";
if (!scName.isEmpty()) scName+=scopeSeparator;
scName+=localName(); scName+=localName();
ArgumentList *al=0; ArgumentList *al=0;
bool isSpecialization = localName().find('<')!=-1; bool isSpecialization = localName().find('<')!=-1;
......
...@@ -104,13 +104,13 @@ void ClassSDict::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *f ...@@ -104,13 +104,13 @@ void ClassSDict::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *f
ol.writeObjectLink(cd->getReference(), ol.writeObjectLink(cd->getReference(),
cd->getOutputFileBase(), cd->getOutputFileBase(),
0, 0,
cd->name() cd->localName()
); );
} }
else else
{ {
ol.startBold(); ol.startBold();
ol.docify(cd->name()); ol.docify(cd->localName());
ol.endBold(); ol.endBold();
} }
ol.endMemberItem(FALSE); ol.endMemberItem(FALSE);
......
...@@ -623,10 +623,11 @@ static void generateClassOrGlobalLink(OutputDocInterface &ol,char *clName,int *c ...@@ -623,10 +623,11 @@ static void generateClassOrGlobalLink(OutputDocInterface &ol,char *clName,int *c
if (!g_theVarContext.findVariable(className)) // not a local variable if (!g_theVarContext.findVariable(className)) // not a local variable
{ {
cd = getResolvedClass(g_currentDefinition,className); Definition *d = g_currentDefinition;
cd = getResolvedClass(d,className);
if (cd==0 && (i=className.find('<'))!=-1) if (cd==0 && (i=className.find('<'))!=-1)
{ {
cd=getResolvedClass(g_currentDefinition,className.left(i)); cd=getResolvedClass(d,className.left(i));
} }
} }
if (cd && cd->isLinkable()) // is it a linkable class if (cd && cd->isLinkable()) // is it a linkable class
...@@ -976,9 +977,9 @@ SCOPENAME (({ID}?{BN}*"::"{BN}*)*)((~{BN}*)?{ID}) ...@@ -976,9 +977,9 @@ SCOPENAME (({ID}?{BN}*"::"{BN}*)*)((~{BN}*)?{ID})
TEMPLIST "<"[^\"\}\{\(\)\/\n\>]*">" TEMPLIST "<"[^\"\}\{\(\)\/\n\>]*">"
SCOPETNAME ((({ID}{TEMPLIST}?){BN}*"::"{BN}*)*)((~{BN}*)?{ID}) SCOPETNAME ((({ID}{TEMPLIST}?){BN}*"::"{BN}*)*)((~{BN}*)?{ID})
SCOPEPREFIX ({ID}{TEMPLIST}?{BN}*"::"{BN}*)+ SCOPEPREFIX ({ID}{TEMPLIST}?{BN}*"::"{BN}*)+
KEYWORD ("asm"|"auto"|"class"|"const"|"const_cast"|"delete"|"dynamic_cast"|"enum"|"explicit"|"extern"|"false"|"friend"|"inline"|"mutable"|"namespace"|"new"|"operator"|"private"|"protected"|"public"|"register"|"reinterpret_cast"|"sizeof"|"static"|"static_cast"|"struct"|"template"|"this"|"true"|"typedef"|"typeid"|"typename"|"union"|"using"|"virtual"|"volatile") KEYWORD ("asm"|"auto"|"class"|"const"|"const_cast"|"delete"|"dynamic_cast"|"enum"|"explicit"|"extern"|"false"|"friend"|"inline"|"mutable"|"namespace"|"new"|"operator"|"private"|"protected"|"public"|"register"|"reinterpret_cast"|"sizeof"|"static"|"static_cast"|"struct"|"template"|"this"|"true"|"typedef"|"typeid"|"typename"|"union"|"using"|"virtual"|"volatile"|"abstract"|"final"|"import"|"synchronized"|"transient")
FLOWKW ("break"|"case"|"catch"|"continue"|"default"|"do"|"else"|"for"|"goto"|"if"|"return"|"switch"|"throw"|"try"|"while") FLOWKW ("break"|"case"|"catch"|"continue"|"default"|"do"|"else"|"for"|"goto"|"if"|"return"|"switch"|"throw"|"throws"|"try"|"while")
TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned"|"void"|"wchar_t") TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned"|"void"|"wchar_t"|"boolean")
%option noyywrap %option noyywrap
...@@ -994,6 +995,7 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned" ...@@ -994,6 +995,7 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned"
%x MemberCall2 %x MemberCall2
%x SkipInits %x SkipInits
%x ClassName %x ClassName
%x PackageName
%x ClassVar %x ClassVar
%x Bases %x Bases
%x SkipSharp %x SkipSharp
...@@ -1012,10 +1014,15 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned" ...@@ -1012,10 +1014,15 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned"
startFontClass("keyword"); startFontClass("keyword");
codifyLines(yytext); codifyLines(yytext);
endFontClass(); endFontClass();
//g_code->codify(yytext);
if (!g_insideTemplate) if (!g_insideTemplate)
BEGIN( ClassName ); BEGIN( ClassName );
} }
<Body>("package")[ \t\n]+ {
startFontClass("keyword");
codifyLines(yytext);
endFontClass();
BEGIN( PackageName );
}
<ReadInclude>[^\n\"\>]+/(">"|"\"") { <ReadInclude>[^\n\"\>]+/(">"|"\"") {
//FileInfo *f; //FileInfo *f;
bool ambig; bool ambig;
...@@ -1108,10 +1115,24 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned" ...@@ -1108,10 +1115,24 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned"
generateClassOrGlobalLink(*g_code,yytext); generateClassOrGlobalLink(*g_code,yytext);
BEGIN( ClassVar ); BEGIN( ClassVar );
} }
<PackageName>{ID}("."{ID})* {
g_curClassName=yytext;
g_curClassName=substitute(g_curClassName,".","::");
//printf("found package: %s\n",g_curClassName.data());
addType();
codifyLines(yytext);
}
<ClassVar>"=" { <ClassVar>"=" {
unput(*yytext); unput(*yytext);
BEGIN( Body ); BEGIN( Body );
} }
<ClassVar>("extends"|"implements") { // Java
startFontClass("keyword");
codifyLines(yytext);
endFontClass();
g_curClassBases.clear();
BEGIN( Bases );
}
<ClassVar>{ID} { <ClassVar>{ID} {
g_type = g_curClassName.copy(); g_type = g_curClassName.copy();
g_name = yytext; g_name = yytext;
...@@ -1123,6 +1144,7 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned" ...@@ -1123,6 +1144,7 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned"
g_curClassBases.clear(); g_curClassBases.clear();
BEGIN( Bases ); BEGIN( Bases );
} }
<PackageName>[ \t]*";" |
<Bases,ClassName,ClassVar>[ \t]*"{"[ \t]* { <Bases,ClassName,ClassVar>[ \t]*"{"[ \t]* {
g_theVarContext.pushScope(); g_theVarContext.pushScope();
g_code->codify(yytext); g_code->codify(yytext);
...@@ -1138,6 +1160,7 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned" ...@@ -1138,6 +1160,7 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned"
{ {
g_scopeStack.push(SCOPEBLOCK); g_scopeStack.push(SCOPEBLOCK);
pushScope(g_curClassName); pushScope(g_curClassName);
//printf("***** g_curClassName=%s\n",g_curClassName.data());
//CodeClassDef *cd=new CodeClassDef(g_ccd); //CodeClassDef *cd=new CodeClassDef(g_ccd);
//g_codeClassDict.insert(cd->name,cd); //g_codeClassDict.insert(cd->name,cd);
if (getResolvedClass(g_currentDefinition,g_curClassName)==0) if (getResolvedClass(g_currentDefinition,g_curClassName)==0)
......
...@@ -1564,6 +1564,14 @@ void Config::create() ...@@ -1564,6 +1564,14 @@ void Config::create()
"of all members will be omitted, etc. \n", "of all members will be omitted, etc. \n",
FALSE FALSE
); );
cb = addBool(
"OPTIMIZE_OUTPUT_JAVA",
"Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources \n"
"only. Doxygen will then generate output that is more tailored for Java. \n"
"For instance namespaces will be presented as packages, qualified scopes \n"
"will look different, etc. \n",
FALSE
);
cb = addBool( cb = addBool(
"SHOW_USED_FILES", "SHOW_USED_FILES",
"Set the SHOW_USED_FILES tag to NO to disable the list of files generated \n" "Set the SHOW_USED_FILES tag to NO to disable the list of files generated \n"
......
...@@ -388,7 +388,14 @@ void Definition::writeSourceRefList(OutputList &ol,const char *scopeName, ...@@ -388,7 +388,14 @@ void Definition::writeSourceRefList(OutputList &ol,const char *scopeName,
//printf("class=%p scope=%s scopeName=%s\n",md->getClassDef(),scope.data(),scopeName); //printf("class=%p scope=%s scopeName=%s\n",md->getClassDef(),scope.data(),scopeName);
if (!scope.isEmpty() && scope!=scopeName) if (!scope.isEmpty() && scope!=scopeName)
{ {
name.prepend(scope+"::"); if (Config_getBool("OPTIMIZE_OUTPUT_JAVA"))
{
name.prepend(scope+".");
}
else
{
name.prepend(scope+"::");
}
} }
Definition *d = md->getOuterScope(); Definition *d = md->getOuterScope();
if (d==Doxygen::globalScope) d=md->getBodyDef(); if (d==Doxygen::globalScope) d=md->getBodyDef();
...@@ -429,7 +436,7 @@ void Definition::writeSourceRefList(OutputList &ol,const char *scopeName, ...@@ -429,7 +436,7 @@ void Definition::writeSourceRefList(OutputList &ol,const char *scopeName,
{ {
ol.docify(name); ol.docify(name);
} }
if (md->isFunction() && md->isSlot()) ol.docify("()"); if (md->isFunction() || md->isSlot() || md->isPrototype() || md->isSignal()) ol.docify("()");
} }
index=newIndex+matchLen; index=newIndex+matchLen;
} }
......
...@@ -167,7 +167,7 @@ static void writeMapArea(QTextStream &t,ClassDef *cd,int x,int y,int w,int h) ...@@ -167,7 +167,7 @@ static void writeMapArea(QTextStream &t,ClassDef *cd,int x,int y,int w,int h)
if ((dest=Doxygen::tagDestinationDict[ref])) t << *dest << "/"; if ((dest=Doxygen::tagDestinationDict[ref])) t << *dest << "/";
} }
t << cd->getOutputFileBase() << htmlFileExtension << "\" "; t << cd->getOutputFileBase() << htmlFileExtension << "\" ";
t << "alt=\"" << cd->name(); t << "alt=\"" << cd->displayName();
t << "\" shape=\"rect\" coords=\"" << x << "," << y << ","; t << "\" shape=\"rect\" coords=\"" << x << "," << y << ",";
t << (x+w) << "," << (y+h) << "\">" << endl; t << (x+w) << "," << (y+h) << "\">" << endl;
} }
...@@ -199,11 +199,11 @@ QCString DiagramItem::label() const ...@@ -199,11 +199,11 @@ QCString DiagramItem::label() const
QCString result; QCString result;
if (!templSpec.isEmpty()) if (!templSpec.isEmpty())
{ {
result=insertTemplateSpecifierInScope(classDef->name(),templSpec); result=insertTemplateSpecifierInScope(classDef->displayName(),templSpec);
} }
else else
{ {
result=classDef->name(); result=classDef->displayName();
} }
if (Config_getBool("HIDE_SCOPE_NAMES")) result=stripScope(result); if (Config_getBool("HIDE_SCOPE_NAMES")) result=stripScope(result);
return result; return result;
......
...@@ -2485,7 +2485,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) ...@@ -2485,7 +2485,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG})
outDoc->startEmphasis(); outDoc->startEmphasis();
if (!insideHtmlLink) if (!insideHtmlLink)
{ {
linkifyText(TextGeneratorOLImpl(*outDoc),className,0,yytext,FALSE,FALSE); linkifyText(TextGeneratorOLImpl(*outDoc),className,0,yytext,FALSE,TRUE);
} }
else else
{ {
...@@ -2524,7 +2524,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) ...@@ -2524,7 +2524,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG})
outDoc->startBold(); outDoc->startBold();
if (!insideHtmlLink) if (!insideHtmlLink)
{ {
linkifyText(TextGeneratorOLImpl(*outDoc),className,0,yytext,FALSE,FALSE); linkifyText(TextGeneratorOLImpl(*outDoc),className,0,yytext,FALSE,TRUE);
} }
else else
{ {
...@@ -2563,7 +2563,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) ...@@ -2563,7 +2563,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG})
outDoc->startTypewriter(); outDoc->startTypewriter();
if (!insideHtmlLink) if (!insideHtmlLink)
{ {
linkifyText(TextGeneratorOLImpl(*outDoc),className,0,yytext,FALSE,FALSE); linkifyText(TextGeneratorOLImpl(*outDoc),className,0,yytext,FALSE,TRUE);
} }
else else
{ {
......
...@@ -440,13 +440,14 @@ static bool addNamespace(Entry *root,ClassDef *cd) ...@@ -440,13 +440,14 @@ static bool addNamespace(Entry *root,ClassDef *cd)
if (e->section==Entry::NAMESPACE_SEC) if (e->section==Entry::NAMESPACE_SEC)
{ {
NamespaceDef *nd=0; NamespaceDef *nd=0;
//printf("addNameSpace() trying: %s\n",e->name.data());
QCString nsName = stripAnonymousNamespaceScope(e->name); QCString nsName = stripAnonymousNamespaceScope(e->name);
//printf("addNameSpace() trying: %s\n",nsName.data());
if (!nsName.isEmpty() && nsName.at(0)!='@' && if (!nsName.isEmpty() && nsName.at(0)!='@' &&
(nd=getResolvedNamespace(nsName)) (nd=getResolvedNamespace(nsName))
) )
{ {
cd->setNamespace(nd); cd->setNamespace(nd);
cd->setOuterScope(nd);
nd->insertClass(cd); nd->insertClass(cd);
return TRUE; return TRUE;
} }
...@@ -1080,18 +1081,25 @@ static MemberDef *addVariableToClass( ...@@ -1080,18 +1081,25 @@ static MemberDef *addVariableToClass(
Entry *root, Entry *root,
ClassDef *cd, ClassDef *cd,
MemberDef::MemberType mtype, MemberDef::MemberType mtype,
const QCString &scope, /*const QCString &scope,*/
const QCString &name, const QCString &name,
bool fromAnnScope, bool fromAnnScope,
int indentDepth, int indentDepth,
MemberDef *fromAnnMemb, MemberDef *fromAnnMemb,
Protection prot) Protection prot)
{ {
QCString qualScope = cd->qualifiedNameWithTemplateParameters();
QCString scopeSeparator="::";
if (Config_getBool("OPTIMIZE_OUTPUT_JAVA"))
{
qualScope = substitute(qualScope,"::",".");
scopeSeparator=".";
}
Debug::print(Debug::Variables,0, Debug::print(Debug::Variables,0,
" class variable:\n" " class variable:\n"
" %s' %s'::`%s' `%s' prot=`%d ann=%d init=%s\n", " %s' %s'::`%s' `%s' prot=`%d ann=%d init=%s\n",
root->type.data(), root->type.data(),
scope.data(), qualScope.data(),
name.data(), name.data(),
root->args.data(), root->args.data(),
root->protection, root->protection,
...@@ -1099,20 +1107,6 @@ static MemberDef *addVariableToClass( ...@@ -1099,20 +1107,6 @@ static MemberDef *addVariableToClass(
root->initializer.data() root->initializer.data()
); );
// class friends may be templatized
//QCString name=n;
//int i;
//if (root->type.left(7)=="friend " && (i=name.find('<'))!=-1)
//{
// name=name.left(i);
//}
// add template names, if the class is a non-specialized template
//if (scope.find('<')==-1 && cd->templateArguments())
//{
// scope+=cd->getTemplateNameString();
//}
// generate member definition.
QCString def; QCString def;
if (!root->type.isEmpty()) if (!root->type.isEmpty())
{ {
...@@ -1122,7 +1116,7 @@ static MemberDef *addVariableToClass( ...@@ -1122,7 +1116,7 @@ static MemberDef *addVariableToClass(
} }
else else
{ {
def=root->type+" "+scope+"::"+name+root->args; def=root->type+" "+qualScope+scopeSeparator+name+root->args;
} }
} }
else else
...@@ -1133,7 +1127,7 @@ static MemberDef *addVariableToClass( ...@@ -1133,7 +1127,7 @@ static MemberDef *addVariableToClass(
} }
else else
{ {
def=scope+"::"+name+root->args; def=qualScope+scopeSeparator+name+root->args;
} }
} }
if (def.left(7)=="static ") def=def.right(def.length()-7); if (def.left(7)=="static ") def=def.right(def.length()-7);
...@@ -1510,7 +1504,7 @@ void buildVarList(Entry *root) ...@@ -1510,7 +1504,7 @@ void buildVarList(Entry *root)
cd=getClass(scope); cd=getClass(scope);
if (cd) if (cd)
{ {
addVariableToClass(root,cd,MemberDef::Friend,scope, addVariableToClass(root,cd,MemberDef::Friend,/*scope,*/
root->name,FALSE,0,0,Public); root->name,FALSE,0,0,Public);
} }
} }
...@@ -1563,7 +1557,7 @@ void buildVarList(Entry *root) ...@@ -1563,7 +1557,7 @@ void buildVarList(Entry *root)
if (!pScope.isEmpty() && (pcd=getClass(pScope))) if (!pScope.isEmpty() && (pcd=getClass(pScope)))
{ {
//Protection p = (Protection)QMAX((int)root->protection,(int)cd->protection()); //Protection p = (Protection)QMAX((int)root->protection,(int)cd->protection());
md=addVariableToClass(root,pcd,mtype,pScope,name,TRUE,indentDepth,0,root->protection); md=addVariableToClass(root,pcd,mtype,/*pScope,*/name,TRUE,indentDepth,0,root->protection);
} }
else // annonymous scope inside namespace or file => put variable in the global scope else // annonymous scope inside namespace or file => put variable in the global scope
{ {
...@@ -1573,7 +1567,7 @@ void buildVarList(Entry *root) ...@@ -1573,7 +1567,7 @@ void buildVarList(Entry *root)
} }
} }
} }
addVariableToClass(root,cd,mtype,scope,name,FALSE,indentDepth,md,root->protection); addVariableToClass(root,cd,mtype,/*scope,*/name,FALSE,indentDepth,md,root->protection);
} }
else if (!name.isEmpty()) // global variable else if (!name.isEmpty()) // global variable
{ {
...@@ -1607,8 +1601,8 @@ nextMember: ...@@ -1607,8 +1601,8 @@ nextMember:
// Searches the Entry tree for Function sections. // Searches the Entry tree for Function sections.
// If found they are stored in their class or in the global list. // If found they are stored in their class or in the global list.
void addNewMemberToClass(Entry *root,ClassDef *cd, void addMethodToClass(Entry *root,ClassDef *cd,
const QCString &rname,const QCString &scope,bool isFriend) const QCString &rname,/*const QCString &scope,*/bool isFriend)
{ {
int l,i; int l,i;
static QRegExp re("([a-z_A-Z0-9: ]*[ *]*[ ]*"); static QRegExp re("([a-z_A-Z0-9: ]*[ *]*[ ]*");
...@@ -1658,6 +1652,13 @@ void addNewMemberToClass(Entry *root,ClassDef *cd, ...@@ -1658,6 +1652,13 @@ void addNewMemberToClass(Entry *root,ClassDef *cd,
//md->setScopeTemplateArguments(root->tArgList); //md->setScopeTemplateArguments(root->tArgList);
md->addSectionsToDefinition(root->anchors); md->addSectionsToDefinition(root->anchors);
QCString def; QCString def;
QCString qualScope = cd->qualifiedNameWithTemplateParameters();
QCString scopeSeparator="::";
if (Config_getBool("OPTIMIZE_OUTPUT_JAVA"))
{
qualScope = substitute(qualScope,"::",".");
scopeSeparator=".";
}
if (!root->relates.isEmpty() || isFriend || Config_getBool("HIDE_SCOPE_NAMES")) if (!root->relates.isEmpty() || isFriend || Config_getBool("HIDE_SCOPE_NAMES"))
{ {
if (!root->type.isEmpty()) if (!root->type.isEmpty())
...@@ -1685,27 +1686,26 @@ void addNewMemberToClass(Entry *root,ClassDef *cd, ...@@ -1685,27 +1686,26 @@ void addNewMemberToClass(Entry *root,ClassDef *cd,
} }
else else
{ {
QCString qualScope = cd->qualifiedNameWithTemplateParameters();
if (!root->type.isEmpty()) if (!root->type.isEmpty())
{ {
if (root->argList) if (root->argList)
{ {
def=root->type+" "+qualScope+"::"+name; def=root->type+" "+qualScope+scopeSeparator+name;
} }
else else
{ {
def=root->type+" "+qualScope+"::"+name+root->args; def=root->type+" "+qualScope+scopeSeparator+name+root->args;
} }
} }
else else
{ {
if (root->argList) if (root->argList)
{ {
def=qualScope+"::"+name; def=qualScope+scopeSeparator+name;
} }
else else
{ {
def=qualScope+"::"+name+root->args; def=qualScope+scopeSeparator+name+root->args;
} }
} }
} }
...@@ -1717,7 +1717,7 @@ void addNewMemberToClass(Entry *root,ClassDef *cd, ...@@ -1717,7 +1717,7 @@ void addNewMemberToClass(Entry *root,ClassDef *cd,
" `%s' `%s'::`%s' `%s' proto=%d\n" " `%s' `%s'::`%s' `%s' proto=%d\n"
" def=`%s'\n", " def=`%s'\n",
root->type.data(), root->type.data(),
scope.data(), qualScope.data(),
rname.data(), rname.data(),
root->args.data(), root->args.data(),
root->proto, root->proto,
...@@ -1815,7 +1815,7 @@ static void buildFunctionList(Entry *root) ...@@ -1815,7 +1815,7 @@ static void buildFunctionList(Entry *root)
) )
) )
{ {
addNewMemberToClass(root,cd,rname,scope,isFriend); addMethodToClass(root,cd,rname,/*scope,*/isFriend);
} }
else if (root->parent && else if (root->parent &&
!(root->parent->section & Entry::COMPOUND_MASK) && !(root->parent->section & Entry::COMPOUND_MASK) &&
...@@ -4125,7 +4125,7 @@ static void findMember(Entry *root, ...@@ -4125,7 +4125,7 @@ static void findMember(Entry *root,
// for which there is only a definition, no declaration in // for which there is only a definition, no declaration in
// the class. TODO: we should actually check whether // the class. TODO: we should actually check whether
// the arguments match! // the arguments match!
addNewMemberToClass(root,cd,md->name(),cd->name(),isFriend); addMethodToClass(root,cd,md->name(),/*cd->name(),*/isFriend);
return; return;
} }
candidates++; candidates++;
...@@ -5157,6 +5157,7 @@ static void generateClassList(ClassSDict &classSDict) ...@@ -5157,6 +5157,7 @@ static void generateClassList(ClassSDict &classSDict)
{ {
ClassDef *cd=cli.current(); ClassDef *cd=cli.current();
//printf("cd=%s getOuterScope=%p global=%p\n",cd->name().data(),cd->getOuterScope(),Doxygen::globalScope);
if (cd->getOuterScope()==0 || // <-- should not happen, but can if we read an old tag file if (cd->getOuterScope()==0 || // <-- should not happen, but can if we read an old tag file
cd->getOuterScope()==Doxygen::globalScope // only look at global classes cd->getOuterScope()==Doxygen::globalScope // only look at global classes
) )
......
...@@ -291,7 +291,7 @@ void FileDef::writeDocumentation(OutputList &ol) ...@@ -291,7 +291,7 @@ void FileDef::writeDocumentation(OutputList &ol)
ol.writeObjectLink(nd->getReference(), ol.writeObjectLink(nd->getReference(),
nd->getOutputFileBase(), nd->getOutputFileBase(),
0, 0,
nd->name() nd->displayName()
); );
if (!Config_getString("GENERATE_TAGFILE").isEmpty()) if (!Config_getString("GENERATE_TAGFILE").isEmpty())
{ {
...@@ -301,7 +301,7 @@ void FileDef::writeDocumentation(OutputList &ol) ...@@ -301,7 +301,7 @@ void FileDef::writeDocumentation(OutputList &ol)
else else
{ {
ol.startBold(); ol.startBold();
ol.docify(nd->name()); ol.docify(nd->displayName());
ol.endBold(); ol.endBold();
} }
ol.endMemberItem(FALSE); ol.endMemberItem(FALSE);
......
...@@ -190,13 +190,13 @@ void writeQuickLinks(OutputList &ol,bool compact ,bool ext=FALSE) ...@@ -190,13 +190,13 @@ void writeQuickLinks(OutputList &ol,bool compact ,bool ext=FALSE)
parseText(ol,theTranslator->trMainPage()); parseText(ol,theTranslator->trMainPage());
ol.endQuickIndexItem(); ol.endQuickIndexItem();
if (documentedPackages>0) //if (documentedPackages>0)
{ //{
if (!compact) ol.writeListItem(); // if (!compact) ol.writeListItem();
ol.startQuickIndexItem(extLink,"packages"+htmlFileExtension); // ol.startQuickIndexItem(extLink,"packages"+htmlFileExtension);
parseText(ol,theTranslator->trPackages()); // parseText(ol,theTranslator->trPackages());
ol.endQuickIndexItem(); // ol.endQuickIndexItem();
} //}
if (documentedGroups>0) if (documentedGroups>0)
{ {
if (!compact) ol.writeListItem(); if (!compact) ol.writeListItem();
...@@ -208,7 +208,14 @@ void writeQuickLinks(OutputList &ol,bool compact ,bool ext=FALSE) ...@@ -208,7 +208,14 @@ void writeQuickLinks(OutputList &ol,bool compact ,bool ext=FALSE)
{ {
if (!compact) ol.writeListItem(); if (!compact) ol.writeListItem();
ol.startQuickIndexItem(extLink,"namespaces"+htmlFileExtension); ol.startQuickIndexItem(extLink,"namespaces"+htmlFileExtension);
parseText(ol,theTranslator->trNamespaceList()); if (Config_getBool("OPTIMIZE_OUTPUT_JAVA"))
{
parseText(ol,theTranslator->trPackages());
}
else
{
parseText(ol,theTranslator->trNamespaceList());
}
ol.endQuickIndexItem(); ol.endQuickIndexItem();
} }
if (hierarchyClasses>0) if (hierarchyClasses>0)
...@@ -1054,9 +1061,18 @@ void writeNamespaceIndex(OutputList &ol) ...@@ -1054,9 +1061,18 @@ void writeNamespaceIndex(OutputList &ol)
if (documentedNamespaces==0) return; if (documentedNamespaces==0) return;
ol.pushGeneratorState(); ol.pushGeneratorState();
ol.disable(OutputGenerator::Man); ol.disable(OutputGenerator::Man);
startFile(ol,"namespaces",0,"Namespace Index"); QCString title;
if (Config_getBool("OPTIMIZE_OUTPUT_JAVA"))
{
startFile(ol,"namespaces",0,"Package Index");
title = theTranslator->trPackageList();
}
else
{
startFile(ol,"namespaces",0,"Namespace Index");
title = theTranslator->trNamespaceList();
}
startTitle(ol,0); startTitle(ol,0);
QCString title = theTranslator->trNamespaceList();
QCString htmlHelpTitle = title; QCString htmlHelpTitle = title;
QCString ftvHelpTitle = title; QCString ftvHelpTitle = title;
if (!Config_getString("PROJECT_NAME").isEmpty()) title.prepend(Config_getString("PROJECT_NAME")+" "); if (!Config_getString("PROJECT_NAME").isEmpty()) title.prepend(Config_getString("PROJECT_NAME")+" ");
...@@ -1081,7 +1097,14 @@ void writeNamespaceIndex(OutputList &ol) ...@@ -1081,7 +1097,14 @@ void writeNamespaceIndex(OutputList &ol)
ftvHelp->incContentsDepth(); ftvHelp->incContentsDepth();
} }
//ol.newParagraph(); //ol.newParagraph();
parseText(ol,theTranslator->trNamespaceListDescription(Config_getBool("EXTRACT_ALL"))); if (Config_getBool("OPTIMIZE_OUTPUT_JAVA"))
{
parseText(ol,theTranslator->trPackageListDescription());
}
else
{
parseText(ol,theTranslator->trNamespaceListDescription(Config_getBool("EXTRACT_ALL")));
}
//ol.newParagraph(); //ol.newParagraph();
ol.endTextBlock(); ol.endTextBlock();
...@@ -1100,7 +1123,7 @@ void writeNamespaceIndex(OutputList &ol) ...@@ -1100,7 +1123,7 @@ void writeNamespaceIndex(OutputList &ol)
} }
//ol.writeStartAnnoItem("namespace",nd->getOutputFileBase(),0,nd->name()); //ol.writeStartAnnoItem("namespace",nd->getOutputFileBase(),0,nd->name());
ol.startIndexKey(); ol.startIndexKey();
ol.writeObjectLink(0,nd->getOutputFileBase(),0,nd->name()); ol.writeObjectLink(0,nd->getOutputFileBase(),0,nd->displayName());
ol.endIndexKey(); ol.endIndexKey();
bool hasBrief = !nd->briefDescription().isEmpty(); bool hasBrief = !nd->briefDescription().isEmpty();
ol.startIndexValue(hasBrief); ol.startIndexValue(hasBrief);
...@@ -1110,7 +1133,7 @@ void writeNamespaceIndex(OutputList &ol) ...@@ -1110,7 +1133,7 @@ void writeNamespaceIndex(OutputList &ol)
parseDoc(ol, parseDoc(ol,
nd->getDefFileName(),nd->getDefLine(), nd->getDefFileName(),nd->getDefLine(),
nd->name(),0, nd->name(),0,
abbreviate(nd->briefDescription(),nd->name())); abbreviate(nd->briefDescription(),nd->displayName()));
//ol.docify(")"); //ol.docify(")");
} }
ol.endIndexValue(nd->getOutputFileBase(),hasBrief); ol.endIndexValue(nd->getOutputFileBase(),hasBrief);
...@@ -1206,6 +1229,7 @@ void writeAnnotatedClassList(OutputList &ol) ...@@ -1206,6 +1229,7 @@ void writeAnnotatedClassList(OutputList &ol)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// OBSOLETE
void writePackageList(OutputList &ol) void writePackageList(OutputList &ol)
{ {
bool &generateHtml = Config_getBool("GENERATE_HTML") ; bool &generateHtml = Config_getBool("GENERATE_HTML") ;
......
...@@ -1343,7 +1343,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ...@@ -1343,7 +1343,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
Definition *bd=bmd->group; Definition *bd=bmd->group;
if (bd==0) bd=bcd; if (bd==0) bd=bcd;
ol.writeObjectLink(bd->getReference(),bd->getOutputFileBase(), ol.writeObjectLink(bd->getReference(),bd->getOutputFileBase(),
bmd->anchor(),bcd->name()); bmd->anchor(),bcd->displayName());
//ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(), //ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(),
// bmd->anchor(),bcd->name()); // bmd->anchor(),bcd->name());
...@@ -1355,7 +1355,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ...@@ -1355,7 +1355,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
else else
{ {
ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(), ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(),
0,bcd->name()); 0,bcd->displayName());
if (bcd->isLinkableInProject()/* && !Config_getBool("PDF_HYPERLINKS")*/ ) if (bcd->isLinkableInProject()/* && !Config_getBool("PDF_HYPERLINKS")*/ )
{ {
writePageRef(ol,bcd->getOutputFileBase(),0); writePageRef(ol,bcd->getOutputFileBase(),0);
...@@ -1437,7 +1437,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ...@@ -1437,7 +1437,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
if (bmd->group) bd=bmd->group; else bd=bcd; if (bmd->group) bd=bmd->group; else bd=bcd;
ol.writeObjectLink(bd->getReference(),bd->getOutputFileBase(), ol.writeObjectLink(bd->getReference(),bd->getOutputFileBase(),
bmd->anchor(),bcd->name()); bmd->anchor(),bcd->displayName());
if (bd->isLinkableInProject() ) if (bd->isLinkableInProject() )
{ {
...@@ -1569,8 +1569,8 @@ bool MemberDef::visibleMemberGroup(bool hideNoHeader) ...@@ -1569,8 +1569,8 @@ bool MemberDef::visibleMemberGroup(bool hideNoHeader)
QCString MemberDef::getScopeString() const QCString MemberDef::getScopeString() const
{ {
QCString result; QCString result;
if (getClassDef()) result=getClassDef()->name(); if (getClassDef()) result=getClassDef()->displayName();
else if (getNamespaceDef()) result=getNamespaceDef()->name(); else if (getNamespaceDef()) result=getNamespaceDef()->displayName();
return result; return result;
} }
......
...@@ -176,9 +176,16 @@ void NamespaceDef::writeDocumentation(OutputList &ol) ...@@ -176,9 +176,16 @@ void NamespaceDef::writeDocumentation(OutputList &ol)
startFile(ol,getOutputFileBase(),name(),pageTitle); startFile(ol,getOutputFileBase(),name(),pageTitle);
startTitle(ol,getOutputFileBase()); startTitle(ol,getOutputFileBase());
//ol.docify(pageTitle); //ol.docify(pageTitle);
parseText(ol,theTranslator->trNamespaceReference(name())); if (Config_getBool("OPTIMIZE_OUTPUT_JAVA"))
{
parseText(ol,theTranslator->trPackage(displayName()));
}
else
{
parseText(ol,theTranslator->trNamespaceReference(displayName()));
}
addGroupListToTitle(ol,this); addGroupListToTitle(ol,this);
endTitle(ol,getOutputFileBase(),name()); endTitle(ol,getOutputFileBase(),displayName());
if (!Config_getString("GENERATE_TAGFILE").isEmpty()) if (!Config_getString("GENERATE_TAGFILE").isEmpty())
{ {
...@@ -327,10 +334,10 @@ QCString NamespaceDef::getOutputFileBase() const ...@@ -327,10 +334,10 @@ QCString NamespaceDef::getOutputFileBase() const
return convertNameToFile(fileName); return convertNameToFile(fileName);
} }
Definition *NamespaceDef::findInnerCompound(const char *name) Definition *NamespaceDef::findInnerCompound(const char *n)
{ {
if (name==0) return 0; if (n==0) return 0;
return m_innerCompounds->find(name); return m_innerCompounds->find(n);
} }
void NamespaceDef::addInnerCompound(Definition *d) void NamespaceDef::addInnerCompound(Definition *d)
...@@ -358,3 +365,13 @@ void NamespaceDef::addListReferences() ...@@ -358,3 +365,13 @@ void NamespaceDef::addListReferences()
docVarMembers.addListReferences(this); docVarMembers.addListReferences(this);
} }
QCString NamespaceDef::displayName() const
{
QCString result=name();
if (Config_getBool("OPTIMIZE_OUTPUT_JAVA"))
{
result = substitute(result,"::",".");
}
return result;
}
...@@ -55,6 +55,7 @@ class NamespaceDef : public Definition ...@@ -55,6 +55,7 @@ class NamespaceDef : public Definition
NamespaceList *getUsedNamespaces() const { return usingDirList; } NamespaceList *getUsedNamespaces() const { return usingDirList; }
void addUsingDeclaration(ClassDef *cd); void addUsingDeclaration(ClassDef *cd);
ClassList *getUsedClasses() const { return usingDeclList; } ClassList *getUsedClasses() const { return usingDeclList; }
QCString displayName() const;
bool isLinkableInProject() const bool isLinkableInProject() const
{ {
......
...@@ -753,15 +753,32 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) ...@@ -753,15 +753,32 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
<FindMembers>{B}*"package"{BN}+ { // Java package <FindMembers>{B}*"package"{BN}+ { // Java package
lineCount(); lineCount();
BEGIN(PackageName); BEGIN(PackageName);
} }
<PackageName>{ID}("."{ID})* { <PackageName>{ID}("."{ID})* {
current->name = yytext; //current->name = yytext;
current->fileName = yyFileName; //current->fileName = yyFileName;
current->startLine = yyLineNr; //current->startLine = yyLineNr;
current->section=Entry::PACKAGE_SEC; //current->section=Entry::PACKAGE_SEC;
//current_root->addSubEntry(current);
//current = new Entry ;
//initEntry();
isTypedef=FALSE;
current->name = yytext;
current->name = substitute(current->name,".","::");
current->section = Entry::NAMESPACE_SEC;
current->type = "namespace" ;
current->fileName = yyFileName;
current->startLine = yyLineNr;
current->bodyLine = yyLineNr;
lineCount();
curlyCount=0;
current_root->addSubEntry(current); current_root->addSubEntry(current);
current = new Entry ; current_root = current ;
current = new Entry ;
initEntry(); initEntry();
BEGIN( FindMembers ) ;
} }
<PackageName>";" { <PackageName>";" {
BEGIN(FindMembers); BEGIN(FindMembers);
...@@ -2222,6 +2239,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) ...@@ -2222,6 +2239,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
<FuncQual,FuncRound,FuncFunc>. { current->args += *yytext; } <FuncQual,FuncRound,FuncFunc>. { current->args += *yytext; }
<FuncQual>{BN}*"try"{BN}+ { /* try-function-block */ <FuncQual>{BN}*"try"{BN}+ { /* try-function-block */
insideTryBlock=TRUE; insideTryBlock=TRUE;
lineCount();
} }
<FuncQual>{BN}*"throw"{BN}*"(" { // C++ style throw clause <FuncQual>{BN}*"throw"{BN}*"(" { // C++ style throw clause
current->exception = " throw (" ; current->exception = " throw (" ;
...@@ -2255,8 +2273,12 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) ...@@ -2255,8 +2273,12 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
<ExcpList>"{" { <ExcpList>"{" {
unput('{'); BEGIN( FuncQual ); unput('{'); BEGIN( FuncQual );
} }
<ExcpList>";" {
unput(';'); BEGIN( FuncQual );
}
<ExcpList>"\n" { <ExcpList>"\n" {
current->exception += ' '; current->exception += ' ';
yyLineNr++;
} }
<ExcpList>. { <ExcpList>. {
current->exception += *yytext; current->exception += *yytext;
...@@ -2579,7 +2601,8 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) ...@@ -2579,7 +2601,8 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
} }
BEGIN( FindMembers ); BEGIN( FindMembers );
} }
<CompoundName,ClassVar>{B}*"{"{B}* { current->fileName = yyFileName ; <CompoundName,ClassVar>{B}*"{"{B}* {
current->fileName = yyFileName ;
current->startLine = yyLineNr ; current->startLine = yyLineNr ;
current->name = removeRedundantWhiteSpace(current->name); current->name = removeRedundantWhiteSpace(current->name);
if (current->name.isEmpty() && !isTypedef) // anonymous compound if (current->name.isEmpty() && !isTypedef) // anonymous compound
...@@ -4244,7 +4267,10 @@ static void parseCompounds(Entry *rt) ...@@ -4244,7 +4267,10 @@ static void parseCompounds(Entry *rt)
// set default protection based on the compound type // set default protection based on the compound type
if( ce->section==Entry::CLASS_SEC ) // class if( ce->section==Entry::CLASS_SEC ) // class
{ {
current->protection = protection = Private ; if (ce->fileName.right(5)==".java")
current->protection = protection = Public ; // Actually this should be package scope!
else
current->protection = protection = Private ;
} }
else if (ce->section == Entry::ENUM_SEC ) // enum else if (ce->section == Entry::ENUM_SEC ) // enum
{ {
......
...@@ -453,86 +453,105 @@ ClassDef *getResolvedClass( ...@@ -453,86 +453,105 @@ ClassDef *getResolvedClass(
QCString *pTemplSpec QCString *pTemplSpec
) )
{ {
//printf("getResolvedClass(%s,%s)\n",scope ? scope->name().data() : "<none>", n);
QCString name = n; QCString name = n;
if (name.isEmpty()) return 0;
if (scope==0) scope=Doxygen::globalScope; if (scope==0) scope=Doxygen::globalScope;
int i = name.findRev("::"); if (name.isEmpty()) return 0;
QCString subst; int index = name.findRev("::");
if (i!=-1) ClassDef *cd=0;
{
subst = resolveTypeDef(scope,name.right(name.length()-i-2));
}
else
{
subst = resolveTypeDef(scope,name);
}
//printf(" typedef subst=`%s'\n",subst.data());
if (!subst.isEmpty())
{
// strip * and & from n
int ip=subst.length()-1;
while (ip>=0 && (subst.at(ip)=='*' || subst.at(ip)=='&' || subst.at(ip)==' ')) ip--;
subst=subst.left(ip+1);
if (pIsTypeDef) *pIsTypeDef=TRUE; do
//printf(" getResolvedClass `%s'->`%s'\n",name.data(),subst.data()); {
if (subst==name) // avoid resolving typedef struct foo foo; //fprintf(stderr,"getResolvedClass(%s,%s)\n",scope ? scope->name().data() : "<none>", n);
QCString subst;
if (index!=-1)
{ {
return Doxygen::classSDict.find(name); subst = resolveTypeDef(scope,name.right(name.length()-index-2));
} }
int count=0; // recursion detection guard else
QCString newSubst; {
QCString typeName = subst; subst = resolveTypeDef(scope,name);
}
if (i!=-1) typeName.prepend(name.left(i)+"::"); //printf(" typedef subst=`%s'\n",subst.data());
while (!(newSubst=resolveTypeDef(scope,typeName)).isEmpty()
&& count<10) if (!subst.isEmpty())
{ {
if (typeName==newSubst)
{
ClassDef *cd = Doxygen::classSDict.find(subst); // for breaking typedef struct A A;
//printf(" getClass: exit `%s' %p\n",subst.data(),cd);
return cd;
}
subst=newSubst;
// strip * and & from n // strip * and & from n
int ip=subst.length()-1; int ip=subst.length()-1;
while (ip>=0 && subst.at(ip)=='*' || subst.at(ip)=='&' || subst.at(ip)==' ') ip--; while (ip>=0 && (subst.at(ip)=='*' || subst.at(ip)=='&' || subst.at(ip)==' ')) ip--;
subst=subst.left(ip+1); subst=subst.left(ip+1);
//printf(" getResolvedClass `%s'->`%s'\n",name.data(),subst.data());
typeName=newSubst; if (pIsTypeDef) *pIsTypeDef=TRUE;
if (i!=-1) typeName.prepend(name.left(i)+"::"); if (subst==name) // avoid resolving typedef struct foo foo;
count++;
}
if (count==10)
{
warn_cont("Warning: possible recursive typedef dependency detected for %s!\n",n);
return Doxygen::classSDict.find(name);
}
else
{
int i;
ClassDef *cd = Doxygen::classSDict.find(typeName);
//printf(" getClass: subst %s->%s cd=%p\n",name.data(),typeName.data(),cd);
if (cd==0 && (i=typeName.find('<'))>0) // try unspecialized version as well
{ {
if (pTemplSpec) *pTemplSpec = typeName.right(typeName.length()-i); cd = Doxygen::classSDict.find(name);
return Doxygen::classSDict.find(typeName.left(i)); if (cd) goto found;
} }
else else
{ {
return cd; int count=0; // recursion detection guard
QCString newSubst;
QCString typeName = subst;
if (index!=-1) typeName.prepend(name.left(index)+"::");
while (!(newSubst=resolveTypeDef(scope,typeName)).isEmpty()
&& count<10)
{
if (typeName==newSubst)
{
cd = Doxygen::classSDict.find(subst); // for breaking typedef struct A A;
//printf(" getClass: exit `%s' %p\n",subst.data(),cd);
if (cd) goto found;
break;
}
subst=newSubst;
// strip * and & from n
int ip=subst.length()-1;
while (ip>=0 && subst.at(ip)=='*' || subst.at(ip)=='&' || subst.at(ip)==' ') ip--;
subst=subst.left(ip+1);
//printf(" getResolvedClass `%s'->`%s'\n",name.data(),subst.data());
typeName=newSubst;
if (index!=-1) typeName.prepend(name.left(index)+"::");
count++;
}
if (count==10)
{
warn_cont("Warning: possible recursive typedef dependency detected for %s!\n",n);
cd = Doxygen::classSDict.find(name);
if (cd) goto found;
}
else
{
int i;
cd = Doxygen::classSDict.find(typeName);
//printf(" getClass: subst %s->%s cd=%p\n",name.data(),typeName.data(),cd);
if (cd==0 && (i=typeName.find('<'))>0) // try unspecialized version as well
{
if (pTemplSpec) *pTemplSpec = typeName.right(typeName.length()-i);
cd = Doxygen::classSDict.find(typeName.left(i));
}
if (cd) goto found;
}
} }
} }
} else
else {
{ if (pIsTypeDef) *pIsTypeDef=FALSE;
if (pIsTypeDef) *pIsTypeDef=FALSE; if (scope!=Doxygen::globalScope)
return Doxygen::classSDict.find(name); cd = Doxygen::classSDict.find(scope->name()+"::"+name);
} else
cd = Doxygen::classSDict.find(name);
if (cd) goto found;
}
if (scope==Doxygen::globalScope) scope=0;
else if (scope) scope=scope->getOuterScope();
//fprintf(stderr,"scope=%p\n",scope);
} while (scope);
found:
//fprintf(stderr, "getResolvedClass()=%s\n",cd?cd->name().data():"<none>");
return cd;
} }
static bool findOperator(const QCString &s,int i) static bool findOperator(const QCString &s,int i)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment