Commit 071e3925 authored by dimitri's avatar dimitri

Release-1.2.9

parent ea8a1bc7
DOXYGEN Version 1.2.8-20010723 DOXYGEN Version 1.2.9
Please read the installation section of the manual for instructions. Please read the installation section of the manual for instructions.
-------- --------
Dimitri van Heesch (23 July 2001) Dimitri van Heesch (01 August 2001)
...@@ -11,20 +11,18 @@ Just follow these steps: ...@@ -11,20 +11,18 @@ Just follow these steps:
I'll use xx in the rest of this document. I'll use xx in the rest of this document.
3) Edit language.cpp: 3) Edit language.cpp:
- Add a #include<translator_xx.h> - Add a #include<translator_xx.h>
- in setTranslator() add - In setTranslator() add
else if (L_EQUAL("your_language_name")) else if (L_EQUAL("your_language_name"))
{ {
theTranslator = new TranslatorYourlanguage; theTranslator = new TranslatorYourLanguage;
} }
after the if { ... } after the if { ... }
4) Edit libdoxygen.pro.in and add translator_xx.h to the HEADERS line. 4) Edit libdoxygen.pro.in and add translator_xx.h to the HEADERS line.
5) Edit translator_xx.h: 5) Edit translator_xx.h:
- Rename TRANSLATOR_EN_H to TRANSLATOR_XX_H twice. - Rename TRANSLATOR_EN_H to TRANSLATOR_XX_H twice.
- Rename TranslatorEnglish to TranslatorYourlanguage - Rename TranslatorEnglish to TranslatorYourLanguage
- In the member latexBabelPackage() change "english" into the name of the
latex package that adds support for your language.
- In the member idLanguage() change "english" into the name of your - In the member idLanguage() change "english" into the name of your
language (use lower case characters only). Depending on the language you language (use lower case characters only). Depending on the language you
may also wish to change the member functions latexLanguageSupportCommand() may also wish to change the member functions latexLanguageSupportCommand()
...@@ -44,6 +42,8 @@ Just follow these steps: ...@@ -44,6 +42,8 @@ Just follow these steps:
7) Now you can use OUTPUT_LANGUAGE = your_language_name 7) Now you can use OUTPUT_LANGUAGE = your_language_name
in the config file to generate output in your language. in the config file to generate output in your language.
8) Send translator_xx.h to me so I can add it to doxygen. 8) Send translator_xx.h to me so I can add it to doxygen.
Send also your name and e-mail address to be included in the
maintainers.txt list.
Good luck, and let me know if there are problems. Good luck, and let me know if there are problems.
DOCDIR = $(INSTALL)/share/doc/packages/doxygen
#all: src/version.cpp doxywizard #all: src/version.cpp doxywizard
# cd qtools ; $(MAKE) # cd qtools ; $(MAKE)
# cd src ; $(MAKE) # cd src ; $(MAKE)
...@@ -10,16 +8,14 @@ clean: FORCE ...@@ -10,16 +8,14 @@ clean: FORCE
cd qtools ; $(MAKE) clean cd qtools ; $(MAKE) clean
cd src ; $(MAKE) clean cd src ; $(MAKE) clean
cd addon/doxywizard ; $(MAKE) clean cd addon/doxywizard ; $(MAKE) clean
cd addon/xmlread ; $(MAKE) clean cd addon/xmlparse ; $(MAKE) clean
cd addon/xmlgen ; $(MAKE) clean
-rm -f bin/doxy* -rm -f bin/doxy*
-rm -f objects/*.o -rm -f objects/*.o
distclean: clean distclean: clean
cd src ; $(MAKE) distclean cd src ; $(MAKE) distclean
cd addon/doxywizard ; $(MAKE) distclean cd addon/doxywizard ; $(MAKE) distclean
cd addon/xmlread ; $(MAKE) distclean cd addon/xmlparse ; $(MAKE) distclean
cd addon/xmlgen ; $(MAKE) distclean
-rm -f lib/lib* -rm -f lib/lib*
-rm -f bin/doxy* -rm -f bin/doxy*
-rm -f html -rm -f html
...@@ -37,15 +33,9 @@ distclean: clean ...@@ -37,15 +33,9 @@ distclean: clean
-rm -f addon/doxywizard/obj/*.o -rm -f addon/doxywizard/obj/*.o
-rm -f addon/doxywizard/moc/moc_* -rm -f addon/doxywizard/moc/moc_*
-rm -f addon/doxywizard/config.cpp -rm -f addon/doxywizard/config.cpp
-rm -f addon/xmlread/xmlread.pro
-rm -f addon/xmlread/Makefile addon/xmlread/Makefile.xmlread
-rm -f addon/xmlread/*.o
-rm -f addon/xmlgen/xmlgen.pro
-rm -f addon/xmlgen/Makefile addon/xmlgen/Makefile.xmlgen
-rm -f addon/xmlgen/*.o
install: doxywizard_install xmlgen_install install: doxywizard_install
$(INSTTOOL) -d $(INSTALL)/bin $(INSTTOOL) -d $(INSTALL)/bin
$(INSTTOOL) -m 755 bin/doxygen $(INSTALL)/bin $(INSTTOOL) -m 755 bin/doxygen $(INSTALL)/bin
$(INSTTOOL) -m 755 bin/doxytag $(INSTALL)/bin $(INSTTOOL) -m 755 bin/doxytag $(INSTALL)/bin
......
DOXYGEN Version 1.2.8_20010723 DOXYGEN Version 1.2.9
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) (23 July 2001) Dimitri van Heesch (dimitri@stack.nl) (01 August 2001)
1.2.8-20010723 1.2.9
all clean depend: Makefile.xmlgen
$(MAKE) -f Makefile.xmlgen $@
distclean: clean
$(RM) -f Makefile.xmlgen
tmake:
$(ENV) $(PERL) $(TMAKE) xmlgen.pro >Makefile.xmlgen
Makefile.xmlgen: xmlgen.pro
$(ENV) $(PERL) $(TMAKE) xmlgen.pro >Makefile.xmlgen
install:
$(INSTTOOL) -d $(INSTALL)/bin
$(INSTTOOL) -m 755 ../../bin/doxygen_xml $(INSTALL)/bin
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- DTD describing the grammar used in doxygen's XML output -->
<!-- standard character entities -->
<!ENTITY lt "&#38;#60;">
<!ENTITY gt "&#62;">
<!ENTITY amp "&#38;#38;">
<!ENTITY apos "&#39;">
<!ENTITY quot "&#34;">
<!-- required attributes for compounds -->
<!ENTITY % compound-req.att
'id ID #REQUIRED
type (group|file|namespace|
class|struct|union|
interface|dispinterface|
valuetype|library) #REQUIRED'
>
<!-- required attributes for references -->
<!ENTITY % ref-req.att 'idref IDREF #REQUIRED'
>
<!-- required attributes for inheritance relations -->
<!ENTITY % inheritcompref-req.att
'%ref-req.att;
prot (public|protected|private) #REQUIRED
virt (non-virtual|virtual) #REQUIRED'
>
<!-- required attributes for member sections -->
<!ENTITY % sec-req.att 'type (user
|public-type
|public-func
|public-attrib
|public-slot
|public-static-func
|public-static-attrib
|protected-type
|protected-func
|protected-attrib
|protected-slot
|protected-static-func
|protected-static-attrib
|private-type
|private-func
|private-attrib
|private-slot
|private-static-func
|private-static-attrib
|signal
|friend
|related
|define|prototype|typedef|enum|func|var
|dcop-func
|property
) #REQUIRED
'
>
<!-- required attributes for members -->
<!ENTITY % mem-req.att 'id ID #REQUIRED'>
<!-- optional attributes for function -->
<!ENTITY % func-opt.att 'virt (virtual|pure-virtual) #IMPLIED'>
<!-- elements -->
<!ELEMENT doxygen (compoundlist?)>
<!ELEMENT compoundlist (compounddef)+>
<!ELEMENT compounddef (compoundname,
basecompoundlist?,
derivedcompoundlist?,
sectionlist?
)
>
<!ATTLIST compounddef %compound-req.att;>
<!ELEMENT basecompoundlist (basecompoundref)+>
<!ELEMENT derivedcompoundlist (derivedcompoundref)+>
<!ELEMENT compoundref (#PCDATA)>
<!ATTLIST compoundref %ref-req.att;>
<!ELEMENT memberref (#PCDATA)>
<!ATTLIST memberref %ref-req.att;>
<!ELEMENT basecompoundref EMPTY>
<!ATTLIST basecompoundref %inheritcompref-req.att;>
<!ELEMENT derivedcompoundref EMPTY>
<!ATTLIST derivedcompoundref %inheritcompref-req.att;>
<!ELEMENT sectionlist (sectiondef)+>
<!ELEMENT sectiondef (memberlist)>
<!ATTLIST sectiondef %sec-req.att;>
<!ELEMENT memberlist (functiondef|variabledef|typedef|definedef|enumdef)+>
<!ELEMENT functiondef (type?,name,paramlist)>
<!ATTLIST functiondef %mem-req.att; %func-opt.att;>
<!ELEMENT variabledef (type,name,array?,initializer?)>
<!ATTLIST variabledef %mem-req.att;>
<!ELEMENT typedef (type,name)>
<!ATTLIST typedef %mem-req.att;>
<!ELEMENT definedef (name,defparamlist?,initializer?)>
<!ATTLIST definedef %mem-req.att;>
<!ELEMENT enumdef (name,enumvaluelist)>
<!ATTLIST enumdef %mem-req.att;>
<!ELEMENT slotdef (type,name,paramlist)>
<!ATTLIST slotdef %mem-req.att;>
<!ELEMENT signaldef (type,name,paramlist)>
<!ATTLIST signaldef %mem-req.att;>
<!ELEMENT paramlist (param)*>
<!ELEMENT param (attributes?,type,declname?,defname?,array?,defval?)>
<!ELEMENT defparamlist (defarg)*>
<!ELEMENT defarg (#PCDATA)>
<!ELEMENT enumvaluelist (enumvalue)*>
<!ELEMENT enumvalue (name,initializer?)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT compoundname (#PCDATA)>
<!ELEMENT declname (#PCDATA)>
<!ELEMENT defname (#PCDATA)>
<!ELEMENT type (#PCDATA|memberref|compoundref|compounddef)*>
<!ELEMENT defval (#PCDATA|memberref|compoundref)*>
<!ELEMENT initializer (#PCDATA|memberref|compoundref)*>
<!ELEMENT array (#PCDATA)>
<!ELEMENT attributes (#PCDATA)>
/******************************************************************************
*
* $Id$
*
*
* Copyright (C) 1997-2001 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
* granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
* Documents produced by Doxygen are derivative works derived from the
* input used in their production; they are not affected by this license.
*
*/
#include "doxygen.h"
#include "message.h"
#include "xml.h"
/*! \file
* \brief main entry point for doxygen's XML generator
*
* This file contains main()
*/
/*! Main that generate XML output
*
*/
int main(int argc,char **argv)
{
initDoxygen();
readConfiguration(argc,argv);
parseInput();
msg("Generating XML output\n");
generateXML();
return 0;
}
/******************************************************************************
*
* $Id$
*
*
* Copyright (C) 1997-2001 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
* granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
* Documents produced by Doxygen are derivative works derived from the
* input used in their production; they are not affected by this license.
*
*/
#include <stdlib.h>
#include "qtbc.h"
#include "xml.h"
#include "doxygen.h"
#include "message.h"
#include "config.h"
#include "classlist.h"
#include "util.h"
#include "defargs.h"
#include <qdir.h>
#include <qfile.h>
#include <qtextstream.h>
const char dtd_data[]=
#include "xml_dtd.h"
;
class TextGeneratorXMLImpl : public TextGeneratorIntf
{
public:
TextGeneratorXMLImpl(QTextStream &t): m_t(t) {}
void writeString(const char *s) const
{
writeXMLString(m_t,s);
}
void writeBreak() const {}
void writeLink(const char *extRef,const char *file,
const char *anchor,const char *text
) const
{
if (extRef==0)
{ writeXMLLink(m_t,file,anchor,text); }
else // external references are not supported for XML
{ writeXMLString(m_t,text); }
}
private:
QTextStream &m_t;
};
void generateDTD()
{
QCString fileName=Config_getString("OUTPUT_DIRECTORY")+"/xml/doxygen.dtd";
QFile f(fileName);
if (!f.open(IO_WriteOnly))
{
err("Cannot open file %s for writing!\n",fileName.data());
return;
}
QTextStream t(&f);
t << dtd_data;
}
void writeXMLString(QTextStream &t,const char *s)
{
t << convertToXML(s);
}
void writeXMLLink(QTextStream &t,const char *compoundId,const char *memId,
const char *text)
{
if (memId==0)
{
t << "<compoundref idref=\"" << compoundId << "\">";
writeXMLString(t,text);
t << "</compoundref>";
}
else
{
t << "<memberref idref=\"" << compoundId << ":" << memId << "\">";
writeXMLString(t,text);
t << "</memberref>";
}
}
void generateXMLForMember(MemberDef *md,QTextStream &t,Definition *def)
{
if (md->memberType()==MemberDef::EnumValue) return;
QCString scopeName;
if (md->getClassDef())
scopeName=md->getClassDef()->name();
else if (md->getNamespaceDef())
scopeName=md->getNamespaceDef()->name();
t << " <";
enum { define_t,variable_t,typedef_t,enum_t,function_t } xmlType = function_t;
switch (md->memberType())
{
case MemberDef::Define: t << "definedef"; xmlType=define_t; break;
case MemberDef::EnumValue: // fall through
case MemberDef::Property: // fall through
case MemberDef::Variable: t << "variabledef"; xmlType=variable_t; break;
case MemberDef::Typedef: t << "typedef"; xmlType=typedef_t; break;
case MemberDef::Enumeration: t << "enumdef"; xmlType=enum_t; break;
case MemberDef::Function: // fall through
case MemberDef::Signal: // fall through
case MemberDef::Prototype: // fall through
case MemberDef::Friend: // fall through
case MemberDef::DCOP: // fall through
case MemberDef::Slot: t << "functiondef"; xmlType=function_t; break;
}
t << " id=\"";
t << def->getOutputFileBase()
<< "__" // can we change this to a non ID char?
// : do not seem allowed for some parsers!
<< md->anchor();
t << "\"";
if (xmlType==function_t && md->virtualness()!=Normal)
// functions has an extra "virt" attribute
{
t << " virt=\"";
switch (md->virtualness())
{
case Virtual: t << "virtual"; break;
case Pure: t << "pure-virtual"; break;
default: ASSERT(0);
}
t << "\"";
}
t << ">" << endl;
if (xmlType!=define_t && xmlType!=enum_t && // These don't have types.
(xmlType!=function_t || md->typeString()!=0) // Type is optional here.
)
{
QCString typeStr = replaceAnonymousScopes(md->typeString());
if (xmlType==typedef_t && typeStr.left(8)=="typedef ")
typeStr=typeStr.right(typeStr.length()-8);
if (xmlType==function_t && typeStr.left(8)=="virtual ")
typeStr=typeStr.right(typeStr.length()-8);
t << " <type>";
linkifyText(TextGeneratorXMLImpl(t),scopeName,md->name(),typeStr);
t << "</type>" << endl;
}
t << " <name>";
writeXMLString(t,md->name());
t << "</name>" << endl;
if (xmlType==function_t) //function
{
t << " <paramlist>" << endl;
ArgumentList *declAl = new ArgumentList;
ArgumentList *defAl = md->argumentList();
stringToArgumentList(md->argsString(),declAl);
if (declAl->count()>0)
{
ArgumentListIterator declAli(*declAl);
ArgumentListIterator defAli(*defAl);
Argument *a;
for (declAli.toFirst();(a=declAli.current());++declAli)
{
Argument *defArg = defAli.current();
t << " <param>" << endl;
if (!a->attrib.isEmpty())
{
t << " <attributes>";
writeXMLString(t,a->attrib);
t << "</attributes>" << endl;
}
if (!a->type.isEmpty())
{
t << " <type>";
linkifyText(TextGeneratorXMLImpl(t),scopeName,md->name(),a->type);
t << "</type>" << endl;
}
if (!a->name.isEmpty())
{
t << " <declname>";
writeXMLString(t,a->name);
t << "</declname>" << endl;
}
if (defArg && !defArg->name.isEmpty() && defArg->name!=a->name)
{
t << " <defname>";
writeXMLString(t,defArg->name);
t << "</defname>" << endl;
}
if (!a->array.isEmpty())
{
t << " <array>";
writeXMLString(t,a->array);
t << "</array>" << endl;
}
if (!a->defval.isEmpty())
{
t << " <defval>";
linkifyText(TextGeneratorXMLImpl(t),scopeName,md->name(),a->defval);
t << "</defval>" << endl;
}
t << " </param>" << endl;
if (defArg) ++defAli;
}
}
delete declAl;
t << " </paramlist>" << endl;
}
else if (xmlType==define_t && md->argsString()!=0) // define
{
t << " <defparamlist>" << endl;
ArgumentListIterator ali(*md->argumentList());
Argument *a;
for (ali.toFirst();(a=ali.current());++ali)
{
t << " <defarg>" << a->type << "</defarg>" << endl;
}
t << " </defparamlist>" << endl;
if (!md->initializer().isEmpty())
{
t << " <initializer>";
linkifyText(TextGeneratorXMLImpl(t),scopeName,md->name(),md->initializer());
t << "</initializer>" << endl;
}
}
else if (xmlType==enum_t) // enum
{
t << " <enumvaluelist>" << endl;
if (md->enumFieldList())
{
MemberListIterator emli(*md->enumFieldList());
MemberDef *emd;
for (emli.toFirst();(emd=emli.current());++emli)
{
t << " <enumvalue>" << endl;
t << " <name>";
writeXMLString(t,emd->name());
t << "</name>" << endl;
if (!emd->initializer().isEmpty())
{
t << " <initializer>";
writeXMLString(t,emd->initializer());
t << "</initializer>" << endl;
}
t << " </enumvalue>" << endl;
}
}
t << " </enumvaluelist>" << endl;
}
t << " </";
switch (md->memberType())
{
case MemberDef::Define: t << "definedef"; break;
case MemberDef::EnumValue: // fall through
case MemberDef::Property: // fall through
case MemberDef::Variable: t << "variabledef"; break;
case MemberDef::Typedef: t << "typedef"; break;
case MemberDef::Enumeration: t << "enumdef"; break;
case MemberDef::Function: // fall through
case MemberDef::Signal: // fall through
case MemberDef::Prototype: // fall through
case MemberDef::Friend: // fall through
case MemberDef::DCOP: // fall through
case MemberDef::Slot: t << "functiondef"; break;
}
t << ">" << endl;
}
void generateXMLClassSection(ClassDef *cd,QTextStream &t,MemberList *ml,const char *type)
{
if (ml->count()>0)
{
t << " <sectiondef type=\"" << type << "\">" << endl;
t << " <memberlist>" << endl;
MemberListIterator mli(*ml);
MemberDef *md;
for (mli.toFirst();(md=mli.current());++mli)
{
generateXMLForMember(md,t,cd);
}
t << " </memberlist>" << endl;
t << " </sectiondef>" << endl;
}
}
void generateXMLForClass(ClassDef *cd,QTextStream &t)
{
if (cd->name().find('@')!=-1) return; // skip anonymous compounds
t << " <compounddef id=\""
<< cd->getOutputFileBase() << "\" type=\""
<< cd->compoundTypeString() << "\">" << endl;
t << " <compoundname>";
writeXMLString(t,cd->name());
t << "</compoundname>" << endl;
if (cd->baseClasses()->count()>0)
{
t << " <basecompoundlist>" << endl;
BaseClassListIterator bcli(*cd->baseClasses());
BaseClassDef *bcd;
for (bcli.toFirst();(bcd=bcli.current());++bcli)
{
t << " <basecompoundref idref=\""
<< bcd->classDef->getOutputFileBase()
<< "\" prot=\"";
switch (bcd->prot)
{
case Public: t << "public"; break;
case Protected: t << "protected"; break;
case Private: t << "private"; break;
}
t << "\" virt=\"";
switch(bcd->virt)
{
case Normal: t << "non-virtual"; break;
case Virtual: t << "virtual"; break;
case Pure: t <<"pure-virtual"; break;
}
t << "\"/>" << endl;
}
t << " </basecompoundlist>" << endl;
}
if (cd->subClasses()->count()>0)
{
t << " <derivedcompoundlist>" << endl;
BaseClassListIterator bcli(*cd->subClasses());
BaseClassDef *bcd;
for (bcli.toFirst();(bcd=bcli.current());++bcli)
{
t << " <derivedcompoundref idref=\""
<< bcd->classDef->getOutputFileBase()
<< "\" prot=\"";
switch (bcd->prot)
{
case Public: t << "public"; break;
case Protected: t << "protected"; break;
case Private: t << "private"; break;
}
t << "\" virt=\"";
switch(bcd->virt)
{
case Normal: t << "non-virtual"; break;
case Virtual: t << "virtual"; break;
case Pure: t << "pure-virtual"; break;
}
t << "\"/>" << endl;
}
t << " </derivedcompoundlist>" << endl;
}
int numMembers =
cd->pubTypes.count()+cd->pubMembers.count()+cd->pubAttribs.count()+
cd->pubSlots.count()+cd->signals.count()+cd->dcopMethods.count()+
cd->pubStaticMembers.count()+
cd->pubStaticAttribs.count()+cd->proTypes.count()+cd->proMembers.count()+
cd->proAttribs.count()+cd->proSlots.count()+cd->proStaticMembers.count()+
cd->proStaticAttribs.count()+cd->priTypes.count()+cd->priMembers.count()+
cd->priAttribs.count()+cd->priSlots.count()+cd->priStaticMembers.count()+
cd->priStaticAttribs.count()+cd->friends.count()+cd->related.count();
if (numMembers>0)
{
t << " <sectionlist>" << endl;
generateXMLClassSection(cd,t,&cd->pubTypes,"public-type");
generateXMLClassSection(cd,t,&cd->pubMembers,"public-func");
generateXMLClassSection(cd,t,&cd->pubAttribs,"public-attrib");
generateXMLClassSection(cd,t,&cd->pubSlots,"public-slot");
generateXMLClassSection(cd,t,&cd->signals,"signal");
generateXMLClassSection(cd,t,&cd->dcopMethods,"dcop-func");
generateXMLClassSection(cd,t,&cd->properties,"property");
generateXMLClassSection(cd,t,&cd->pubStaticMembers,"public-static-func");
generateXMLClassSection(cd,t,&cd->pubStaticAttribs,"public-static-attrib");
generateXMLClassSection(cd,t,&cd->proTypes,"protected-type");
generateXMLClassSection(cd,t,&cd->proMembers,"protected-func");
generateXMLClassSection(cd,t,&cd->proAttribs,"protected-attrib");
generateXMLClassSection(cd,t,&cd->proSlots,"protected-slot");
generateXMLClassSection(cd,t,&cd->proStaticMembers,"protected-static-func");
generateXMLClassSection(cd,t,&cd->proStaticAttribs,"protected-static-attrib");
generateXMLClassSection(cd,t,&cd->priTypes,"private-type");
generateXMLClassSection(cd,t,&cd->priMembers,"private-func");
generateXMLClassSection(cd,t,&cd->priAttribs,"private-attrib");
generateXMLClassSection(cd,t,&cd->priSlots,"private-slot");
generateXMLClassSection(cd,t,&cd->priStaticMembers,"private-static-func");
generateXMLClassSection(cd,t,&cd->priStaticAttribs,"private-static-attrib");
generateXMLClassSection(cd,t,&cd->friends,"signal");
generateXMLClassSection(cd,t,&cd->related,"related");
t << " </sectionlist>" << endl;
}
t << " </compounddef>" << endl;
}
void generateXMLFileSection(FileDef *fd,QTextStream &t,MemberList *ml,const char *type)
{
if (ml->count()>0)
{
t << " <sectiondef type=\"" << type << "\">" << endl;
t << " <memberlist>" << endl;
MemberListIterator mli(*ml);
MemberDef *md;
for (mli.toFirst();(md=mli.current());++mli)
{
generateXMLForMember(md,t,fd);
}
t << " </memberlist>" << endl;
t << " </sectiondef>" << endl;
}
}
void generateXMLForFile(FileDef *fd,QTextStream &t)
{
t << " <compounddef id=\""
<< fd->getOutputFileBase() << "\" type=\"file\">" << endl;
t << " <compoundname>";
writeXMLString(t,fd->name());
t << "</compoundname>" << endl;
int numMembers = fd->decDefineMembers.count()+fd->decProtoMembers.count()+
fd->decTypedefMembers.count()+fd->decEnumMembers.count()+
fd->decFuncMembers.count()+fd->decVarMembers.count();
if (numMembers>0)
{
t << " <sectionlist>" << endl;
generateXMLFileSection(fd,t,&fd->decDefineMembers,"define");
generateXMLFileSection(fd,t,&fd->decProtoMembers,"prototype");
generateXMLFileSection(fd,t,&fd->decTypedefMembers,"typedef");
generateXMLFileSection(fd,t,&fd->decEnumMembers,"enum");
generateXMLFileSection(fd,t,&fd->decFuncMembers,"func");
generateXMLFileSection(fd,t,&fd->decVarMembers,"var");
t << " </sectionlist>" << endl;
}
t << " </compounddef>" << endl;
}
void generateXML()
{
if (Config_getString("OUTPUT_DIRECTORY").isEmpty())
Config_getString("OUTPUT_DIRECTORY")=QDir::currentDirPath();
else
{
QDir dir(Config_getString("OUTPUT_DIRECTORY"));
if (!dir.exists())
{
dir.setPath(QDir::currentDirPath());
if (!dir.mkdir(Config_getString("OUTPUT_DIRECTORY")))
{
err("Error: tag OUTPUT_DIRECTORY: Output directory `%s' does not "
"exist and cannot be created\n",Config_getString("OUTPUT_DIRECTORY").data());
exit(1);
}
else if (!Config_getBool("QUIET"))
{
err("Notice: Output directory `%s' does not exist. "
"I have created it for you.\n", Config_getString("OUTPUT_DIRECTORY").data());
}
dir.cd(Config_getString("OUTPUT_DIRECTORY"));
}
Config_getString("OUTPUT_DIRECTORY")=dir.absPath();
}
QDir dir(Config_getString("OUTPUT_DIRECTORY"));
if (!dir.exists())
{
dir.setPath(QDir::currentDirPath());
if (!dir.mkdir(Config_getString("OUTPUT_DIRECTORY")))
{
err("Cannot create directory %s\n",Config_getString("OUTPUT_DIRECTORY").data());
return;
}
}
QDir xmlDir(Config_getString("OUTPUT_DIRECTORY")+"/xml");
if (!xmlDir.exists() && !xmlDir.mkdir(Config_getString("OUTPUT_DIRECTORY")+"/xml"))
{
err("Could not create xml directory in %s\n",Config_getString("OUTPUT_DIRECTORY").data());
return;
}
generateDTD();
QCString fileName=Config_getString("OUTPUT_DIRECTORY")+"/xml/doxygen.xml";
QFile f(fileName);
if (!f.open(IO_WriteOnly))
{
err("Cannot open file %s for writing!\n",fileName.data());
return;
}
QTextStream t(&f);
t << "<?xml version='1.0' encoding='ISO-8859-1' standalone='no'?>" << endl;
t << "<!DOCTYPE doxygen SYSTEM \"doxygen.dtd\">" << endl;
t << "<doxygen>" << endl;
if (Doxygen::classSDict.count()+Doxygen::inputNameList.count()>0)
{
t << " <compoundlist>" << endl;
ClassSDict::Iterator cli(Doxygen::classSDict);
ClassDef *cd;
for (cli.toFirst();(cd=cli.current());++cli)
{
generateXMLForClass(cd,t);
}
FileNameListIterator fnli(Doxygen::inputNameList);
FileName *fn;
for (;(fn=fnli.current());++fnli)
{
FileNameIterator fni(*fn);
FileDef *fd;
for (;(fd=fni.current());++fni)
{
generateXMLForFile(fd,t);
}
}
t << " </compoundlist>" << endl;
}
t << "</doxygen>" << endl;
}
/******************************************************************************
*
* $Id$
*
* Copyright (C) 1997-2001 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
* granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
*/
#ifndef XML_H
#define XML_H
class QTextStream;
void generateXML();
void writeXMLString(QTextStream &t,const char *s);
void writeXMLString(QTextStream &t,const char *s);
void writeXMLLink(QTextStream &t,const char *compoundRef,const char *memAnchor,
const char *text);
#endif
"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"
"<!-- DTD describing the grammar used in doxygen's XML output -->\n"
"\n"
"<!-- standard character entities -->\n"
"<!ENTITY lt \"&#38;#60;\"> \n"
"<!ENTITY gt \"&#62;\"> \n"
"<!ENTITY amp \"&#38;#38;\"> \n"
"<!ENTITY apos \"&#39;\"> \n"
"<!ENTITY quot \"&#34;\"> \n"
"\n"
"<!-- required attributes for compounds -->\n"
"<!ENTITY % compound-req.att \n"
" 'id ID #REQUIRED\n"
" type (group|file|namespace|\n"
" class|struct|union|\n"
" interface|dispinterface|\n"
" valuetype|library) #REQUIRED'\n"
">\n"
"<!-- required attributes for references -->\n"
"<!ENTITY % ref-req.att 'idref IDREF #REQUIRED'\n"
">\n"
"<!-- required attributes for inheritance relations -->\n"
"<!ENTITY % inheritcompref-req.att\n"
" '%ref-req.att;\n"
" prot (public|protected|private) #REQUIRED\n"
" virt (non-virtual|virtual) #REQUIRED'\n"
">\n"
"\n"
"<!-- required attributes for member sections -->\n"
"<!ENTITY % sec-req.att 'type (user\n"
" |public-type\n"
" |public-func\n"
" |public-attrib\n"
" |public-slot\n"
" |public-static-func\n"
" |public-static-attrib\n"
" |protected-type\n"
" |protected-func\n"
" |protected-attrib\n"
" |protected-slot\n"
" |protected-static-func\n"
" |protected-static-attrib\n"
" |private-type\n"
" |private-func\n"
" |private-attrib\n"
" |private-slot\n"
" |private-static-func\n"
" |private-static-attrib\n"
" |signal\n"
" |friend\n"
" |related\n"
" |define|prototype|typedef|enum|func|var\n"
" |dcop-func\n"
" |property\n"
" ) #REQUIRED\n"
" '\n"
">\n"
"<!-- required attributes for members -->\n"
"<!ENTITY % mem-req.att 'id ID #REQUIRED'>\n"
"\n"
"<!-- optional attributes for function -->\n"
"<!ENTITY % func-opt.att 'virt (virtual|pure-virtual) #IMPLIED'>\n"
"\n"
"<!-- elements -->\n"
"<!ELEMENT doxygen (compoundlist?)>\n"
"<!ELEMENT compoundlist (compounddef)+>\n"
"<!ELEMENT compounddef (compoundname,\n"
" basecompoundlist?, \n"
" derivedcompoundlist?, \n"
" sectionlist? \n"
" )\n"
">\n"
"<!ATTLIST compounddef %compound-req.att;>\n"
"<!ELEMENT basecompoundlist (basecompoundref)+>\n"
"<!ELEMENT derivedcompoundlist (derivedcompoundref)+>\n"
"<!ELEMENT compoundref (#PCDATA)>\n"
"<!ATTLIST compoundref %ref-req.att;>\n"
"<!ELEMENT memberref (#PCDATA)>\n"
"<!ATTLIST memberref %ref-req.att;>\n"
"<!ELEMENT basecompoundref EMPTY>\n"
"<!ATTLIST basecompoundref %inheritcompref-req.att;>\n"
"<!ELEMENT derivedcompoundref EMPTY>\n"
"<!ATTLIST derivedcompoundref %inheritcompref-req.att;>\n"
"<!ELEMENT sectionlist (sectiondef)+>\n"
"<!ELEMENT sectiondef (memberlist)>\n"
"<!ATTLIST sectiondef %sec-req.att;>\n"
"<!ELEMENT memberlist (functiondef|variabledef|typedef|definedef|enumdef)+>\n"
"<!ELEMENT functiondef (type?,name,paramlist)>\n"
"<!ATTLIST functiondef %mem-req.att; %func-opt.att;>\n"
"<!ELEMENT variabledef (type,name,array?,initializer?)>\n"
"<!ATTLIST variabledef %mem-req.att;>\n"
"<!ELEMENT typedef (type,name)>\n"
"<!ATTLIST typedef %mem-req.att;>\n"
"<!ELEMENT definedef (name,defparamlist?,initializer?)>\n"
"<!ATTLIST definedef %mem-req.att;>\n"
"<!ELEMENT enumdef (name,enumvaluelist)>\n"
"<!ATTLIST enumdef %mem-req.att;>\n"
"<!ELEMENT slotdef (type,name,paramlist)>\n"
"<!ATTLIST slotdef %mem-req.att;>\n"
"<!ELEMENT signaldef (type,name,paramlist)>\n"
"<!ATTLIST signaldef %mem-req.att;>\n"
"<!ELEMENT paramlist (param)*>\n"
"<!ELEMENT param (attributes?,type,declname?,defname?,array?,defval?)>\n"
"<!ELEMENT defparamlist (defarg)*>\n"
"<!ELEMENT defarg (#PCDATA)>\n"
"<!ELEMENT enumvaluelist (enumvalue)*>\n"
"<!ELEMENT enumvalue (name,initializer?)>\n"
"<!ELEMENT name (#PCDATA)>\n"
"<!ELEMENT compoundname (#PCDATA)>\n"
"<!ELEMENT declname (#PCDATA)>\n"
"<!ELEMENT defname (#PCDATA)>\n"
"<!ELEMENT type (#PCDATA|memberref|compoundref|compounddef)*>\n"
"<!ELEMENT defval (#PCDATA|memberref|compoundref)*>\n"
"<!ELEMENT initializer (#PCDATA|memberref|compoundref)*>\n"
"<!ELEMENT array (#PCDATA)>\n"
"<!ELEMENT attributes (#PCDATA)>\n"
"\n"
TEMPLATE = xmlgen.t
CONFIG = console warn_on $extraopt
HEADERS = xml.h xml_dtd.h
SOURCES = main.cpp xml.cpp
DEPENDPATH = ../../src
unix:LIBS += -L../../lib -ldoxygen -ldoxycfg -lqtools
win32:INCLUDEPATH += .
win32-mingw:LIBS += -L../../lib -ldoxygen -ldoxycfg -lqtools
win32-msvc:LIBS += qtools.lib doxygen.lib doxycfg.lib shell32.lib
win32-msvc:TMAKE_LFLAGS += /LIBPATH:..\..\lib
win32-borland:LIBS += qtools.lib doxygen.lib doxycfg.lib shell32.lib
win32-borland:TMAKE_LFLAGS += -L..\..\lib
win32:TMAKE_CXXFLAGS += -DQT_NODLL
INCLUDEPATH += ../../qtools ../../src
DESTDIR = ../../bin
TARGET = doxygen_xml
unix:TARGETDEPS = ../../lib/libdoxygen.a ../../lib/libdoxycfg.a
win32:TARGETDEPS = ..\..\lib\doxygen.lib ../../lib/doxycfg.lib
OBJECTS_DIR = obj
#
# $Id$
#
# Copyright (C) 1997-2001 by Dimitri van Heesch.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation under the terms of the GNU General Public License is hereby
# granted. No representations are made about the suitability of this software
# for any purpose. It is provided "as is" without express or implied warranty.
# See the GNU General Public License for more details.
#
# Documents produced by Doxygen are derivative works derived from the
# input used in their production; they are not affected by this license.
#!
#! doxygen.t: This is a custom template for building Doxygen
#!
#$ IncludeTemplate("app.t");
xml_dtd.h: doxygen.dtd
cat doxygen.dtd | sed -e "s/\"/\\\\\"/g" -e "s/^/\"/g" -e "s/$$/\\\\n\"/g" >xml_dtd.h
# Doxyfile 1.2.0 # Doxyfile 1.2.8-20010715
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# General configuration options # General configuration options
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
PROJECT_NAME = xmlread PROJECT_NAME = dox2html
PROJECT_NUMBER = PROJECT_NUMBER =
OUTPUT_DIRECTORY = doc OUTPUT_DIRECTORY = doc
OUTPUT_LANGUAGE = English OUTPUT_LANGUAGE = English
DISABLE_INDEX = NO EXTRACT_ALL = YES
EXTRACT_ALL = NO EXTRACT_PRIVATE = YES
EXTRACT_PRIVATE = NO EXTRACT_STATIC = YES
EXTRACT_STATIC = NO
HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = YES HIDE_UNDOC_CLASSES = NO
BRIEF_MEMBER_DESC = YES BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES REPEAT_BRIEF = YES
ALWAYS_DETAILED_SEC = NO ALWAYS_DETAILED_SEC = NO
...@@ -24,24 +23,32 @@ SOURCE_BROWSER = YES ...@@ -24,24 +23,32 @@ SOURCE_BROWSER = YES
INLINE_SOURCES = NO INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES STRIP_CODE_COMMENTS = YES
CASE_SENSE_NAMES = YES CASE_SENSE_NAMES = YES
SHORT_NAMES = NO
HIDE_SCOPE_NAMES = NO HIDE_SCOPE_NAMES = NO
VERBATIM_HEADERS = YES VERBATIM_HEADERS = YES
SHOW_INCLUDE_FILES = YES SHOW_INCLUDE_FILES = YES
JAVADOC_AUTOBRIEF = YES JAVADOC_AUTOBRIEF = NO
INHERIT_DOCS = YES INHERIT_DOCS = YES
INLINE_INFO = YES INLINE_INFO = YES
SORT_MEMBER_DOCS = YES SORT_MEMBER_DOCS = YES
DISTRIBUTE_GROUP_DOC = NO
TAB_SIZE = 8 TAB_SIZE = 8
ENABLED_SECTIONS = ENABLED_SECTIONS =
GENERATE_TODOLIST = YES GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
ALIASES =
MAX_INITIALIZER_LINES = 30
OPTIMIZE_OUTPUT_FOR_C = NO
SHOW_USED_FILES = YES
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to warning and progress messages # configuration options related to warning and progress messages
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
QUIET = NO QUIET = NO
WARNINGS = YES WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES WARN_IF_UNDOCUMENTED = YES
WARN_FORMAT = "$file:$line: $text" WARN_FORMAT =
WARN_LOGFILE =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the input files # configuration options related to the input files
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
...@@ -54,6 +61,7 @@ EXAMPLE_PATH = ...@@ -54,6 +61,7 @@ EXAMPLE_PATH =
EXAMPLE_PATTERNS = EXAMPLE_PATTERNS =
IMAGE_PATH = IMAGE_PATH =
INPUT_FILTER = INPUT_FILTER =
FILTER_SOURCE_FILES = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the alphabetical class index # configuration options related to the alphabetical class index
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
...@@ -64,17 +72,24 @@ IGNORE_PREFIX = ...@@ -64,17 +72,24 @@ IGNORE_PREFIX =
# configuration options related to the HTML output # configuration options related to the HTML output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_HTML = YES GENERATE_HTML = YES
HTML_OUTPUT = html HTML_OUTPUT =
HTML_HEADER = HTML_HEADER =
HTML_FOOTER = HTML_FOOTER =
HTML_STYLESHEET = HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO GENERATE_HTMLHELP = NO
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the LaTeX output # configuration options related to the LaTeX output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_LATEX = NO GENERATE_LATEX = NO
LATEX_OUTPUT = latex LATEX_OUTPUT =
COMPACT_LATEX = NO COMPACT_LATEX = NO
PAPER_TYPE = a4wide PAPER_TYPE = a4wide
EXTRA_PACKAGES = EXTRA_PACKAGES =
...@@ -86,16 +101,18 @@ LATEX_BATCHMODE = NO ...@@ -86,16 +101,18 @@ LATEX_BATCHMODE = NO
# configuration options related to the RTF output # configuration options related to the RTF output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_RTF = NO GENERATE_RTF = NO
RTF_OUTPUT = rtf RTF_OUTPUT =
COMPACT_RTF = NO COMPACT_RTF = NO
RTF_HYPERLINKS = NO RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE = RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the man page output # configuration options related to the man page output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_MAN = NO GENERATE_MAN = NO
MAN_OUTPUT = man MAN_OUTPUT =
MAN_EXTENSION = .3 MAN_EXTENSION =
MAN_LINKS = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the XML output # configuration options related to the XML output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
...@@ -114,10 +131,10 @@ EXPAND_AS_DEFINED = ...@@ -114,10 +131,10 @@ EXPAND_AS_DEFINED =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration::addtions related to external references # Configuration::addtions related to external references
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
TAGFILES = TAGFILES = ../../qtools_docs/qtools.tag=../../../../qtools_docs/html
GENERATE_TAGFILE = GENERATE_TAGFILE =
ALLEXTERNALS = NO ALLEXTERNALS = NO
PERL_PATH = /usr/bin/perl PERL_PATH =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration options related to the dot tool # Configuration options related to the dot tool
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
...@@ -125,18 +142,20 @@ HAVE_DOT = YES ...@@ -125,18 +142,20 @@ HAVE_DOT = YES
CLASS_GRAPH = YES CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES COLLABORATION_GRAPH = YES
INCLUDE_GRAPH = YES INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = NO INCLUDED_BY_GRAPH = YES
GRAPHICAL_HIERARCHY = YES GRAPHICAL_HIERARCHY = YES
DOT_PATH = DOT_PATH =
MAX_DOT_GRAPH_WIDTH = 1024 MAX_DOT_GRAPH_WIDTH = 3024
MAX_DOT_GRAPH_HEIGHT = 1024 MAX_DOT_GRAPH_HEIGHT = 3024
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration::addtions related to the search engine # Configuration::addtions related to the search engine
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
SEARCHENGINE = NO SEARCHENGINE = NO
CGI_NAME = search.cgi CGI_NAME =
CGI_URL = CGI_URL =
DOC_URL = DOC_URL =
DOC_ABSPATH = DOC_ABSPATH =
BIN_ABSPATH = /usr/local/bin/ BIN_ABSPATH =
EXT_DOC_PATHS = EXT_DOC_PATHS =
all clean depend: Makefile.xmlparse
$(MAKE) -f Makefile.xmlparse $@
distclean: clean
$(RM) -rf Makefile.xmlparse xmlparse.pro Makefile obj
tmake:
$(ENV) $(PERL) $(TMAKE) xmlparse.pro >Makefile.xmlparse
Makefile.xmlparse: xmlparse.pro
$(ENV) $(PERL) $(TMAKE) xmlparse.pro >Makefile.xmlparse
install:
$(INSTTOOL) -d $(INSTALL)/bin
$(INSTTOOL) -m 755 ../../bin/xmlparse $(INSTALL)/bin
#ifndef _BASEHANDLER_H
#define _BASEHANDLER_H
#include <qxml.h>
#include <qdict.h>
#include <qstring.h>
class IBaseHandler
{
public:
virtual void setDelegate(QXmlDefaultHandler *delegate) = 0;
virtual QXmlDefaultHandler *delegate() const = 0;
};
class IFallBackHandler
{
public:
virtual bool handleStartElement(const QString & name,
const QXmlAttributes & attrib) = 0;
virtual bool handleEndElement(const QString &name) = 0;
};
template<class T> class ElementMapper
{
class StartElementHandler
{
typedef void (T::*Handler)(const QXmlAttributes &attrib);
public:
StartElementHandler() : m_parent(0) {}
StartElementHandler(T *parent, Handler h)
: m_parent(parent), m_handler(h) {}
void operator()(const QXmlAttributes &attrib)
{ if (m_parent) (m_parent->*m_handler)(attrib); }
private:
T *m_parent;
Handler m_handler;
};
class EndElementHandler
{
typedef void (T::*Handler)();
public:
EndElementHandler() : m_parent(0) {}
EndElementHandler(T *parent, Handler h)
: m_parent(parent), m_handler(h) {}
void operator()()
{ if (m_parent) (m_parent->*m_handler)(); }
private:
T *m_parent;
Handler m_handler;
};
typedef StartElementHandler<T> StartElementHandlerT;
typedef EndElementHandler<T> EndElementHandlerT;
public:
ElementMapper() : m_startHandlers(67), m_endHandlers(67)
{
m_startHandlers.setAutoDelete(TRUE);
m_endHandlers.setAutoDelete(TRUE);
}
virtual ~ElementMapper()
{
}
void addStartHandler(const char *key)
{
m_startHandlers.insert(key,new StartElementHandlerT);
}
void addStartHandler(const char *key, T *obj, void (T::*handler)(const QXmlAttributes &))
{
m_startHandlers.insert(key,new StartElementHandlerT(obj,handler));
}
void addEndHandler(const char *key)
{
m_endHandlers.insert(key,new EndElementHandlerT);
}
void addEndHandler(const char *key, T *obj, void (T::*handler)())
{
m_endHandlers.insert(key,new EndElementHandlerT(obj,handler));
}
protected:
QDict<StartElementHandlerT> m_startHandlers;
QDict<EndElementHandlerT> m_endHandlers;
};
template<class T> class BaseHandler : public IBaseHandler,
public QXmlDefaultHandler,
public ElementMapper<T>
{
public:
BaseHandler() : m_delegateHandler(0), m_fallBackHandler(0)
{
}
virtual ~BaseHandler()
{
delete m_fallBackHandler;
}
virtual bool startDocument()
{
return TRUE;
}
virtual bool startElement( const QString & namespaceURI,
const QString & localName,
const QString & name,
const QXmlAttributes & attrib
)
{
if (m_delegateHandler)
{
return m_delegateHandler->startElement(namespaceURI,localName,name,attrib);
}
if (!m_skipUntil.isEmpty()) // skip mode
{
if (m_skipUntil==name) m_skipCount++;
printf("skipping start tag %s count=%d\n",name.data(),m_skipCount);
return TRUE;
}
StartElementHandlerT *handler = m_startHandlers[name];
if (handler)
{
(*handler)(attrib);
//printf("found start tag %s\n",name.data());
}
else if (m_fallBackHandler &&
!m_fallBackHandler->handleStartElement(name,attrib)
)
{
printf("found unexpected tag `%s', skipping until matching end tag\n",name.data());
m_skipUntil = name;
m_skipCount=1;
}
return TRUE;
}
virtual bool endElement( const QString& namespaceURI, const QString& localName, const QString& name )
{
if (m_delegateHandler)
{
return m_delegateHandler->endElement(namespaceURI,localName,name);
}
if (name==m_skipUntil)
{
m_skipCount--;
printf("skipping end tag %s count=%d\n",name.data(),m_skipCount);
if (m_skipCount==0)
{
m_skipUntil="";
}
//printf("found end tag %s\n",name.data());
}
else if (m_skipUntil.isEmpty())
{
EndElementHandlerT *handler = m_endHandlers[name];
if (handler)
{
(*handler)();
//printf("found end tag %s\n",name.data());
}
else if (m_fallBackHandler)
{
m_fallBackHandler->handleEndElement(name);
}
}
m_curString="";
return TRUE;
}
virtual bool characters ( const QString & ch )
{
if (m_delegateHandler)
{
return m_delegateHandler->characters(ch);
}
m_curString+=ch;
return TRUE;
}
void setDelegate(QXmlDefaultHandler *delegate)
{
m_delegateHandler = delegate;
}
QXmlDefaultHandler *delegate() const
{
return m_delegateHandler;
}
void setFallBackHandler(IFallBackHandler *h)
{
m_fallBackHandler = h;
}
IFallBackHandler *fallBackHandler() const
{
return m_fallBackHandler;
}
protected:
QString m_curString;
QString m_skipUntil;
int m_skipCount;
QXmlDefaultHandler *m_delegateHandler;
IFallBackHandler *m_fallBackHandler;
};
template<class T> class BaseFallBackHandler : public ElementMapper<T>,
public IFallBackHandler
{
public:
BaseFallBackHandler()
{
}
virtual ~BaseFallBackHandler()
{
}
bool handleStartElement(const QString & name,
const QXmlAttributes & attrib)
{
StartElementHandlerT *handler = m_startHandlers[name];
if (handler)
{
(*handler)(attrib);
return TRUE;
}
return FALSE;
}
bool handleEndElement(const QString &name)
{
EndElementHandlerT *handler = m_endHandlers[name];
if (handler)
{
(*handler)();
return TRUE;
}
return FALSE;
}
};
#endif
#include "mainhandler.h"
#include "compoundhandler.h"
#include "dochandler.h"
CompoundHandler::CompoundHandler(IBaseHandler *parent)
: m_parent(parent), m_brief(0), m_detailed(0)
{
m_superClasses.setAutoDelete(TRUE);
addEndHandler("compounddef",this,&CompoundHandler::endCompound);
addStartHandler("compoundname");
addEndHandler("compoundname",this,&CompoundHandler::endCompoundName);
addStartHandler("derivedcompoundref",this,&CompoundHandler::addSubClass);
addEndHandler("derivedcompoundref");
addStartHandler("basecompoundref",this,&CompoundHandler::addSuperClass);
addEndHandler("basecompoundref");
addStartHandler("briefdescription",this,&CompoundHandler::startBriefDesc);
addStartHandler("detaileddescription",this,&CompoundHandler::startDetailedDesc);
addStartHandler("sectiondef",this,&CompoundHandler::startSection);
}
CompoundHandler::~CompoundHandler()
{
}
void CompoundHandler::startSection(const QXmlAttributes& attrib)
{
SectionHandler *sectHandler = new SectionHandler(this);
sectHandler->startSection(attrib);
m_sections.append(sectHandler);
}
void CompoundHandler::startBriefDesc(const QXmlAttributes& attrib)
{
DocHandler *docHandler = new DocHandler(this);
docHandler->startDoc(attrib);
m_brief = docHandler;
}
void CompoundHandler::startDetailedDesc(const QXmlAttributes& attrib)
{
DocHandler *docHandler = new DocHandler(this);
docHandler->startDoc(attrib);
m_detailed = docHandler;
}
void CompoundHandler::startCompound(const QXmlAttributes& attrib)
{
m_parent->setDelegate(this);
m_id = attrib.value("id");
m_kind = attrib.value("kind");
printf("startCompound(id=`%s' type=`%s')\n",m_id.data(),m_kind.data());
}
void CompoundHandler::endCompound()
{
printf("endCompound()\n");
m_parent->setDelegate(0);
}
void CompoundHandler::endCompoundName()
{
m_name = m_curString.stripWhiteSpace();
printf("Compound name `%s'\n",m_name.data());
}
void CompoundHandler::addSuperClass(const QXmlAttributes& attrib)
{
SuperClass *sc=new SuperClass(
attrib.value("idref"),
attrib.value("prot"),
attrib.value("virt")
);
printf("super class id=`%s' prot=`%s' virt=`%s'\n",
sc->m_id.data(),
sc->m_protection.data(),
sc->m_virtualness.data());
m_superClasses.append(sc);
}
void CompoundHandler::addSubClass(const QXmlAttributes& attrib)
{
SubClass *sc = new SubClass(
attrib.value("idref"),
attrib.value("prot"),
attrib.value("virt")
);
printf("sub class id=`%s' prot=`%s' virt=`%s'\n",
sc->m_id.data(),
sc->m_protection.data(),
sc->m_virtualness.data());
m_subClasses.append(sc);
}
#ifndef _COMPOUNDHANDLER_H
#define _COMPOUNDHANDLER_H
#include <qstring.h>
#include <qlist.h>
#include <qxml.h>
#include "basehandler.h"
#include "sectionhandler.h"
class DocHandler;
class CompoundHandler : public BaseHandler<CompoundHandler>
{
public:
virtual void startSection(const QXmlAttributes& attrib);
virtual void startCompound(const QXmlAttributes& attrib);
virtual void addSuperClass(const QXmlAttributes& attrib);
virtual void addSubClass(const QXmlAttributes& attrib);
virtual void endCompound();
virtual void endCompoundName();
virtual void startBriefDesc(const QXmlAttributes& attrib);
virtual void startDetailedDesc(const QXmlAttributes& attrib);
CompoundHandler(IBaseHandler *parent);
virtual ~CompoundHandler();
private:
struct SuperClass
{
SuperClass(const QString &id,const QString &prot,const QString &virt) :
m_id(id),m_protection(prot),m_virtualness(virt) {}
QString m_id;
QString m_protection;
QString m_virtualness;
};
struct SubClass
{
SubClass(const QString &id,const QString &prot,const QString &virt) :
m_id(id),m_protection(prot),m_virtualness(virt) {}
QString m_id;
QString m_protection;
QString m_virtualness;
};
QList<SuperClass> m_superClasses;
QList<SubClass> m_subClasses;
QList<SectionHandler> m_sections;
IBaseHandler *m_parent;
DocHandler *m_brief;
DocHandler *m_detailed;
QString m_id;
QString m_kind;
QString m_name;
};
#endif
#include "dochandler.h"
//----------------------------------------------------------------------
// MarkupHandler
//----------------------------------------------------------------------
MarkupHandler::MarkupHandler(QList<DocNode> &children,QString &curString)
: m_children(children), m_curString(curString), m_curMarkup(DocNode::Normal)
{
addStartHandler("bold",this,&MarkupHandler::startBold);
addEndHandler("bold",this,&MarkupHandler::endBold);
addStartHandler("emphasis",this,&MarkupHandler::startEmphasis);
addEndHandler("emphasis",this,&MarkupHandler::endEmphasis);
addStartHandler("computeroutput",this,&MarkupHandler::startComputerOutput);
addEndHandler("computeroutput",this,&MarkupHandler::endComputerOutput);
addStartHandler("center",this,&MarkupHandler::startCenter);
addEndHandler("center",this,&MarkupHandler::endCenter);
addStartHandler("small",this,&MarkupHandler::startSmallFont);
addEndHandler("small",this,&MarkupHandler::endSmallFont);
addStartHandler("subscript",this,&MarkupHandler::startSubscript);
addEndHandler("subscript",this,&MarkupHandler::endSubscript);
addStartHandler("superscript",this,&MarkupHandler::startSuperscript);
addEndHandler("superscript",this,&MarkupHandler::endSuperscript);
}
MarkupHandler::~MarkupHandler()
{
}
void MarkupHandler::addTextNode()
{
if (!m_curString.isEmpty())
{
m_children.append(new TextNode(m_curString,m_curMarkup));
printf("addTextNode() text=%s markup=%x\n",m_curString.data(),m_curMarkup);
m_curString="";
}
}
void MarkupHandler::startBold(const QXmlAttributes & /*attrib*/)
{
addTextNode();
m_children.append(new MarkupModifierNode(DocNode::Bold,TRUE));
m_curMarkup |= DocNode::Bold;
}
void MarkupHandler::endBold()
{
addTextNode();
m_children.append(new MarkupModifierNode(DocNode::Bold,FALSE));
m_curMarkup &= ~DocNode::Bold;
}
void MarkupHandler::startEmphasis(const QXmlAttributes & /*attrib*/)
{
addTextNode();
m_children.append(new MarkupModifierNode(DocNode::Emphasis,TRUE));
m_curMarkup |= DocNode::Emphasis;
}
void MarkupHandler::endEmphasis()
{
addTextNode();
m_children.append(new MarkupModifierNode(DocNode::Emphasis,FALSE));
m_curMarkup &= ~DocNode::Emphasis;
}
void MarkupHandler::startComputerOutput(const QXmlAttributes & /*attrib*/)
{
addTextNode();
m_children.append(new MarkupModifierNode(DocNode::ComputerOutput,TRUE));
m_curMarkup |= DocNode::ComputerOutput;
}
void MarkupHandler::endComputerOutput()
{
addTextNode();
m_children.append(new MarkupModifierNode(DocNode::ComputerOutput,FALSE));
m_curMarkup &= ~DocNode::ComputerOutput;
}
void MarkupHandler::startCenter(const QXmlAttributes & /*attrib*/)
{
addTextNode();
m_children.append(new MarkupModifierNode(DocNode::Center,TRUE));
m_curMarkup |= DocNode::Center;
}
void MarkupHandler::endCenter()
{
addTextNode();
m_children.append(new MarkupModifierNode(DocNode::Center,FALSE));
m_curMarkup &= ~DocNode::Center;
}
void MarkupHandler::startSmallFont(const QXmlAttributes & /*attrib*/)
{
addTextNode();
m_children.append(new MarkupModifierNode(DocNode::SmallFont,TRUE));
m_curMarkup |= DocNode::SmallFont;
}
void MarkupHandler::endSmallFont()
{
addTextNode();
m_children.append(new MarkupModifierNode(DocNode::SmallFont,FALSE));
m_curMarkup &= ~DocNode::SmallFont;
}
void MarkupHandler::startSubscript(const QXmlAttributes & /*attrib*/)
{
addTextNode();
m_children.append(new MarkupModifierNode(DocNode::Subscript,TRUE));
m_curMarkup |= DocNode::Subscript;
}
void MarkupHandler::endSubscript()
{
addTextNode();
m_children.append(new MarkupModifierNode(DocNode::Subscript,FALSE));
m_curMarkup &= ~DocNode::Subscript;
}
void MarkupHandler::startSuperscript(const QXmlAttributes & /*attrib*/)
{
addTextNode();
m_children.append(new MarkupModifierNode(DocNode::Superscript,TRUE));
m_curMarkup |= DocNode::Superscript;
}
void MarkupHandler::endSuperscript()
{
addTextNode();
m_children.append(new MarkupModifierNode(DocNode::Superscript,FALSE));
m_curMarkup &= ~DocNode::Superscript;
}
//----------------------------------------------------------------------
// ListItemHandler
//----------------------------------------------------------------------
ListItemHandler::ListItemHandler(IBaseHandler *parent)
: DocNode(ListItem), m_parent(parent)
{
addEndHandler("listitem",this,&ListItemHandler::endListItem);
addStartHandler("para",this,&ListItemHandler::startParagraph);
}
ListItemHandler::~ListItemHandler()
{
}
void ListItemHandler::startListItem(const QXmlAttributes& /*attrib*/)
{
m_parent->setDelegate(this);
printf("start list item handler\n");
}
void ListItemHandler::endListItem()
{
printf("end list item handler\n");
m_parent->setDelegate(0);
}
void ListItemHandler::startParagraph(const QXmlAttributes& attrib)
{
ParagraphHandler *parHandler = new ParagraphHandler(this);
parHandler->startParagraph(attrib);
m_children.append(parHandler);
}
//----------------------------------------------------------------------
// ListHandler
//----------------------------------------------------------------------
ListHandler::ListHandler(NodeKind k,IBaseHandler *parent)
: DocNode(k), m_parent(parent)
{
m_children.setAutoDelete(TRUE);
const char *endListName=0;
switch(k)
{
case ItemizedList : endListName="itemizedlist"; break;
case OrderedList : endListName="orderedlist"; break;
default: ASSERT(0);
}
addEndHandler(endListName,this,&ListHandler::endList);
addStartHandler("listitem",this,&ListHandler::startListItem);
}
ListHandler::~ListHandler()
{
}
void ListHandler::startList(const QXmlAttributes& /*attrib*/)
{
m_parent->setDelegate(this);
}
void ListHandler::endList()
{
m_parent->setDelegate(0);
}
void ListHandler::startListItem(const QXmlAttributes& attrib)
{
ListItemHandler *liHandler = new ListItemHandler(this);
liHandler->startListItem(attrib);
m_children.append(liHandler);
}
//----------------------------------------------------------------------
// ParagraphHandler
//----------------------------------------------------------------------
ParagraphHandler::ParagraphHandler(IBaseHandler *parent)
: DocNode(Para), m_parent(parent)
{
m_children.setAutoDelete(TRUE);
m_markupHandler = new MarkupHandler(m_children,m_curString);
setFallBackHandler(m_markupHandler);
addEndHandler("para",this,&ParagraphHandler::endParagraph);
addStartHandler("itemizedlist",this,&ParagraphHandler::startItemizedList);
addStartHandler("orderedlist",this,&ParagraphHandler::startOrderedList);
}
ParagraphHandler::~ParagraphHandler()
{
}
void ParagraphHandler::startParagraph(const QXmlAttributes& /*attrib*/)
{
m_parent->setDelegate(this);
printf("para\n");
}
void ParagraphHandler::endParagraph()
{
addTextNode();
printf("end para\n");
m_parent->setDelegate(0);
}
void ParagraphHandler::startItemizedList(const QXmlAttributes& attrib)
{
addTextNode();
ListHandler *listHandler = new ListHandler(ItemizedList,this);
listHandler->startList(attrib);
m_children.append(listHandler);
}
void ParagraphHandler::startOrderedList(const QXmlAttributes& attrib)
{
addTextNode();
ListHandler *listHandler = new ListHandler(OrderedList,this);
listHandler->startList(attrib);
m_children.append(listHandler);
}
void ParagraphHandler::addTextNode()
{
if (!m_curString.isEmpty())
{
m_children.append(new TextNode(m_curString,m_markupHandler->markup()));
printf("addTextNode() text=%s markup=%x\n",
m_curString.data(),m_markupHandler->markup());
m_curString="";
}
}
//----------------------------------------------------------------------
// DocHandler
//----------------------------------------------------------------------
DocHandler::DocHandler(IBaseHandler *parent) : m_parent(parent)
{
addEndHandler("briefdescription",this,&DocHandler::endDoc);
addEndHandler("detaileddescription",this,&DocHandler::endDoc);
addStartHandler("para",this,&DocHandler::startParagraph);
}
DocHandler::~DocHandler()
{
}
void DocHandler::startDoc(const QXmlAttributes& /*attrib*/)
{
m_parent->setDelegate(this);
printf("start dochandler\n");
}
void DocHandler::endDoc()
{
printf("end dochandler\n");
m_parent->setDelegate(0);
}
void DocHandler::startParagraph(const QXmlAttributes& attrib)
{
ParagraphHandler *parHandler = new ParagraphHandler(this);
parHandler->startParagraph(attrib);
m_children.append(parHandler);
}
#ifndef _DOCHANDLER_H
#define _DOCHANDLER_H
#include <qstring.h>
#include <qlist.h>
#include <qxml.h>
#include "basehandler.h"
class DocNode
{
public:
enum Markup
{
Normal = 0x00,
Bold = 0x01,
Emphasis = 0x02,
ComputerOutput = 0x04,
Subscript = 0x08,
Superscript = 0x10,
SmallFont = 0x20,
Center = 0x40
};
enum NodeKind
{
Para,
Text,
MarkupModifier,
ItemizedList,
OrderedList,
ListItem
};
DocNode(NodeKind k) : m_kind(k) {}
virtual ~DocNode() {}
private:
NodeKind m_kind;
};
class TextNode : public DocNode
{
public:
TextNode(const QString &t,int markup)
: DocNode(Text), m_text(t), m_markup(markup) {}
private:
QString m_text;
int m_markup;
};
class MarkupModifierNode : public DocNode
{
public:
MarkupModifierNode(int markup,bool enabled)
: DocNode(MarkupModifier), m_markup(markup), m_enabled(enabled) {}
private:
int m_markup;
bool m_enabled;
};
class MarkupHandler : public BaseFallBackHandler<MarkupHandler>
{
public:
MarkupHandler(QList<DocNode> &children,QString &curString);
virtual ~MarkupHandler();
int markup() const { return m_curMarkup; }
virtual void startBold(const QXmlAttributes &attrib);
virtual void endBold();
virtual void startEmphasis(const QXmlAttributes &attrib);
virtual void endEmphasis();
virtual void startComputerOutput(const QXmlAttributes &attrib);
virtual void endComputerOutput();
virtual void startCenter(const QXmlAttributes &attrib);
virtual void endCenter();
virtual void startSmallFont(const QXmlAttributes &attrib);
virtual void endSmallFont();
virtual void startSubscript(const QXmlAttributes &attrib);
virtual void endSubscript();
virtual void startSuperscript(const QXmlAttributes &attrib);
virtual void endSuperscript();
private:
void addTextNode();
QList<DocNode> &m_children;
QString &m_curString;
int m_curMarkup;
};
class ListItemHandler : public DocNode, public BaseHandler<ListItemHandler>
{
public:
ListItemHandler(IBaseHandler *parent);
virtual ~ListItemHandler();
virtual void startListItem(const QXmlAttributes& attrib);
virtual void endListItem();
virtual void startParagraph(const QXmlAttributes& attrib);
private:
IBaseHandler *m_parent;
QList<DocNode> m_children;
};
class ListHandler : public DocNode, public BaseHandler<ListHandler>
{
public:
ListHandler(NodeKind k,IBaseHandler *parent);
virtual ~ListHandler();
virtual void startList(const QXmlAttributes& attrib);
virtual void endList();
virtual void startListItem(const QXmlAttributes& attrib);
private:
IBaseHandler *m_parent;
QList<DocNode> m_children;
};
class ParagraphHandler : public DocNode, public BaseHandler<ParagraphHandler>
{
public:
virtual void startParagraph(const QXmlAttributes& attrib);
virtual void endParagraph();
virtual void startItemizedList(const QXmlAttributes& attrib);
virtual void startOrderedList(const QXmlAttributes& attrib);
ParagraphHandler(IBaseHandler *parent);
virtual ~ParagraphHandler();
private:
void addTextNode();
IBaseHandler *m_parent;
QList<DocNode> m_children;
MarkupHandler *m_markupHandler;
};
class DocHandler : public BaseHandler<DocHandler>
{
public:
virtual void startDoc(const QXmlAttributes& attrib);
virtual void endDoc();
virtual void startParagraph(const QXmlAttributes& attrib);
DocHandler(IBaseHandler *parent);
virtual ~DocHandler();
private:
IBaseHandler *m_parent;
QList<DocNode> m_children;
};
#endif
#include "mainhandler.h"
#include <qstring.h>
#include <qxml.h>
#include <qfile.h>
#include <qdict.h>
#include <qlist.h>
class ErrorHandler : public QXmlErrorHandler
{
public:
virtual ~ErrorHandler() {}
bool warning( const QXmlParseException & )
{
return FALSE;
}
bool error( const QXmlParseException & )
{
return FALSE;
}
bool fatalError( const QXmlParseException &exception )
{
fprintf(stderr,"Fatal error at line %d column %d: %s\n",
exception.lineNumber(),exception.columnNumber(),
exception.message().data());
return FALSE;
}
QString errorString() { return ""; }
private:
QString errorMsg;
};
int main(int argc,char **argv)
{
if (argc==1)
{
printf("Usage: %s file.xml\n",argv[0]);
exit(1);
}
QFile xmlFile(argv[1]);
MainHandler handler;
ErrorHandler errorHandler;
QXmlInputSource source( xmlFile );
QXmlSimpleReader reader;
reader.setContentHandler( &handler );
reader.setErrorHandler( &errorHandler );
reader.parse( source );
return 0;
}
#include "mainhandler.h"
void MainHandler::startCompound(const QXmlAttributes& attrib)
{
CompoundHandler *compHandler = new CompoundHandler(this);
compHandler->startCompound(attrib);
m_compounds.append(compHandler);
}
MainHandler::MainHandler()
{
m_compounds.setAutoDelete(TRUE);
addStartHandler("doxygen");
addStartHandler("compounddef",this,&MainHandler::startCompound);
addEndHandler("doxygen");
addEndHandler("compounddef");
}
MainHandler::~MainHandler()
{
}
#ifndef _MAINHANDLER_H
#define _MAINHANDLER_H
#include <qlist.h>
#include "basehandler.h"
#include "compoundhandler.h"
class MainHandler : public BaseHandler<MainHandler>
{
public:
virtual void startCompound(const QXmlAttributes& attrib);
MainHandler();
virtual ~MainHandler();
private:
QList<CompoundHandler> m_compounds;
};
#endif
#include "memberhandler.h"
#include "sectionhandler.h"
#include "dochandler.h"
MemberHandler::MemberHandler(IBaseHandler *parent)
: m_parent(parent), m_brief(0), m_detailed(0)
{
addEndHandler("memberdef",this,&MemberHandler::endMember);
addStartHandler("type");
addEndHandler("type",this,&MemberHandler::endType);
addStartHandler("name");
addEndHandler("name",this,&MemberHandler::endName);
addStartHandler("param",this,&MemberHandler::startParam);
addStartHandler("briefdescription",this,&MemberHandler::startBriefDesc);
addStartHandler("detaileddescription",this,&MemberHandler::startDetailedDesc);
}
MemberHandler::~MemberHandler()
{
}
void MemberHandler::startMember(const QXmlAttributes& attrib)
{
m_parent->setDelegate(this);
m_kind = attrib.value("kind");
m_id = attrib.value("id");
m_protection = attrib.value("prot");
m_virtualness = attrib.value("virtualness");
printf("member kind=`%s' id=`%s' prot=`%s' virt=`%s'\n",
m_kind.data(),m_id.data(),m_protection.data(),m_virtualness.data());
}
void MemberHandler::startBriefDesc(const QXmlAttributes& attrib)
{
DocHandler *docHandler = new DocHandler(this);
docHandler->startDoc(attrib);
m_brief = docHandler;
}
void MemberHandler::startDetailedDesc(const QXmlAttributes& attrib)
{
DocHandler *docHandler = new DocHandler(this);
docHandler->startDoc(attrib);
m_detailed = docHandler;
}
void MemberHandler::endMember()
{
m_parent->setDelegate(0);
}
void MemberHandler::endType()
{
m_type = m_curString.stripWhiteSpace();
printf("member type=`%s'\n",m_type.data());
}
void MemberHandler::endName()
{
m_name = m_curString.stripWhiteSpace();
printf("member name=`%s'\n",m_name.data());
}
void MemberHandler::startParam(const QXmlAttributes& attrib)
{
ParamHandler *paramHandler = new ParamHandler(this);
paramHandler->startParam(attrib);
m_params.append(paramHandler);
}
#ifndef _MEMBERHANDLER_H
#define _MEMBERHANDLER_H
#include <qstring.h>
#include <qlist.h>
#include <qxml.h>
#include "basehandler.h"
#include "paramhandler.h"
class DocHandler;
class MemberHandler : public BaseHandler<MemberHandler>
{
public:
virtual void startMember(const QXmlAttributes& attrib);
virtual void endMember();
virtual void startParam(const QXmlAttributes& attrib);
virtual void endType();
virtual void endName();
virtual void startBriefDesc(const QXmlAttributes& attrib);
virtual void startDetailedDesc(const QXmlAttributes& attrib);
MemberHandler(IBaseHandler *parent);
virtual ~MemberHandler();
private:
IBaseHandler *m_parent;
QString m_kind;
QString m_id;
QString m_protection;
QString m_virtualness;
QString m_type;
QString m_name;
DocHandler *m_brief;
DocHandler *m_detailed;
QList<ParamHandler> m_params;
};
#endif
#include "paramhandler.h"
#include "memberhandler.h"
ParamHandler::ParamHandler(IBaseHandler *parent) : m_parent(parent)
{
addEndHandler("param",this,&ParamHandler::endParam);
addStartHandler("type");
addEndHandler("type",this,&ParamHandler::endType);
addStartHandler("declname");
addEndHandler("declname",this,&ParamHandler::endDeclName);
addStartHandler("defname");
addEndHandler("defname",this,&ParamHandler::endDefName);
addStartHandler("array");
addEndHandler("array",this,&ParamHandler::endArray);
addStartHandler("attrib");
addEndHandler("attrib",this,&ParamHandler::endAttrib);
addStartHandler("defval");
addEndHandler("defval",this,&ParamHandler::endDefVal);
}
ParamHandler::~ParamHandler()
{
}
void ParamHandler::startParam(const QXmlAttributes& /*attrib*/)
{
m_parent->setDelegate(this);
printf("param\n");
}
void ParamHandler::endParam()
{
m_parent->setDelegate(0);
}
void ParamHandler::endType()
{
m_type = m_curString.stripWhiteSpace();
printf("param type=`%s'\n",m_type.data());
}
void ParamHandler::endDeclName()
{
m_declName = m_curString.stripWhiteSpace();
printf("member declName=`%s'\n",m_declName.data());
}
void ParamHandler::endDefName()
{
m_defName = m_curString.stripWhiteSpace();
printf("member defName=`%s'\n",m_defName.data());
}
void ParamHandler::endAttrib()
{
m_attrib = m_curString.stripWhiteSpace();
printf("member attrib=`%s'\n",m_attrib.data());
}
void ParamHandler::endArray()
{
m_array = m_curString.stripWhiteSpace();
printf("member array=`%s'\n",m_array.data());
}
void ParamHandler::endDefVal()
{
m_defVal = m_curString.stripWhiteSpace();
printf("member defVal=`%s'\n",m_defVal.data());
}
#ifndef _PARAMHANDLER_H
#define _PARAMHANDLER_H
#include <qstring.h>
#include <qlist.h>
#include <qxml.h>
#include "basehandler.h"
class ParamHandler : public BaseHandler<ParamHandler>
{
public:
virtual void startParam(const QXmlAttributes& attrib);
virtual void endParam();
virtual void endType();
virtual void endDeclName();
virtual void endDefName();
virtual void endAttrib();
virtual void endArray();
virtual void endDefVal();
ParamHandler(IBaseHandler *parent);
virtual ~ParamHandler();
private:
IBaseHandler *m_parent;
QString m_type;
QString m_declName;
QString m_defName;
QString m_attrib;
QString m_array;
QString m_defVal;
};
#endif
#include "compoundhandler.h"
#include "sectionhandler.h"
SectionHandler::SectionHandler(IBaseHandler *parent) : m_parent(parent)
{
m_members.setAutoDelete(TRUE);
addEndHandler("sectiondef",this,&SectionHandler::endSection);
addStartHandler("memberdef",this,&SectionHandler::startMember);
}
SectionHandler::~SectionHandler()
{
}
void SectionHandler::startSection(const QXmlAttributes& attrib)
{
m_parent->setDelegate(this);
m_kind = attrib.value("kind");
printf("section kind=`%s'\n",m_kind.data());
}
void SectionHandler::endSection()
{
m_parent->setDelegate(0);
}
void SectionHandler::startMember(const QXmlAttributes& attrib)
{
MemberHandler *memHandler = new MemberHandler(this);
memHandler->startMember(attrib);
m_members.append(memHandler);
}
#ifndef _SECTIONHANDLER_H
#define _SECTIONHANDLER_H
#include <qstring.h>
#include <qlist.h>
#include <qxml.h>
#include "basehandler.h"
#include "memberhandler.h"
class SectionHandler : public BaseHandler<SectionHandler>
{
public:
virtual void startMember(const QXmlAttributes& attrib);
virtual void startSection(const QXmlAttributes& attrib);
virtual void endSection();
SectionHandler(IBaseHandler *parent);
virtual ~SectionHandler();
private:
IBaseHandler *m_parent;
QString m_kind;
QList<MemberHandler> m_members;
};
#endif
TEMPLATE = app.t
CONFIG = console warn_on $extraopt
HEADERS = basehandler.h mainhandler.h \
compoundhandler.h sectionhandler.h \
memberhandler.h paramhandler.h \
dochandler.h
SOURCES = main.cpp mainhandler.cpp \
compoundhandler.cpp sectionhandler.cpp \
memberhandler.cpp paramhandler.cpp \
dochandler.cpp
DEPENDPATH = ../../src
unix:LIBS += -L../../lib -ldoxycfg -lqtools
win32:INCLUDEPATH += .
win32-mingw:LIBS += -L../../lib -ldoxycfg -lqtools
win32-msvc:LIBS += qtools.lib doxycfg.lib shell32.lib
win32-msvc:TMAKE_LFLAGS += /LIBPATH:..\..\lib
win32-borland:LIBS += qtools.lib doxycfg.lib shell32.lib
win32-borland:TMAKE_LFLAGS += -L..\..\lib
win32:TMAKE_CXXFLAGS += -DQT_NODLL
INCLUDEPATH += ../../qtools ../../src
DESTDIR =
TARGET = xmlparse
unix:TARGETDEPS = ../../lib/libdoxycfg.a
win32:TARGETDEPS = ../../lib/doxycfg.lib
OBJECTS_DIR = obj
all clean depend: Makefile.xmlread
$(MAKE) -f Makefile.xmlread $@
distclean: clean
$(RM) -f Makefile.xmlread
tmake:
export TMAKEPATH=$(TMAKEPATH) ; $(PERL) $(TMAKE) xmlread.pro >Makefile.xmlread
Makefile.xmlread: xmlread.pro
export TMAKEPATH=$(TMAKEPATH) ; $(PERL) $(TMAKE) xmlread.pro >Makefile.xmlread
This is a small utility that is used to test and validate the
XML output generated by doxygen (when GENERATE_XML = YES).
It uses the Xerces-C XML parser/validator (see http://xml.apache.org)
and expects the environment variable XERCESCROOT to point to the root
of the Xerces package.
Currently is reads an XML file, validates it, and prints the class
hierarchy contained in it.
#ifndef COMPOUNDDEF_H
#define COMPOUNDDEF_H
#include "qtbc.h"
#include <qlist.h>
#include <qdict.h>
#include <qstrlist.h>
/*! Abstract interface for a compound as presented to the user */
class CompoundDef
{
public:
/*! Possible compound types */
enum Type { Unknown_t, Class_t, Struct_t, Union_t,
File_t, Namespace_t, Group_t, Interface_t };
/*! Destructor */
virtual ~CompoundDef() {}
/*! Returns the name of this compound */
virtual QCString name() const = 0;
/*! Returns the type of this compound */
virtual Type type() const = 0;
/*! Returns the unique identifier for this compound */
virtual QCString id() const = 0;
/*! Returns the list of base compounds from which this compound inherits */
virtual QList<CompoundDef> *baseCompounds() const = 0;
/*! Returns the list of compounds that derive from this one */
virtual QList<CompoundDef> *derivedCompounds() const = 0;
};
/*! Ordered dictionary of abstract compounds. */
class CompoundSDict : public QList<CompoundDef>
{
friend class CompoundSDictIterator;
public:
/*! Create an ordered dictionary.
* \param size The size of the dictionary. Should be a prime number for
* best distribution of elements.
*/
CompoundSDict(int size)
{
m_list = new QList<CompoundDef>;
m_list->setAutoDelete(TRUE);
m_dict = new QDict<CompoundDef>(size);
}
/*! Destroys the dictionary */
~CompoundSDict()
{
delete m_list;
delete m_dict;
}
/*! Appends a compound to the dictionary. The element is owned by the
* dictionary.
* \param key The unique key to use to quicky find the item later on.
* \param d The compound to add.
* \sa find()
*/
void append(const char *key,CompoundDef *d)
{
m_list->append(d);
m_dict->insert(key,d);
}
/*! Looks up a compound given its key.
* \param key The key to identify this element.
* \return The requested compound or zero if it cannot be found.
* \sa append()
*/
CompoundDef *find(const char *key)
{
return m_dict->find(key);
}
private:
QList<CompoundDef> *m_list;
QDict<CompoundDef> *m_dict;
};
/*! Simple iterator for CompoundSDict. It iterates in the order the
* element were appended.
*/
class CompoundSDictIterator
{
public:
/*! Create an iterator given the dictionary. */
CompoundSDictIterator(const CompoundSDict &dict)
{
m_li = new QListIterator<CompoundDef>(*dict.m_list);
}
/*! Destroys the dictionary */
~CompoundSDictIterator()
{
delete m_li;
}
/*! Set the iterator to the first element in the list.
* \return The first compound, or zero if the list was empty.
*/
CompoundDef *toFirst() const
{
return m_li->toFirst();
}
/*! Returns the current compound */
CompoundDef *current() const
{
return m_li->current();
}
/*! Moves the iterator to the next element.
* \return the new "current" element, or zero if the iterator was
* already pointing at the last element.
*/
CompoundDef *operator++()
{
return m_li->operator++();
}
private:
QListIterator<CompoundDef> *m_li;
};
/*! Concrete compound implementation. Used internally by the sax handlers */
class CompoundDef_Impl : public CompoundDef
{
public:
/*! Create an compound implementation object */
CompoundDef_Impl()
{
m_type = Unknown_t;
m_baseCompounds = new QList<CompoundDef>;
m_derivedCompounds = new QList<CompoundDef>;
}
/*! Destroy the implementation object */
~CompoundDef_Impl()
{
delete m_baseCompounds;
delete m_derivedCompounds;
}
/* implementation of the abstract interface */
Type type() const { return m_type; }
QCString name() const { return m_name; }
QCString id() const { return m_id; }
QList<CompoundDef> *baseCompounds() const { return m_baseCompounds; }
QList<CompoundDef> *derivedCompounds() const { return m_derivedCompounds; }
/*! Sets the type of the compound to \a t. */
void setType(Type t) { m_type = t; }
/*! Sets the name of the compound to \a name. */
void setName(const char *name) { m_name=name; }
/*! Sets the Id of the compound to \a id. */
void setId(const char *id) { m_id=id; }
/*! Adds a new reference to the internal base class reference list */
void addBaseRef(const char *name) { m_baseRefs.append(name); }
/*! Adds a new reference to the internal derived class reference list */
void addDerivedRef(const char *name) { m_derivedRefs.append(name); }
/*! Resolve the base and derived compound references. */
void resolveReferences(CompoundSDict *dict)
{
char *refId;
refId = m_baseRefs.first();
while (refId)
{
CompoundDef *cd = dict->find(refId);
m_baseCompounds->append(cd);
refId = m_baseRefs.next();
}
refId = m_derivedRefs.first();
while (refId)
{
CompoundDef *cd = dict->find(refId);
m_derivedCompounds->append(cd);
refId = m_derivedRefs.next();
}
}
private:
Type m_type;
QCString m_name;
QCString m_id;
QStrList m_derivedRefs;
QStrList m_baseRefs;
QList<CompoundDef> *m_baseCompounds;
QList<CompoundDef> *m_derivedCompounds;
};
#endif
// ---------------------------------------------------------------------------
// Includes
// ---------------------------------------------------------------------------
#include <util/PlatformUtils.hpp>
#include <parsers/SAXParser.hpp>
#include "strx.h"
#include "saxhandlers.h"
#include "compounddef.h"
// ---------------------------------------------------------------------------
// Local data
//
// xmlFile
// The path to the file to parser. Set via command line.
//
// ---------------------------------------------------------------------------
static char* xmlFile = 0;
// ---------------------------------------------------------------------------
// Local helper methods
// ---------------------------------------------------------------------------
static void usage()
{
cout << "\nUsage: xmlread file.xml\n"
<< " Extracts the class hierarchy from a doxygen generated XML file.\n"
<< endl;
}
// recursively display non-root compounds
static void showDerivedCompounds(QList<CompoundDef> *compoundList,int level)
{
if (compoundList->count()>0)
{
QListIterator<CompoundDef> cli(*compoundList);
CompoundDef *cd;
for (cli.toFirst();(cd=cli.current());++cli)
{
int i;
for (i=0;i<level;i++) cout << " ";
cout << cd->name() << endl;
showDerivedCompounds(cd->derivedCompounds(),level+1);
}
}
}
// show compound hierarchy
static void showCompoundHierarchy(CompoundSDict *compounds)
{
CompoundSDictIterator cdi(*compounds);
CompoundDef *cd;
for (cdi.toFirst();(cd=cdi.current());++cdi)
{
if (cd->type()==CompoundDef::Class_t &&
cd->baseCompounds()->count()==0) // root compound
{
cout << cd->name() << endl;
showDerivedCompounds(cd->derivedCompounds(),1);
}
}
}
// ---------------------------------------------------------------------------
// Program entry point
// ---------------------------------------------------------------------------
int main(int argC, char* argV[])
{
// Initialize the XML4C2 system
try
{
XMLPlatformUtils::Initialize();
}
catch (const XMLException& toCatch)
{
cerr << "Error during initialization! :\n"
<< StrX(toCatch.getMessage()) << endl;
return 1;
}
// Check command line and extract arguments.
if (argC!=2)
{
usage();
return 1;
}
// Watch for special case help request
if (strcmp(argV[1], "-?") == 0)
{
usage();
return 0;
}
// Assume the argument is a file name
xmlFile = argV[1];
//
// Create a SAX validating parser object.
//
SAXParser parser;
parser.setDoValidation(TRUE);
// Create a compound dictionary, where the results will be stored.
// The size of the dictionary is 1009 entries (should be a prime number)
CompoundSDict compounds(1009);
//
// Create the handler object and install it as the document and error
// handler for the parser.
//
SaxPass1Handlers handler(&compounds);
parser.setDocumentHandler(&handler);
parser.setErrorHandler(&handler);
// Parse the file and catch any exceptions that propogate out
try
{
parser.parse(xmlFile);
}
catch (const XMLException& toCatch)
{
cerr << "\nFile not found: '" << xmlFile << "'\n"
<< "Exception message is: \n"
<< StrX(toCatch.getMessage())
<< "\n" << endl;
return -1;
}
// Show the class hierarchy that we extracted
showCompoundHierarchy(&compounds);
return 0;
}
/******************************************************************************
*
*
*
* Copyright (C) 1997-2001 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
* granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
* Documents produced by Doxygen are derivative works derived from the
* input used in their production; they are not affected by this license.
*
*/
#ifndef QTBC_H
#define QTBC_H
/*! This file contains some hacks to make Doxygen work with
* Qt version 2.00 and Qt version 1.xx
*/
#include <qglobal.h>
#if QT_VERSION >= 200
#include <locale.h>
#define GCI QCollection::Item
#include <qcstring.h>
#include <qstring.h>
inline QCString convertToQCString(const QString &s) { return s.latin1(); }
#else /* QT_VERSION < 200 */
#include <qstring.h>
#define QCString QString
inline QCString convertToQCString(const QCString &s) { return s; }
#endif
#endif
// ---------------------------------------------------------------------------
// Includes
// ---------------------------------------------------------------------------
#include <util/XMLUni.hpp>
#include <sax/AttributeList.hpp>
#include "saxhandlers.h"
#include "strx.h"
#include <iostream.h>
static void error(const SAXParseException& e)
{
cerr << "\nError at (file " << StrX(e.getSystemId())
<< ", line " << e.getLineNumber()
<< ", char " << e.getColumnNumber()
<< "): " << StrX(e.getMessage()) << endl;
exit(1);
}
static void fatalError(const SAXParseException& e)
{
cerr << "\nFatal Error at (file " << StrX(e.getSystemId())
<< ", line " << e.getLineNumber()
<< ", char " << e.getColumnNumber()
<< "): " << StrX(e.getMessage()) << endl;
exit(1);
}
static void warning(const SAXParseException& e)
{
cerr << "\nWarning at (file " << StrX(e.getSystemId())
<< ", line " << e.getLineNumber()
<< ", char " << e.getColumnNumber()
<< "): " << StrX(e.getMessage()) << endl;
exit(1);
}
// ---------------------------------------------------------------------------
// SaxPass1Handlers: Constructors and Destructor
// ---------------------------------------------------------------------------
SaxPass1Handlers::SaxPass1Handlers(CompoundSDict *comp) : m_compounds(comp)
{
m_currentCompound = 0;
}
SaxPass1Handlers::~SaxPass1Handlers()
{
}
// ---------------------------------------------------------------------------
// SaxPass1Handlers: Overrides of the SAX ErrorHandler interface
// ---------------------------------------------------------------------------
void SaxPass1Handlers::error(const SAXParseException& e)
{
::error(e);
}
void SaxPass1Handlers::fatalError(const SAXParseException& e)
{
::fatalError(e);
}
void SaxPass1Handlers::warning(const SAXParseException& e)
{
::warning(e);
}
// ---------------------------------------------------------------------------
// SaxPass1Handlers: Overrides of the SAX DocumentHandler interface
// ---------------------------------------------------------------------------
void SaxPass1Handlers::characters(const XMLCh* const chars,
const unsigned int /*length*/
)
{
if (m_charAction==ReadCompoundName)
{
m_compoundName=StrX(chars);
m_charAction=Done;
}
}
void SaxPass1Handlers::endDocument()
{
// resolve all references
CompoundSDictIterator cdi(*m_compounds);
CompoundDef *cd;
for (cdi.toFirst();(cd=cdi.current());++cdi)
{
CompoundDef_Impl *impl = dynamic_cast<CompoundDef_Impl*>(cd);
impl->resolveReferences(m_compounds);
}
}
void SaxPass1Handlers::startElement(const XMLCh* const name,
AttributeList& attributes
)
{
QCString sname = StrX(name);
if (sname=="compounddef")
{
m_currentCompound = new CompoundDef_Impl;
unsigned int len = attributes.getLength(),index;
for (index = 0; index < len; index++)
{
QCString attName = StrX(attributes.getName(index));
QCString attValue = StrX(attributes.getValue(index));
if (attName == "id")
{
m_currentCompound->setId(attValue);
}
else if (attName=="type")
{
if (attValue=="class")
{
m_currentCompound->setType(CompoundDef::Class_t);
}
else if (attValue=="struct")
{
m_currentCompound->setType(CompoundDef::Struct_t);
}
else if (attValue=="union")
{
m_currentCompound->setType(CompoundDef::Union_t);
}
else if (attValue=="interface")
{
m_currentCompound->setType(CompoundDef::Interface_t);
}
else if (attValue=="file")
{
m_currentCompound->setType(CompoundDef::File_t);
}
else
{
cerr << "Unsupported compound type: " << attValue << "\n";
}
}
}
}
else if (sname=="compoundname")
{
m_charAction = ReadCompoundName;
}
else if (sname=="basecompoundref")
{
unsigned int len = attributes.getLength(),index;
for (index = 0; index < len; index++)
{
QCString attName = StrX(attributes.getName(index));
QCString attValue = StrX(attributes.getValue(index));
if (attName=="idref")
{
m_currentCompound->addBaseRef(attValue);
}
}
}
else if (sname=="derivedcompoundref")
{
unsigned int len = attributes.getLength(),index;
for (index = 0; index < len; index++)
{
QCString attName = StrX(attributes.getName(index));
QCString attValue = StrX(attributes.getValue(index));
if (attName=="idref")
{
m_currentCompound->addDerivedRef(attValue);
}
}
}
}
void SaxPass1Handlers::endElement(const XMLCh* const name)
{
QCString sname = StrX(name);
if (sname=="compounddef")
{
m_compounds->append(m_currentCompound->id(),m_currentCompound);
m_currentCompound=0;
}
else if (sname=="compoundname")
{
m_currentCompound->setName(m_compoundName);
}
}
#ifndef _SAXHANDLERS_H
#define _SAXHANDLERS_H
#include "compounddef.h"
#include <sax/HandlerBase.hpp>
/*! SAX Handlers used for pass 1. */
class SaxPass1Handlers : public HandlerBase
{
public:
// -----------------------------------------------------------------------
//! @name Constructors
// -----------------------------------------------------------------------
//@{
/*! Constructor */
SaxPass1Handlers(CompoundSDict *comp);
/*! Destructor */
~SaxPass1Handlers();
//@}
// -----------------------------------------------------------------------
//! @name Implementations of the SAX DocumentHandler interface
// -----------------------------------------------------------------------
//@{
/*! Handler called at the start of the XML document */
void startDocument() {}
/*! Handler called at the end of the XML document */
void endDocument();
/*! Handler called when an element is found in the XML file
* \param name The element's name.
* \param attributes The list of attributes for the element.
*/
void startElement(const XMLCh* const name, AttributeList& attributes);
/*! Handler called when the element of an element is found in the XML file
* \param name The element's name.
*/
void endElement(const XMLCh* const name);
/*! Handler called when a character string is found in the XML file.
* \param chars Zero terminated string of characters.
* \param length The number of characters in the string.
*/
void characters(const XMLCh* const chars, const unsigned int length);
/*! Handler called when an amount of whitespace is found, that is not
* Part of the text.
*/
void ignorableWhitespace(const XMLCh* const /*chars*/,
const unsigned int /*length*/
) {}
/*! Handler called when a preprocessing intruction is found.
*/
void processingInstruction(const XMLCh* const /*target*/,
const XMLCh* const /*data*/
) {}
//@}
// -----------------------------------------------------------------------
//! @name Implementations of the SAX ErrorHandler interface
// -----------------------------------------------------------------------
//@{
/*! Handler called for a parser warning. */
void warning(const SAXParseException& exception);
/*! Handler called for a parser error. */
void error(const SAXParseException& exception);
/*! Handler called for a parser fatal error. */
void fatalError(const SAXParseException& exception);
//@}
// -----------------------------------------------------------------------
//! @name Implementation of the SAX DTDHandler interface
// -----------------------------------------------------------------------
//@{
/*! Handler for DTD notation declaration. */
void notationDecl(const XMLCh* const /*name*/,
const XMLCh* const /*publicId*/,
const XMLCh* const /*systemId*/
) {}
/*! Handler for DTD unparsed entity declaration. */
void unparsedEntityDecl(const XMLCh* const /*name*/,
const XMLCh* const /*publicId*/,
const XMLCh* const /*systemId*/,
const XMLCh* const /*notationName*/
) {}
//@}
private:
// -----------------------------------------------------------------------
// Private data members
//
// -----------------------------------------------------------------------
enum CharActions { Done, ReadCompoundName };
CompoundSDict *m_compounds;
CompoundDef_Impl *m_currentCompound;
QCString m_compoundName;
CharActions m_charAction;
};
#endif
#ifndef _STRX_H
#define _STRX_H
// ---------------------------------------------------------------------------
// Includes for all the program files to see
// ---------------------------------------------------------------------------
#include "qtbc.h"
#include <iostream.h>
/*!
* This is a simple wrapper class around QCString that lets us do easy
* trancoding of XMLCh data to local code page for display.
*/
class StrX : public QCString
{
public:
/*! Constructor */
StrX(const XMLCh* const toTranscode) :
QCString(XMLString::transcode(toTranscode)) {}
/*! Destructor */
~StrX() {}
};
#endif
TEMPLATE = app
CONFIG = console qt warn_on debug
HEADERS = saxhandler.h strx.h compounddef.h
SOURCES = main.cpp \
saxhandlers.cpp
LIBS = -lxerces-c1_2 -L$(XERCESCROOT)/lib
INCLUDEPATH = $(XERCESCROOT)/include
...@@ -27,49 +27,48 @@ f_prefix=/usr ...@@ -27,49 +27,48 @@ f_prefix=/usr
f_insttool=NO f_insttool=NO
f_english=NO f_english=NO
f_wizard=NO f_wizard=NO
f_xmlgen=NO
while test -n "$1"; do while test -n "$1"; do
case $1 in case $1 in
--prefix) --prefix | -prefix)
shift; f_prefix=$1 shift; f_prefix=$1
;; ;;
--shared) --docdir | -docdir)
shift; f_docdir=$1/doxygen
;;
--shared | -shared)
f_shared=YES f_shared=YES
;; ;;
--static) --static | -static)
f_shared=NO f_shared=NO
;; ;;
--release) --release | -release)
f_debug=NO f_debug=NO
;; ;;
--debug) --debug | -debug)
f_debug=YES f_debug=YES
;; ;;
--english-only) --english-only | -english-only)
f_english=YES f_english=YES
;; ;;
--platform) --platform | -platform)
shift; f_platform=$1 shift; f_platform=$1
;; ;;
--make) --make | -make)
shift; f_make=$1 shift; f_make=$1
;; ;;
--dot) --dot | -dot)
shift; f_dot=$1 shift; f_dot=$1
;; ;;
--perl) --perl | -perl)
shift; f_perl=$1 shift; f_perl=$1
;; ;;
--install) --install | -install)
shift; f_insttool=$1 shift; f_insttool=$1
;; ;;
--with-doxywizard) --with-doxywizard | -with-doxywizard)
f_wizard=YES f_wizard=YES
;; ;;
--with-xmlgen)
f_xmlgen=YES
;;
-h | -help | --help) -h | -help | --help)
f_help=y f_help=y
;; ;;
...@@ -86,46 +85,36 @@ if test "$f_help" = y; then ...@@ -86,46 +85,36 @@ if test "$f_help" = y; then
cat <<EOF cat <<EOF
Usage: $0 [--help] [--shared] [--static] [--release] [--debug] Usage: $0 [--help] [--shared] [--static] [--release] [--debug]
[--perl name] [--make name] [--dot name] [--platform target] [--perl name] [--make name] [--dot name] [--platform target]
[--prefix dir] [--install name] [--english-only] [--prefix dir] [--docdir dir] [--install name] [--english-only]
[--with-doxywizard] [--with-xmlgen] [--with-doxywizard]
Options: Options:
--help Print this help --help Print this help
--shared | --static Build using shared or static linking --shared | --static Build using shared or static linking
[default: shared] [default: shared]
--release | --debug Build for release or debug --release | --debug Build for release or debug
[default: release] [default: release]
--perl name Use \`name' as the name of the perl interpreter --perl name Use \`name' as the name of the perl interpreter
[default: autodetect] [default: autodetect]
--make name Use \`name' as the name of the GNU make tool --make name Use \`name' as the name of the GNU make tool
[default: autodetect] [default: autodetect]
--dot name Use \`name' as the name of the dot tool that --dot name Use \`name' as the name of the dot tool that
is part of the Graphviz package. is part of the Graphviz package.
[default: autodetect] [default: autodetect]
--platform target Do not detect platform but use \`target' instead. --platform target Do not detect platform but use \`target' instead.
See PLATFORMS for a list of possibilities See PLATFORMS for a list of possibilities
--prefix dir Installation prefix directory (doxygen will be
--prefix dir Installation prefix directory put in PREFIX/bin/doxygen)
[default: /usr] [default: /usr]
--docdir dir Documentation is installed in DOCDIR/doxygen/
[default: PREFIX/share/doc/packages]
--install name Use \`name' as the name of the GNU install tool --install name Use \`name' as the name of the GNU install tool
[default: autodetect] [default: autodetect]
--english-only Include support for English only. --english-only Include support for English only.
--with-doxywizard Build the GUI frontend for doxygen. This --with-doxywizard Build the GUI frontend for doxygen. This
requires Qt 2.x.x requires Qt 2.x.x
--with-xmlgen Builds a separate doxygen executable that
generates XML output.
EOF EOF
test "$f_error" = y && exit 1 test "$f_error" = y && exit 1
exit 0; exit 0;
...@@ -206,6 +195,10 @@ if test -z "$f_platform"; then ...@@ -206,6 +195,10 @@ if test -z "$f_platform"; then
f_plf_auto=YES f_plf_auto=YES
fi fi
if test -z "$f_docdir"; then
f_docdir=$f_prefix/share/doc/packages/doxygen
fi
if test "$f_plf_auto" = NO; then if test "$f_plf_auto" = NO; then
echo -n " Checking for platform $f_platform... " echo -n " Checking for platform $f_platform... "
if test '!' -d tmake/lib/$f_platform; then if test '!' -d tmake/lib/$f_platform; then
...@@ -277,11 +270,9 @@ if test "$f_insttool" = NO; then ...@@ -277,11 +270,9 @@ if test "$f_insttool" = NO; then
for j in $install_dirs; do for j in $install_dirs; do
if test -x "$j/$i"; then if test -x "$j/$i"; then
install_found=YES install_found=YES
if $j/$i --version 2>/dev/null | grep GNU >/dev/null; then
install_prog="$j/$i" install_prog="$j/$i"
break 2 break 2
fi fi
fi
done done
done done
f_insttool="$install_prog" f_insttool="$install_prog"
...@@ -371,6 +362,7 @@ VERSION = `cat VERSION` ...@@ -371,6 +362,7 @@ VERSION = `cat VERSION`
INSTALL = $f_prefix INSTALL = $f_prefix
INSTTOOL = $f_insttool INSTTOOL = $f_insttool
DOXYDOCS = .. DOXYDOCS = ..
DOCDIR = $f_docdir
EOF EOF
if test "$f_dot" != NO; then if test "$f_dot" != NO; then
...@@ -406,7 +398,7 @@ TMAKE_CXXFLAGS += -DENGLISH_ONLY ...@@ -406,7 +398,7 @@ TMAKE_CXXFLAGS += -DENGLISH_ONLY
EOF EOF
fi fi
f_inmakefiles="Makefile.in addon/xmlgen/Makefile.in qtools/Makefile.in src/Makefile.in examples/Makefile.in doc/Makefile.in addon/doxywizard/Makefile.in addon/xmlread/Makefile.in" f_inmakefiles="Makefile.in qtools/Makefile.in src/Makefile.in examples/Makefile.in doc/Makefile.in addon/doxywizard/Makefile.in addon/xmlparse/Makefile.in"
for i in $f_inmakefiles ; do for i in $f_inmakefiles ; do
SRC=$i SRC=$i
...@@ -427,26 +419,18 @@ EOF ...@@ -427,26 +419,18 @@ EOF
if test $f_wizard = YES; then if test $f_wizard = YES; then
echo " \$(MAKE) -C addon/doxywizard" >> $DST echo " \$(MAKE) -C addon/doxywizard" >> $DST
fi fi
if test $f_xmlgen = YES; then
echo " \$(MAKE) -C addon/xmlgen" >> $DST
fi
echo "" >> $DST echo "" >> $DST
echo "doxywizard_install:" >> $DST echo "doxywizard_install:" >> $DST
if test $f_wizard = YES; then if test $f_wizard = YES; then
echo " \$(MAKE) -C addon/doxywizard install" >> $DST echo " \$(MAKE) -C addon/doxywizard install" >> $DST
fi fi
echo "" >> $DST echo "" >> $DST
echo "xmlgen_install:" >> $DST
if test $f_xmlgen = YES; then
echo " \$(MAKE) -C addon/xmlgen install" >> $DST
fi
echo "" >> $DST
fi fi
cat $SRC >> $DST cat $SRC >> $DST
echo " Created $DST from $SRC..." echo " Created $DST from $SRC..."
done done
f_inprofiles="qtools/qtools.pro.in src/libdoxygen.pro.in src/libdoxycfg.pro.in src/doxygen.pro.in src/doxytag.pro.in src/doxysearch.pro.in addon/doxywizard/doxywizard.pro.in addon/xmlread/xmlread.pro.in addon/xmlgen/xmlgen.pro.in" f_inprofiles="qtools/qtools.pro.in src/libdoxygen.pro.in src/libdoxycfg.pro.in src/doxygen.pro.in src/doxytag.pro.in src/doxysearch.pro.in addon/doxywizard/doxywizard.pro.in addon/xmlparse/xmlparse.pro.in"
for i in $f_inprofiles ; do for i in $f_inprofiles ; do
SRC=$i SRC=$i
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# Documents produced by Doxygen are derivative works derived from the # Documents produced by Doxygen are derivative works derived from the
# input used in their production; they are not affected by this license. # input used in their production; they are not affected by this license.
PROJECT_NAME = PROJECT_NAME = "Doxygen manual"
OUTPUT_DIRECTORY = .. OUTPUT_DIRECTORY = ..
HTML_HEADER = HTML_HEADER =
HTML_FOOTER = HTML_FOOTER =
......
...@@ -756,11 +756,8 @@ followed by the descriptions of the tags grouped by category. ...@@ -756,11 +756,8 @@ followed by the descriptions of the tags grouped by category.
doxygen generates three additional HTML index files: doxygen generates three additional HTML index files:
\c index.hhp, \c index.hhc, and \c index.hhk. The \c index.hhp is a \c index.hhp, \c index.hhc, and \c index.hhk. The \c index.hhp is a
project file that can be read by project file that can be read by
<a href="http://msdn.microsoft.com/library/tools/htmlhelp/wkshp/download_main.htm"> <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/htmlhelp/html/vsconHH1Start.asp">
Microsoft HTML Help Workshop</a> Microsoft's HTML Help Workshop</a>
\latexonly
(see http://msdn.microsoft.com/library/tools/htmlhelp/wkshp/download\_main.htm)
\endlatexonly
on Windows. on Windows.
The HTML Help Workshop contains a compiler that can convert all HTML output The HTML Help Workshop contains a compiler that can convert all HTML output
...@@ -1007,7 +1004,7 @@ EXTRA_PACKAGES = times ...@@ -1007,7 +1004,7 @@ EXTRA_PACKAGES = times
\anchor cfg_man_links \anchor cfg_man_links
<dt>\c MAN_LINKS <dd> <dt>\c MAN_LINKS <dd>
\addindex MAN_LINKs \addindex MAN_LINKS
If the \c MAN_LINKS tag is set to \c YES and doxygen generates man output, If the \c MAN_LINKS tag is set to \c YES and doxygen generates man output,
then it will generate one additional man file for each entity documented in then it will generate one additional man file for each entity documented in
the real man page(s). These additional files only source the real man page, the real man page(s). These additional files only source the real man page,
...@@ -1208,7 +1205,7 @@ TAGFILES = file1=loc1 "file2 = loc2" ... </pre> ...@@ -1208,7 +1205,7 @@ TAGFILES = file1=loc1 "file2 = loc2" ... </pre>
\anchor cfg_dot_cleanup \anchor cfg_dot_cleanup
<dt>\c DOT_CLEANUP <dd> <dt>\c DOT_CLEANUP <dd>
\addindex DOT_CLEANUP \addindex DOT_CLEANUP
This tag can be used to ?? cleanup any mess DOT left behind? This tag can be used to cleanup any mess DOT left behind.
If left blank, "NO" is assumed. If left blank, "NO" is assumed.
</dl> </dl>
......
...@@ -79,7 +79,7 @@ sections. ...@@ -79,7 +79,7 @@ sections.
The first part forms a user manual: The first part forms a user manual:
<ul> <ul>
<li>Section \ref install discusses how to <li>Section \ref install discusses how to
<a href="http://www.stack.nl/~dimitri/doxygen/download.html">download</a>, compile and install <a href="http://www.doxygen.org/download.html">download</a>, compile and install
doxygen for your platform. doxygen for your platform.
<li>Section \ref starting tells you how to generate your first piece of <li>Section \ref starting tells you how to generate your first piece of
documentation quickly. documentation quickly.
...@@ -126,11 +126,11 @@ The second part forms a reference manual: ...@@ -126,11 +126,11 @@ The second part forms a reference manual:
I have compiled a I have compiled a
\htmlonly \htmlonly
<a href="http://www.stack.nl/~dimitri/doxygen/projects.html">list of projects</a> <a href="http://www.doxygen.org/projects.html">list of projects</a>
that use doxygen. that use doxygen.
\endhtmlonly \endhtmlonly
\latexonly \latexonly
list of projects that use doxygen (see {\tt http://www.stack.nl/$\sim$dimitri/doxygen/projects.html}). list of projects that use doxygen (see {\tt http://www.doxygen.org/projects.html}).
\endlatexonly \endlatexonly
If you know other projects, let me know and I'll add them. If you know other projects, let me know and I'll add them.
...@@ -138,10 +138,10 @@ If you know other projects, let me know and I'll add them. ...@@ -138,10 +138,10 @@ If you know other projects, let me know and I'll add them.
Although doxygen is used successfully by a lot of people already, Although doxygen is used successfully by a lot of people already,
there is always room for improvement. Therefore, I have compiled a there is always room for improvement. Therefore, I have compiled a
\htmlonly \htmlonly
<a href="http://www.stack.nl/~dimitri/doxygen/todo.html">todo/wish list</a> <a href="http://www.doxygen.org/todo.html">todo/wish list</a>
\endhtmlonly \endhtmlonly
\latexonly \latexonly
todo/wish list (see {\tt http://www.stack.nl/$\sim$dimitri/doxygen/todo.html}) todo/wish list (see {\tt http://www.doxygen.org/todo.html})
\endlatexonly \endlatexonly
of possible and/or requested enhancements. of possible and/or requested enhancements.
......
...@@ -147,9 +147,9 @@ Compilation is now done by performing the following steps: ...@@ -147,9 +147,9 @@ Compilation is now done by performing the following steps:
make pdf make pdf
\endverbatim \endverbatim
The postscript manual <code>doxygen_manual.ps</code> will be located The PostScript manual <code>doxygen_manual.ps</code> will be located
in the latex directory of the distribution. Just send it to a in the latex directory of the distribution. Just send it to a
postscript printer to print it or use <code>ghostview</code> to view it. PostScript printer to print it or use <code>ghostview</code> to view it.
</ol> </ol>
...@@ -165,13 +165,14 @@ Compilation is now done by performing the following steps: ...@@ -165,13 +165,14 @@ Compilation is now done by performing the following steps:
\endverbatim \endverbatim
Binaries are installed into the directory <code>\<prefix\>/bin</code>. Binaries are installed into the directory <code>\<prefix\>/bin</code>.
Use <code>make install_docs DOCDIR=\<path\></code> to install the Use <code>make install_docs</code> to install the
documentation and examples into the <code>\<path\></code> directory. documentation and examples into <code>\<docdir\>/doxygen</code>.
<code>\<prefix\></code> defaults to /usr but can be changed with <code>\<prefix\></code> defaults to <code>/usr</code> but can be changed with
the <code>--prefix</code> option of the configure script. the <code>--prefix</code> option of the configure script.
The default <code>DOCDIR</code> directory is The default <code>\<docdir\></code> directory is
<code>\<prefix\>/share/doc/packages/doxygen</code> <code>\<prefix\>/share/doc/packages</code> and can be changed with
the <code>--docdir</code> option of the configure script.
Alternatively, you can also copy the binaries from the <code>bin</code> Alternatively, you can also copy the binaries from the <code>bin</code>
directory manually to some <code>bin</code> directory in your search path. directory manually to some <code>bin</code> directory in your search path.
...@@ -445,7 +446,7 @@ Here is what is required: ...@@ -445,7 +446,7 @@ Here is what is required:
(see \ref cfg_generate_htmlhelp "GENERATE_HTMLHELP") in the (see \ref cfg_generate_htmlhelp "GENERATE_HTMLHELP") in the
config file, then you need the Microsoft HTML help workshop. config file, then you need the Microsoft HTML help workshop.
You can download it at: You can download it at:
http://msdn.microsoft.com/library/tools/htmlhelp/wkshp/download_main.htm http://msdn.microsoft.com/library/default.asp?url=/library/en-us/htmlhelp/html/vsconHH1Start.asp
<li>If you used WinZip to extract the tar archive it will (apparently) not <li>If you used WinZip to extract the tar archive it will (apparently) not
create empty folders, so you have to add the folders create empty folders, so you have to add the folders
...@@ -454,6 +455,7 @@ Here is what is required: ...@@ -454,6 +455,7 @@ Here is what is required:
<li><a href="http://www.graphviz.org/"> <li><a href="http://www.graphviz.org/">
the Graph visualization toolkit version 1.5</a><br> the Graph visualization toolkit version 1.5</a><br>
\latexonly(see {\tt http://www.graphviz.org/})\endlatexonly.
Needed for the include dependency graphs, the graphical inheritance graphs, Needed for the include dependency graphs, the graphical inheritance graphs,
and the collaboration graphs. and the collaboration graphs.
</ul> </ul>
......
...@@ -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.8-20010723), 24 languages Currently (version 1.2.8-20010726), 24 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,
...@@ -101,13 +101,13 @@ when the translator was updated. ...@@ -101,13 +101,13 @@ when the translator was updated.
<TR BGCOLOR="#ffffff"> <TR BGCOLOR="#ffffff">
<TD>French</TD> <TD>French</TD>
<TD>Xavier Outhier</TD> <TD>Xavier Outhier</TD>
<TD>xavier.outhier@NOSPAM.anfdata.cz</TD> <TD>xouthier@NOSPAM.yahoo.fr</TD>
<TD>up-to-date</TD> <TD>up-to-date</TD>
</TR> </TR>
<TR BGCOLOR="#ffffff"> <TR BGCOLOR="#ffffff">
<TD>German</TD> <TD>German</TD>
<TD>Jens Seidel<br>Jens Breitenstein</TD> <TD>Jens Seidel<br>Jens Breitenstein</TD>
<TD>jensseidel@NOSPAM.users.sourceforge.net<br>Jens.Breitenstein@NOSPAM.tlc.de</TD> <TD>jensseidel@NOSPAM.users.sf.net<br>Jens.Breitenstein@NOSPAM.tlc.de</TD>
<TD>up-to-date</TD> <TD>up-to-date</TD>
</TR> </TR>
<TR BGCOLOR="#ffffff"> <TR BGCOLOR="#ffffff">
...@@ -222,9 +222,9 @@ when the translator was updated. ...@@ -222,9 +222,9 @@ when the translator was updated.
\hline \hline
Finnish & Olli Korhonen & {\tt Olli.Korhonen@ccc.fi} & 1.0.0 \\ Finnish & Olli Korhonen & {\tt Olli.Korhonen@ccc.fi} & 1.0.0 \\
\hline \hline
French & Xavier Outhier & {\tt xavier.outhier@anfdata.cz} & up-to-date \\ French & Xavier Outhier & {\tt xouthier@yahoo.fr} & up-to-date \\
\hline \hline
German & Jens Seidel & {\tt jensseidel@users.sourceforge.net} & up-to-date \\ German & Jens Seidel & {\tt jensseidel@users.sf.net} & up-to-date \\
& Jens Breitenstein & {\tt Jens.Breitenstein@tlc.de} & \\ & Jens Breitenstein & {\tt Jens.Breitenstein@tlc.de} & \\
\hline \hline
Hungarian & F\"{o}ldv\'{a}ri Gy\"{o}rgy & {\tt foldvari@diatronltd.com} & 1.2.1 \\ Hungarian & F\"{o}ldv\'{a}ri Gy\"{o}rgy & {\tt foldvari@diatronltd.com} & 1.2.1 \\
...@@ -295,13 +295,13 @@ Just follow these steps: ...@@ -295,13 +295,13 @@ Just follow these steps:
\endverbatim \endverbatim
after the <code>if { ... }</code> after the <code>if { ... }</code>
<li>Edit libdoxygen.pro.in and add \c translator_xx.h to <li>Edit libdoxygen.pro.in and add \c translator_xx.h to
the \c HEADERS line in the file doxygen.pro. the \c HEADERS line.
<li>Edit <code>translator_xx.h</code>: <li>Edit <code>translator_xx.h</code>:
<ul> <ul>
<li>Rename <code>TRANSLATOR_EN_H</code> to <code>TRANSLATOR_XX_H</code> twice. <li>Rename <code>TRANSLATOR_EN_H</code> to <code>TRANSLATOR_XX_H</code> twice.
<li>Rename TranslatorEnglish to TranslatorYourLanguage <li>Rename TranslatorEnglish to TranslatorYourLanguage
<li>In the member <code>idLanguage()</code> change "english" into the <li>In the member <code>idLanguage()</code> change "english" into the
name of the your language (use lower case characters only). Depending name of your language (use lower case characters only). Depending
on the language you may also wish to change the member functions on the language you may also wish to change the member functions
latexLanguageSupportCommand(), idLanguageCharset() and others latexLanguageSupportCommand(), idLanguageCharset() and others
(you will recognize them when you start the work). (you will recognize them when you start the work).
......
...@@ -68,13 +68,13 @@ Just follow these steps: ...@@ -68,13 +68,13 @@ Just follow these steps:
\endverbatim \endverbatim
after the <code>if { ... }</code> after the <code>if { ... }</code>
<li>Edit libdoxygen.pro.in and add \c translator_xx.h to <li>Edit libdoxygen.pro.in and add \c translator_xx.h to
the \c HEADERS line in the file doxygen.pro. the \c HEADERS line.
<li>Edit <code>translator_xx.h</code>: <li>Edit <code>translator_xx.h</code>:
<ul> <ul>
<li>Rename <code>TRANSLATOR_EN_H</code> to <code>TRANSLATOR_XX_H</code> twice. <li>Rename <code>TRANSLATOR_EN_H</code> to <code>TRANSLATOR_XX_H</code> twice.
<li>Rename TranslatorEnglish to TranslatorYourLanguage <li>Rename TranslatorEnglish to TranslatorYourLanguage
<li>In the member <code>idLanguage()</code> change "english" into the <li>In the member <code>idLanguage()</code> change "english" into the
name of the your language (use lower case characters only). Depending name of your language (use lower case characters only). Depending
on the language you may also wish to change the member functions on the language you may also wish to change the member functions
latexLanguageSupportCommand(), idLanguageCharset() and others latexLanguageSupportCommand(), idLanguageCharset() and others
(you will recognize them when you start the work). (you will recognize them when you start the work).
......
...@@ -27,10 +27,10 @@ Finnish ...@@ -27,10 +27,10 @@ Finnish
Olli Korhonen: Olli.Korhonen@ccc.fi Olli Korhonen: Olli.Korhonen@ccc.fi
French French
Xavier Outhier: xavier.outhier@anfdata.cz Xavier Outhier: xouthier@yahoo.fr
German German
Jens Seidel: jensseidel@users.sourceforge.net Jens Seidel: jensseidel@users.sf.net
Jens Breitenstein: Jens.Breitenstein@tlc.de Jens Breitenstein: Jens.Breitenstein@tlc.de
Hungarian Hungarian
......
...@@ -575,7 +575,7 @@ xxxTABLE_FOOTxxx ...@@ -575,7 +575,7 @@ xxxTABLE_FOOTxxx
##}}} ##}}}
# Finish the tables, and substitute the mark in the doc # Finish the tables, and substitute the mark in the doc
# template by the contatenation of the tables. Add NOSPAM to # template by the concatenation of the tables. Add NOSPAM to
# email addresses in the HTML table. Replace the special # email addresses in the HTML table. Replace the special
# character sequences. #{{{ # character sequences. #{{{
# #
......
Name: doxygen Name: doxygen
Version: 1.2.8_20010723 Version: 1.2.9
Summary: documentation system for C, C++ and IDL Summary: documentation system for C, C++ and IDL
Release: 3 Release: 4
Source: doxygen-%{version}.src.tar.gz Source: doxygen-%{version}.src.tar.gz
Copyright: GPL Copyright: GPL
...@@ -41,13 +41,20 @@ Autor: ...@@ -41,13 +41,20 @@ Autor:
%setup -n doxygen-%{version} %setup -n doxygen-%{version}
%build %build
CFLAGS="$RPM_OPT_FLAGS" ./configure --with-doxywizard CFLAGS="$RPM_OPT_FLAGS" ./configure --with-doxywizard --with-xmlgen
# the next path is Suse specific
QTDIR=/usr/lib/qt2
PATH=${QTDIR}/bin:$PATH
export QTDIR PATH
make make
%install %install
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
make install INSTALL=$RPM_BUILD_ROOT/usr DOCDIR=$RPM_BUILD_ROOT%{_docdir}/doxygen make install install_docs INSTALL=$RPM_BUILD_ROOT/usr \
install -m 644 LICENSE LANGUAGE.HOWTO PLATFORMS README VERSION $RPM_BUILD_ROOT%{_docdir}/doxygen DOCDIR=$RPM_BUILD_ROOT%{_docdir}/doxygen
install -m 644 LICENSE LANGUAGE.HOWTO PLATFORMS README VERSION \
$RPM_BUILD_ROOT%{_docdir}/doxygen
find $RPM_BUILD_ROOT -name CVS -type d -depth -exec rm -r {} \; find $RPM_BUILD_ROOT -name CVS -type d -depth -exec rm -r {} \;
%files %files
...@@ -59,6 +66,11 @@ find $RPM_BUILD_ROOT -name CVS -type d -depth -exec rm -r {} \; ...@@ -59,6 +66,11 @@ find $RPM_BUILD_ROOT -name CVS -type d -depth -exec rm -r {} \;
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%changelog %changelog
* Sun Jun 10 2001 Matthias Andree <ma@dt.e-technik.uni-dortmund.de>
- update to 1.2.8.1
* Tue Jun 5 2001 Matthias Andree <ma@dt.e-technik.uni-dortmund.de>
- update to 1.2.8
- enable XML-Generator
* Mon Apr 16 2001 Jens Seidel <jensseidel@users.sourceforge.net> * Mon Apr 16 2001 Jens Seidel <jensseidel@users.sourceforge.net>
- new decription (english, german) - new decription (english, german)
- use of %{_docdir} - use of %{_docdir}
......
...@@ -103,6 +103,7 @@ ClassDef::ClassDef( ...@@ -103,6 +103,7 @@ ClassDef::ClassDef(
m_templateMaster =0; m_templateMaster =0;
m_templBaseClassNames = 0; m_templBaseClassNames = 0;
m_artificial = FALSE; m_artificial = FALSE;
m_isAbstract = FALSE;
} }
// destroy the class definition // destroy the class definition
...@@ -453,6 +454,11 @@ void ClassDef::insertMember(MemberDef *md) ...@@ -453,6 +454,11 @@ void ClassDef::insertMember(MemberDef *md)
} }
if (md->virtualness()==Pure)
{
m_isAbstract=TRUE;
}
MemberInfo *mi = new MemberInfo((MemberDef *)md, MemberInfo *mi = new MemberInfo((MemberDef *)md,
md->protection(),md->virtualness(),FALSE); md->protection(),md->virtualness(),FALSE);
MemberNameInfo *mni=0; MemberNameInfo *mni=0;
...@@ -660,7 +666,10 @@ static void writeTemplateSpec(OutputList &ol,Definition *d, ...@@ -660,7 +666,10 @@ static void writeTemplateSpec(OutputList &ol,Definition *d,
if (a) ol.docify(", "); if (a) ol.docify(", ");
} }
ol.docify(">"); ol.docify(">");
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
ol.lineBreak(); ol.lineBreak();
ol.popGeneratorState();
} }
ol.docify(type.lower()+" "+name); ol.docify(type.lower()+" "+name);
ol.endSubsubsection(); ol.endSubsubsection();
...@@ -1185,11 +1194,14 @@ void ClassDef::writeDocumentation(OutputList &ol) ...@@ -1185,11 +1194,14 @@ void ClassDef::writeDocumentation(OutputList &ol)
ClassSDict::Iterator cli(*m_innerClasses); ClassSDict::Iterator cli(*m_innerClasses);
ClassDef *innerCd; ClassDef *innerCd;
for (cli.toFirst();(innerCd=cli.current());++cli) for (cli.toFirst();(innerCd=cli.current());++cli)
{
if (innerCd->isLinkableInProject() && innerCd->templateMaster()==0)
{ {
msg("Generating docs for nested compound %s...\n",innerCd->name().data()); msg("Generating docs for nested compound %s...\n",innerCd->name().data());
innerCd->writeDocumentation(ol); innerCd->writeDocumentation(ol);
} }
} }
}
} }
// write the list of all (inherited) members for this class // write the list of all (inherited) members for this class
......
...@@ -195,6 +195,11 @@ class ClassDef : public Definition ...@@ -195,6 +195,11 @@ class ClassDef : public Definition
QCString qualifiedNameWithTemplateParameters( QCString qualifiedNameWithTemplateParameters(
QList<ArgumentList> *actualParams=0) const; QList<ArgumentList> *actualParams=0) const;
/*! Returns TRUE if there is at least one pure virtual member in this
* class.
*/
bool isAbstract() const { return m_isAbstract; }
/* member lists by protection */ /* member lists by protection */
MemberList pubMembers; MemberList pubMembers;
MemberList proMembers; MemberList proMembers;
...@@ -402,6 +407,9 @@ class ClassDef : public Definition ...@@ -402,6 +407,9 @@ class ClassDef : public Definition
* the inheritance tree. * the inheritance tree.
*/ */
bool m_artificial; bool m_artificial;
/*! Is this an abstact class? */
bool m_isAbstract;
}; };
/*! \brief Class that contains information about a usage relation. /*! \brief Class that contains information about a usage relation.
......
...@@ -328,7 +328,7 @@ static void addVariable() ...@@ -328,7 +328,7 @@ static void addVariable()
else else
{ {
int i; int i;
if ((getResolvedClass(g_cvd.type)) || (g_codeClassDict[g_cvd.type])) if ((getResolvedClass(g_currentDefinition,g_cvd.type)) || (g_codeClassDict[g_cvd.type]))
{ {
//printf("adding variable `%s' `%s'\n",g_cvd.type.data(),g_cvd.name.data()); //printf("adding variable `%s' `%s'\n",g_cvd.type.data(),g_cvd.name.data());
g_cvd.classScope=g_classScope; g_cvd.classScope=g_classScope;
...@@ -337,7 +337,7 @@ static void addVariable() ...@@ -337,7 +337,7 @@ static void addVariable()
else if ((i=g_cvd.type.find('<'))>0) else if ((i=g_cvd.type.find('<'))>0)
{ {
g_cvd.type = g_cvd.type.left(i); g_cvd.type = g_cvd.type.left(i);
if ((getResolvedClass(g_cvd.type)) || (g_codeClassDict[g_cvd.type.left(i)])) if ((getResolvedClass(g_currentDefinition,g_cvd.type)) || (g_codeClassDict[g_cvd.type.left(i)]))
{ {
//printf("adding template type variable `%s' `%s'\n",g_cvd.type.data(),g_cvd.name.data()); //printf("adding template type variable `%s' `%s'\n",g_cvd.type.data(),g_cvd.name.data());
g_cvd.classScope=g_classScope; g_cvd.classScope=g_classScope;
...@@ -359,7 +359,7 @@ static void addParameter() ...@@ -359,7 +359,7 @@ static void addParameter()
else else
{ {
int i; int i;
if ((getResolvedClass(g_cvd.type)) || (g_codeClassDict[g_cvd.type])) if ((getResolvedClass(g_currentDefinition,g_cvd.type)) || (g_codeClassDict[g_cvd.type]))
{ {
//printf("adding parameter `%s' `%s'\n",g_cvd.type.data(),g_cvd.name.data()); //printf("adding parameter `%s' `%s'\n",g_cvd.type.data(),g_cvd.name.data());
g_cvd.classScope=g_classScope; g_cvd.classScope=g_classScope;
...@@ -368,7 +368,7 @@ static void addParameter() ...@@ -368,7 +368,7 @@ static void addParameter()
else if ((i=g_cvd.type.find('<'))>0) else if ((i=g_cvd.type.find('<'))>0)
{ {
g_cvd.type = g_cvd.type.left(i); g_cvd.type = g_cvd.type.left(i);
if ((getResolvedClass(g_cvd.type)) || (g_codeClassDict[g_cvd.type.left(i)])) if ((getResolvedClass(g_currentDefinition,g_cvd.type)) || (g_codeClassDict[g_cvd.type.left(i)]))
{ {
//printf("adding template type parameter `%s' `%s'\n",g_cvd.type.data(),g_cvd.name.data()); //printf("adding template type parameter `%s' `%s'\n",g_cvd.type.data(),g_cvd.name.data());
g_cvd.classScope=g_classScope; g_cvd.classScope=g_classScope;
...@@ -409,10 +409,10 @@ static void generateClassLink(OutputDocInterface &ol,char *clName,int *clNameLen ...@@ -409,10 +409,10 @@ static void generateClassLink(OutputDocInterface &ol,char *clName,int *clNameLen
QCString className=clName; QCString className=clName;
if (clNameLen) *clNameLen=0; if (clNameLen) *clNameLen=0;
if (className.isEmpty()) return; if (className.isEmpty()) return;
ClassDef *cd=getResolvedClass(className); ClassDef *cd=getResolvedClass(g_currentDefinition,className);
if (cd==0 && (i=className.find('<'))!=-1) if (cd==0 && (i=className.find('<'))!=-1)
{ {
cd=getResolvedClass(className.left(i)); cd=getResolvedClass(g_currentDefinition,className.left(i));
} }
if (cd && cd->isLinkable()) if (cd && cd->isLinkable())
{ {
...@@ -458,11 +458,11 @@ static ClassDef *stripClassName(const char *s) ...@@ -458,11 +458,11 @@ static ClassDef *stripClassName(const char *s)
//printf("g_classScope=`%s' clName=`%s'\n",g_classScope.data(),clName.data()); //printf("g_classScope=`%s' clName=`%s'\n",g_classScope.data(),clName.data());
if (!g_classScope.isEmpty()) if (!g_classScope.isEmpty())
{ {
cd=getResolvedClass(g_classScope+"::"+clName); cd=getResolvedClass(g_currentDefinition,g_classScope+"::"+clName);
} }
if (cd==0) if (cd==0)
{ {
cd=getResolvedClass(clName); cd=getResolvedClass(g_currentDefinition,clName);
} }
if (cd) if (cd)
{ {
...@@ -632,7 +632,7 @@ static void generateMemberLink(OutputDocInterface &ol,const char *varName, ...@@ -632,7 +632,7 @@ static void generateMemberLink(OutputDocInterface &ol,const char *varName,
} }
else else
{ {
ClassDef *vcd = getResolvedClass(g_classScope); ClassDef *vcd = getResolvedClass(g_currentDefinition,g_classScope);
if (vcd && vcd->isLinkable()) if (vcd && vcd->isLinkable())
{ {
//printf("Found class %s for variable `%s'\n",g_classScope.data(),varName); //printf("Found class %s for variable `%s'\n",g_classScope.data(),varName);
......
...@@ -2165,28 +2165,68 @@ void Config::create() ...@@ -2165,28 +2165,68 @@ void Config::create()
// The IMAGE_PATTERNS tag is now officially obsolete. // The IMAGE_PATTERNS tag is now officially obsolete.
} }
static QCString configFileToString(const char *name)
bool Config::parse(const char *fn)
{ {
QFileInfo fi( fn ); if (name==0 || name[0]==0) return 0;
if (!fi.exists()) QFile f;
bool fileOpened=FALSE;
if (name[0]=='-' && name[1]==0) // read from stdin
{ {
return FALSE; fileOpened=f.open(IO_ReadOnly,stdin);
} if (fileOpened)
QFile f( fn );
if (!f.open(IO_ReadOnly))
{ {
return FALSE; const int bSize=4096;
QCString contents(bSize);
int totalSize=0;
int size;
while ((size=f.readBlock(contents.data()+totalSize,bSize))==bSize)
{
totalSize+=bSize;
contents.resize(totalSize+bSize);
}
totalSize+=size+2;
contents.resize(totalSize);
contents.at(totalSize-2)='\n'; // to help the scanner
contents.at(totalSize-1)='\0';
return contents;
}
} }
// read file into a string buffer else // read from file
int fsize = fi.size();
QCString contents(fsize+1); // add room for \0 terminator
if (f.readBlock(contents.data(),fsize)!=fsize)
{ {
return FALSE; QFileInfo fi(name);
if (!fi.exists() || !fi.isFile())
{
config_err("Error: file `%s' not found\n",name);
return "";
} }
f.setName(name);
fileOpened=f.open(IO_ReadOnly);
if (fileOpened)
{
int fsize=f.size();
QCString contents(fsize+2);
f.readBlock(contents.data(),fsize);
if (fsize==0 || contents[fsize-1]=='\n')
contents[fsize]='\0'; contents[fsize]='\0';
else
contents[fsize]='\n'; // to help the scanner
contents[fsize+1]='\0';
f.close();
return contents;
}
}
if (!fileOpened)
{
config_err("Error: cannot open file `%s' for reading\n",name);
}
return "";
}
bool Config::parse(const char *fn)
{
QCString contents = configFileToString(fn);
config = Config::instance(); config = Config::instance();
inputString = contents.data(); inputString = contents.data();
inputPosition = 0; inputPosition = 0;
......
...@@ -262,12 +262,12 @@ ID [a-z_A-Z][a-z_A-Z0-9]* ...@@ -262,12 +262,12 @@ ID [a-z_A-Z][a-z_A-Z0-9]*
a->attrib = g_curArgAttrib.copy(); a->attrib = g_curArgAttrib.copy();
if (i>=0 && g_curArgTypeName.at(i)!=':') if (i>=0 && g_curArgTypeName.at(i)!=':')
{ // type contains a name { // type contains a name
a->type = g_curArgTypeName.left(i+1).stripWhiteSpace(); a->type = removeRedundantWhiteSpace(g_curArgTypeName.left(i+1));
a->name = g_curArgTypeName.right(g_curArgTypeName.length()-i-1); a->name = g_curArgTypeName.right(g_curArgTypeName.length()-i-1);
} }
else // assume only the type was specified, try to determine name later else // assume only the type was specified, try to determine name later
{ {
a->type = g_curArgTypeName.stripWhiteSpace(); a->type = removeRedundantWhiteSpace(g_curArgTypeName);
} }
a->array = removeRedundantWhiteSpace(g_curArgArray); a->array = removeRedundantWhiteSpace(g_curArgArray);
a->defval = g_curArgDefValue.copy(); a->defval = g_curArgDefValue.copy();
...@@ -365,7 +365,6 @@ void stringToArgumentList(const char *argsString,ArgumentList* &al) ...@@ -365,7 +365,6 @@ void stringToArgumentList(const char *argsString,ArgumentList* &al)
if (al==0) return; if (al==0) return;
if (argsString==0) return; if (argsString==0) return;
g_inputString = argsString; g_inputString = argsString;
//printf("stringToArgumentList(%s)\n",argsString);
g_inputPosition = 0; g_inputPosition = 0;
g_curArgTypeName.resize(0); g_curArgTypeName.resize(0);
g_curArgDefValue.resize(0); g_curArgDefValue.resize(0);
...@@ -374,6 +373,7 @@ void stringToArgumentList(const char *argsString,ArgumentList* &al) ...@@ -374,6 +373,7 @@ void stringToArgumentList(const char *argsString,ArgumentList* &al)
defargsYYrestart( defargsYYin ); defargsYYrestart( defargsYYin );
BEGIN( Start ); BEGIN( Start );
defargsYYlex(); defargsYYlex();
//printf("stringToArgumentList(%s) result=%s\n",argsString,argListToString(al).data());
} }
extern "C" { // some bogus code to keep the compiler happy extern "C" { // some bogus code to keep the compiler happy
......
...@@ -50,7 +50,7 @@ Definition::Definition(const char *df,int dl, ...@@ -50,7 +50,7 @@ Definition::Definition(const char *df,int dl,
m_todoId=0; m_todoId=0;
m_testId=0; m_testId=0;
m_bugId=0; m_bugId=0;
m_outerScope=0; m_outerScope=Doxygen::globalScope;
} }
Definition::~Definition() Definition::~Definition()
......
...@@ -2050,10 +2050,10 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) ...@@ -2050,10 +2050,10 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG})
<DocScan>"</"{TR}{ATTR}">" <DocScan>"</"{TR}{ATTR}">"
<DocScan>"<"{TD}{ATTR}">" { if (curTable) curTable->newElem(); } <DocScan>"<"{TD}{ATTR}">" { if (curTable) curTable->newElem(); }
<DocScan>"</"{TD}{ATTR}">" <DocScan>"</"{TD}{ATTR}">"
<DocScan>"<"{OL}{ATTR}">" { outDoc->startEnumList(); <DocScan>"<"{OL}{ATTR}">"{BN}* { outDoc->startEnumList();
currentListIndent.push("O"); currentListIndent.push("O");
} }
<DocScan>"</"{OL}{ATTR}">" { <DocScan>"</"{OL}{ATTR}">"{BN}* {
if (currentListIndent.isEmpty()) if (currentListIndent.isEmpty())
{ {
warn(yyFileName,yyLineNr, warn(yyFileName,yyLineNr,
...@@ -2072,10 +2072,10 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) ...@@ -2072,10 +2072,10 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG})
currentListIndent.pop(); currentListIndent.pop();
} }
} }
<DocScan>"<"{UL}{ATTR}">" { outDoc->startItemList(); <DocScan>"<"{UL}{ATTR}">"{BN}* { outDoc->startItemList();
currentListIndent.push("U"); currentListIndent.push("U");
} }
<DocScan>"</"{UL}{ATTR}">" { <DocScan>"</"{UL}{ATTR}">"{BN}* {
if (currentListIndent.isEmpty()) if (currentListIndent.isEmpty())
{ {
warn(yyFileName,yyLineNr, warn(yyFileName,yyLineNr,
......
...@@ -97,7 +97,8 @@ static bool convertMapFile(QTextStream &t,const char *mapName) ...@@ -97,7 +97,8 @@ static bool convertMapFile(QTextStream &t,const char *mapName)
if ((dest=Doxygen::tagDestinationDict[refPtr])) t << *dest << "/"; if ((dest=Doxygen::tagDestinationDict[refPtr])) t << *dest << "/";
} }
t << urlPtr << "\" shape=\"rect\" coords=\"" t << urlPtr << "\" shape=\"rect\" coords=\""
<< x1 << "," << y1 << "," << x2 << "," << y2 << "\">" << endl; << x1 << "," << y1 << "," << x2 << "," << y2 << "\""
<< " alt=\"\">" << endl;
} }
} }
} }
......
...@@ -98,7 +98,7 @@ StringDict Doxygen::aliasDict(257); // aliases ...@@ -98,7 +98,7 @@ StringDict Doxygen::aliasDict(257); // aliases
FileNameDict *Doxygen::includeNameDict; // include names FileNameDict *Doxygen::includeNameDict; // include names
FileNameDict *Doxygen::exampleNameDict; // examples FileNameDict *Doxygen::exampleNameDict; // examples
FileNameDict *Doxygen::imageNameDict; // images FileNameDict *Doxygen::imageNameDict; // images
StringDict Doxygen::typedefDict(1009); // all typedefs //TypedefDict Doxygen::typedefDict(1009); // all typedefs
StringDict Doxygen::namespaceAliasDict(257); // all namespace aliases StringDict Doxygen::namespaceAliasDict(257); // all namespace aliases
StringDict Doxygen::tagDestinationDict(257); // all tag locations StringDict Doxygen::tagDestinationDict(257); // all tag locations
// a member group // a member group
...@@ -140,7 +140,7 @@ void clearAll() ...@@ -140,7 +140,7 @@ void clearAll()
Doxygen::includeNameDict->clear(); Doxygen::includeNameDict->clear();
Doxygen::exampleNameDict->clear(); Doxygen::exampleNameDict->clear();
Doxygen::imageNameDict->clear(); Doxygen::imageNameDict->clear();
Doxygen::typedefDict.clear(); //Doxygen::typedefDict.clear();
Doxygen::groupDict.clear(); Doxygen::groupDict.clear();
Doxygen::formulaDict.clear(); Doxygen::formulaDict.clear();
Doxygen::formulaNameDict.clear(); Doxygen::formulaNameDict.clear();
...@@ -172,7 +172,7 @@ void statistics() ...@@ -172,7 +172,7 @@ void statistics()
fprintf(stderr,"--- aliasDict stats ----\n"); fprintf(stderr,"--- aliasDict stats ----\n");
Doxygen::aliasDict.statistics(); Doxygen::aliasDict.statistics();
fprintf(stderr,"--- typedefDict stats ----\n"); fprintf(stderr,"--- typedefDict stats ----\n");
Doxygen::typedefDict.statistics(); //Doxygen::typedefDict.statistics();
fprintf(stderr,"--- namespaceAliasDict stats ----\n"); fprintf(stderr,"--- namespaceAliasDict stats ----\n");
Doxygen::namespaceAliasDict.statistics(); Doxygen::namespaceAliasDict.statistics();
fprintf(stderr,"--- groupDict stats ----\n"); fprintf(stderr,"--- groupDict stats ----\n");
...@@ -937,9 +937,6 @@ static void buildClassList(Entry *root) ...@@ -937,9 +937,6 @@ static void buildClassList(Entry *root)
Definition *d = findScopeFromQualifiedName(Doxygen::globalScope,fullName); Definition *d = findScopeFromQualifiedName(Doxygen::globalScope,fullName);
if (d==0) if (d==0)
{ {
// TODO: Due to the order in which the tag file is written
// a nested class can be found before its parent!
//
//warn(root->fileName,root->startLine, //warn(root->fileName,root->startLine,
// "Warning: Internal inconsistency: scope for class %s not " // "Warning: Internal inconsistency: scope for class %s not "
// "found!\n",fullName.data() // "found!\n",fullName.data()
...@@ -1263,8 +1260,6 @@ static void findUsingDeclarations(Entry *root) ...@@ -1263,8 +1260,6 @@ static void findUsingDeclarations(Entry *root)
} }
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
static MemberDef *addVariableToClass( static MemberDef *addVariableToClass(
...@@ -1401,6 +1396,7 @@ static MemberDef *addVariableToClass( ...@@ -1401,6 +1396,7 @@ static MemberDef *addVariableToClass(
//TODO: insert FileDef instead of filename strings. //TODO: insert FileDef instead of filename strings.
cd->insertUsedFile(root->fileName); cd->insertUsedFile(root->fileName);
root->section = Entry::EMPTY_SEC;
return md; return md;
} }
...@@ -1569,6 +1565,7 @@ static MemberDef *addVariableToFile( ...@@ -1569,6 +1565,7 @@ static MemberDef *addVariableToFile(
Doxygen::functionNameDict.insert(name,mn); Doxygen::functionNameDict.insert(name,mn);
Doxygen::functionNameList.append(mn); Doxygen::functionNameList.append(mn);
} }
root->section = Entry::EMPTY_SEC;
return md; return md;
} }
...@@ -1983,6 +1980,7 @@ static void buildMemberList(Entry *root) ...@@ -1983,6 +1980,7 @@ static void buildMemberList(Entry *root)
cd->insertUsedFile(root->fileName); cd->insertUsedFile(root->fileName);
addMemberToGroups(root,md); addMemberToGroups(root,md);
root->section = Entry::EMPTY_SEC;
} }
else if (root->parent && else if (root->parent &&
!(root->parent->section & Entry::COMPOUND_MASK) && !(root->parent->section & Entry::COMPOUND_MASK) &&
...@@ -2176,6 +2174,7 @@ static void buildMemberList(Entry *root) ...@@ -2176,6 +2174,7 @@ static void buildMemberList(Entry *root)
Doxygen::functionNameList.append(mn); Doxygen::functionNameList.append(mn);
} }
addMemberToGroups(root,md); addMemberToGroups(root,md);
root->section = Entry::EMPTY_SEC;
} }
else else
{ {
...@@ -2397,28 +2396,6 @@ static void replaceNamespaceAliases(QCString &scope,int i) ...@@ -2397,28 +2396,6 @@ static void replaceNamespaceAliases(QCString &scope,int i)
//printf("replaceNamespaceAliases() result=%s\n",scope.data()); //printf("replaceNamespaceAliases() result=%s\n",scope.data());
} }
static QCString resolveTypeDef(const QCString &name)
{
QCString typeName;
if (!name.isEmpty())
{
QCString *subst = Doxygen::typedefDict[name];
if (subst)
{
int count=0;
typeName=*subst;
QCString *newSubst;
while ((newSubst=Doxygen::typedefDict[typeName]) && count<10)
{
if (typeName==*newSubst) break; // prevent lock-up
typeName=*newSubst;
count++;
}
}
}
return typeName;
}
/*! make a dictionary of all template arguments of class cd /*! make a dictionary of all template arguments of class cd
* that are part of the base class name. * that are part of the base class name.
* Example: A template class A with template arguments <R,S,T> * Example: A template class A with template arguments <R,S,T>
...@@ -2507,7 +2484,7 @@ static void findUsedClassesForClass(Entry *root, ...@@ -2507,7 +2484,7 @@ static void findUsedClassesForClass(Entry *root,
//printf("extractClassNameFromType(%s)\n",type.data()); //printf("extractClassNameFromType(%s)\n",type.data());
while (!found && extractClassNameFromType(type,pos,usedClassName,templSpec)) while (!found && extractClassNameFromType(type,pos,usedClassName,templSpec))
{ {
QCString typeName = resolveTypeDef(usedClassName); QCString typeName = resolveTypeDef(masterCd,usedClassName);
QCString usedName = usedClassName+templSpec; QCString usedName = usedClassName+templSpec;
if (!typeName.isEmpty()) if (!typeName.isEmpty())
{ {
...@@ -2566,14 +2543,14 @@ static void findUsedClassesForClass(Entry *root, ...@@ -2566,14 +2543,14 @@ static void findUsedClassesForClass(Entry *root,
QCString scopeName = scope ? scope->qualifiedName().data() : 0; QCString scopeName = scope ? scope->qualifiedName().data() : 0;
if (!scopeName.isEmpty()) if (!scopeName.isEmpty())
{ {
usedCd=getResolvedClass(scopeName+"::"+usedName,0,&templSpec); usedCd=getResolvedClass(masterCd,scopeName+"::"+usedName,0,&templSpec);
if (usedCd==0) usedCd=getResolvedClass(scopeName+"::"+usedClassName,0,&templSpec); if (usedCd==0) usedCd=getResolvedClass(masterCd,scopeName+"::"+usedClassName,0,&templSpec);
//printf("Search for class %s result=%p\n",(scopeName+"::"+usedName).data(),usedCd); //printf("Search for class %s result=%p\n",(scopeName+"::"+usedName).data(),usedCd);
} }
else else
{ {
usedCd=getResolvedClass(usedName,0,&templSpec); usedCd=getResolvedClass(masterCd,usedName,0,&templSpec);
if (usedCd==0) usedCd=getResolvedClass(usedClassName,0,&templSpec); if (usedCd==0) usedCd=getResolvedClass(masterCd,usedClassName,0,&templSpec);
//printf("Search for class %s result=%p\n",usedName.data(),usedCd); //printf("Search for class %s result=%p\n",usedName.data(),usedCd);
} }
if (scope) scope=scope->getOuterScope(); if (scope) scope=scope->getOuterScope();
...@@ -2735,15 +2712,17 @@ static bool findClassRelation( ...@@ -2735,15 +2712,17 @@ static bool findClassRelation(
//printf("scopePrefix=`%s' bi->name=`%s'\n", //printf("scopePrefix=`%s' bi->name=`%s'\n",
// scopeName.left(scopeOffset).data(),bi->name.data()); // scopeName.left(scopeOffset).data(),bi->name.data());
QCString baseClassName=stripTemplateSpecifiersFromScope QCString baseClassName=bi->name;
(removeRedundantWhiteSpace(bi->name));
if (scopeOffset>0) if (scopeOffset>0)
{ {
baseClassName.prepend(scopeName.left(scopeOffset)+"::"); baseClassName.prepend(scopeName.left(scopeOffset)+"::");
} }
baseClassName=stripTemplateSpecifiersFromScope
(removeRedundantWhiteSpace(baseClassName));
bool baseClassIsTypeDef; bool baseClassIsTypeDef;
QCString templSpec; QCString templSpec;
ClassDef *baseClass=getResolvedClass(baseClassName,&baseClassIsTypeDef,&templSpec); ClassDef *baseClass=getResolvedClass(cd,baseClassName,&baseClassIsTypeDef,&templSpec);
//printf("baseClassName=%s baseClass=%p cd=%p\n",baseClassName.data(),baseClass,cd);
//printf(" baseClassName=`%s' baseClass=%s templSpec=%s\n", //printf(" baseClassName=`%s' baseClass=%s templSpec=%s\n",
// baseClassName.data(), // baseClassName.data(),
// baseClass?baseClass->name().data():"<none>", // baseClass?baseClass->name().data():"<none>",
...@@ -2787,7 +2766,7 @@ static bool findClassRelation( ...@@ -2787,7 +2766,7 @@ static bool findClassRelation(
{ {
templSpec=baseClassName.mid(i,e-i); templSpec=baseClassName.mid(i,e-i);
baseClassName=baseClassName.left(i)+baseClassName.right(baseClassName.length()-e); baseClassName=baseClassName.left(i)+baseClassName.right(baseClassName.length()-e);
baseClass=getResolvedClass(baseClassName); baseClass=getResolvedClass(cd,baseClassName);
//printf("baseClass=%p -> baseClass=%s templSpec=%s\n", //printf("baseClass=%p -> baseClass=%s templSpec=%s\n",
// baseClass,baseClassName.data(),templSpec.data()); // baseClass,baseClassName.data(),templSpec.data());
} }
...@@ -2799,7 +2778,7 @@ static bool findClassRelation( ...@@ -2799,7 +2778,7 @@ static bool findClassRelation(
{ {
// replace any namespace aliases // replace any namespace aliases
replaceNamespaceAliases(baseClassName,i); replaceNamespaceAliases(baseClassName,i);
baseClass=getResolvedClass(baseClassName); baseClass=getResolvedClass(cd,baseClassName);
found=baseClass!=0 && baseClass!=cd; found=baseClass!=0 && baseClass!=cd;
} }
...@@ -2818,7 +2797,7 @@ static bool findClassRelation( ...@@ -2818,7 +2797,7 @@ static bool findClassRelation(
for (nli.toFirst() ; (nd=nli.current()) && !found ; ++nli) for (nli.toFirst() ; (nd=nli.current()) && !found ; ++nli)
{ {
QCString fName = nd->name()+"::"+baseClassName; QCString fName = nd->name()+"::"+baseClassName;
found = (baseClass=getResolvedClass(fName))!=0 && baseClass!=cd && found = (baseClass=getResolvedClass(cd,fName))!=0 && baseClass!=cd &&
root->name!=fName; root->name!=fName;
} }
} }
...@@ -2844,7 +2823,7 @@ static bool findClassRelation( ...@@ -2844,7 +2823,7 @@ static bool findClassRelation(
{ {
NamespaceList *nl = nd->getUsedNamespaces(); NamespaceList *nl = nd->getUsedNamespaces();
QCString fName = nd->name()+"::"+baseClassName; QCString fName = nd->name()+"::"+baseClassName;
found = (baseClass=getResolvedClass(fName))!=0 && root->name!=fName; found = (baseClass=getResolvedClass(cd,fName))!=0 && root->name!=fName;
if (nl) // try to prepend any of the using namespace scopes. if (nl) // try to prepend any of the using namespace scopes.
{ {
NamespaceListIterator nli(*nl); NamespaceListIterator nli(*nl);
...@@ -2852,7 +2831,7 @@ static bool findClassRelation( ...@@ -2852,7 +2831,7 @@ static bool findClassRelation(
for (nli.toFirst() ; (nd=nli.current()) && !found ; ++nli) for (nli.toFirst() ; (nd=nli.current()) && !found ; ++nli)
{ {
fName = nd->name()+"::"+baseClassName; fName = nd->name()+"::"+baseClassName;
found = (baseClass=getResolvedClass(fName))!=0 && baseClass!=cd && found = (baseClass=getResolvedClass(cd,fName))!=0 && baseClass!=cd &&
root->name!=fName; root->name!=fName;
} }
} }
...@@ -3849,7 +3828,7 @@ static void findMember(Entry *root, ...@@ -3849,7 +3828,7 @@ static void findMember(Entry *root,
if (!funcDecl.isEmpty() && funcDecl[0]!=' ') funcDecl.prepend(" "); if (!funcDecl.isEmpty() && funcDecl[0]!=' ') funcDecl.prepend(" ");
// remove some superfluous spaces // remove some superfluous spaces
funcDecl=substitute( funcDecl= substitute(
substitute( substitute(
substitute(funcDecl,"~ ","~"), substitute(funcDecl,"~ ","~"),
":: ","::" ":: ","::"
......
...@@ -49,6 +49,7 @@ class StringDict : public QDict<QCString> ...@@ -49,6 +49,7 @@ class StringDict : public QDict<QCString>
virtual ~StringDict() {} virtual ~StringDict() {}
}; };
extern QCString spaces; extern QCString spaces;
/*! \brief This class serves as a namespace for global variables used by doxygen. /*! \brief This class serves as a namespace for global variables used by doxygen.
...@@ -78,7 +79,7 @@ class Doxygen ...@@ -78,7 +79,7 @@ class Doxygen
static QTextStream tagFile; static QTextStream tagFile;
static SectionDict sectionDict; static SectionDict sectionDict;
static FileNameList inputNameList; static FileNameList inputNameList;
static StringDict typedefDict; //static TypedefDict typedefDict;
static StringDict namespaceAliasDict; static StringDict namespaceAliasDict;
static GroupList groupList; static GroupList groupList;
static GroupDict groupDict; static GroupDict groupDict;
......
...@@ -289,17 +289,10 @@ class Entry ...@@ -289,17 +289,10 @@ class Entry
const char *groupdoccmd() const const char *groupdoccmd() const
{ {
switch( this->groupdoctype ) { switch( this->groupdoctype ) {
case GROUPDOC_NORMAL: case GROUPDOC_NORMAL: return "\\defgroup"; break;
return "\\defgroup"; case GROUPDOC_ADD: return "\\addgroup"; break;
break; case GROUPDOC_WEAK: return "\\weakgroup"; break;
case GROUPDOC_ADD: default: return "unknown group command";
return "\\addgroup";
break;
case GROUPDOC_WEAK:
return "\\weakgroup";
break;
default:
return "unknown group command";
} }
} }
Grouping::GroupPri_t groupingpri() const Grouping::GroupPri_t groupingpri() const
...@@ -308,17 +301,10 @@ class Entry ...@@ -308,17 +301,10 @@ class Entry
return Grouping::GROUPING_LOWEST; return Grouping::GROUPING_LOWEST;
} }
switch( this->groupdoctype ) { switch( this->groupdoctype ) {
case GROUPDOC_NORMAL: case GROUPDOC_NORMAL: return Grouping::GROUPING_AUTO_DEF; break;
return Grouping::GROUPING_AUTO_DEF; case GROUPDOC_ADD: return Grouping::GROUPING_AUTO_ADD; break;
break; case GROUPDOC_WEAK: return Grouping::GROUPING_AUTO_WEAK; break;
case GROUPDOC_ADD: default: return Grouping::GROUPING_LOWEST;
return Grouping::GROUPING_AUTO_ADD;
break;
case GROUPDOC_WEAK:
return Grouping::GROUPING_AUTO_WEAK;
break;
default:
return Grouping::GROUPING_LOWEST;
} }
} }
private: private:
......
...@@ -48,7 +48,8 @@ static const char *defaultStyleSheet = ...@@ -48,7 +48,8 @@ static const char *defaultStyleSheet =
"DL.el { margin-left: -1cm }\n" "DL.el { margin-left: -1cm }\n"
"DIV.fragment { width: 100%; border: none; background-color: #eeeeee }\n" "DIV.fragment { width: 100%; border: none; background-color: #eeeeee }\n"
"DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }\n" "DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }\n"
"TD.md { background-color: #f2f2ff }\n" "TD.md { background-color: #f2f2ff; font-weight: bold; }\n"
"TD.mdname { background-color: #f2f2ff; font-weight: bold; font-style: italic }\n"
"DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold }\n" "DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold }\n"
"DIV.groupText { margin-left: 16px; font-style: italic; font-size: smaller }\n" "DIV.groupText { margin-left: 16px; font-style: italic; font-size: smaller }\n"
"FONT.keyword { color: #008000 }\n" "FONT.keyword { color: #008000 }\n"
...@@ -160,6 +161,7 @@ void HtmlGenerator::writeFooterFile(QFile &file) ...@@ -160,6 +161,7 @@ void HtmlGenerator::writeFooterFile(QFile &file)
void HtmlGenerator::startFile(const char *name,const char *, void HtmlGenerator::startFile(const char *name,const char *,
const char *title,bool external) const char *title,bool external)
{ {
//printf("HtmlGenerator::startFile(%s)\n",name);
QCString fileName=name; QCString fileName=name;
lastTitle=title; lastTitle=title;
if (fileName.right(5)!=".html") fileName+=".html"; if (fileName.right(5)!=".html") fileName+=".html";
...@@ -870,13 +872,13 @@ void HtmlGenerator::startMemberDocPrefixItem() ...@@ -870,13 +872,13 @@ void HtmlGenerator::startMemberDocPrefixItem()
{ {
DBG_HTML(t << "<!-- startMemberDocPrefixItem -->" << endl;) DBG_HTML(t << "<!-- startMemberDocPrefixItem -->" << endl;)
t << " <tr>" << endl; t << " <tr>" << endl;
t << " <td colspan=\"2\"><b>" << endl; t << " <td class=\"md\" colspan=\"4\">" << endl;
} }
void HtmlGenerator::endMemberDocPrefixItem() void HtmlGenerator::endMemberDocPrefixItem()
{ {
DBG_HTML(t << "<!-- endMemberDocPrefixItem -->" << endl;) DBG_HTML(t << "<!-- endMemberDocPrefixItem -->" << endl;)
t << " </b></td>" << endl; t << " </td>" << endl;
t << " </tr>" << endl; t << " </tr>" << endl;
} }
...@@ -884,51 +886,86 @@ void HtmlGenerator::startMemberDocName() ...@@ -884,51 +886,86 @@ void HtmlGenerator::startMemberDocName()
{ {
DBG_HTML(t << "<!-- startMemberDocName -->" << endl;) DBG_HTML(t << "<!-- startMemberDocName -->" << endl;)
t << " <tr>" << endl; t << " <tr>" << endl;
t << " <td nowrap valign=\"top\"><b> " << endl; t << " <td class=\"md\" nowrap valign=\"top\"> " << endl;
} }
void HtmlGenerator::endMemberDocName() void HtmlGenerator::endMemberDocName()
{ {
DBG_HTML(t << "<!-- endMemberDocName -->" << endl;) DBG_HTML(t << "<!-- endMemberDocName -->" << endl;)
t << endl; t << endl;
t << " </b></td>" << endl; t << " </td>" << endl;
}
void HtmlGenerator::startParameterList()
{
DBG_HTML(t << "<!-- startParameterList -->" << endl;)
t << " <td class=\"md\">(&nbsp</td>" << endl;
} }
void HtmlGenerator::startParameter(bool first) void HtmlGenerator::startParameterType(bool first)
{ {
if (first) if (first)
{ {
DBG_HTML(t << "<!-- startFirstParameter -->" << endl;) DBG_HTML(t << "<!-- startFirstParameterType -->" << endl;)
t << " <td valign=\"bottom\"><b>" << endl; t << " <td class=\"md\">";
} }
else else
{ {
DBG_HTML(t << "<!-- startParameter -->" << endl;) DBG_HTML(t << "<!-- startParameterType -->" << endl;)
t << " <tr>" << endl; t << " <tr>" << endl;
t << " <td></td>" << endl; t << " <td></td>" << endl;
t << " <td><b>" << endl; t << " <td></td>" << endl;
t << " <td class=\"md\">";
} }
} }
void HtmlGenerator::endParameter(bool first) void HtmlGenerator::endParameterType()
{ {
if (first) DBG_HTML(t << "<!-- endParameterType -->" << endl;)
t << " </td>" << endl;
}
void HtmlGenerator::startParameterName()
{
DBG_HTML(t << "<!-- startParameterName -->" << endl;)
t << " <td class=\"mdname\">";
}
void HtmlGenerator::endParameterName(bool last,bool emptyList)
{
DBG_HTML(t << "<!-- endParameterName -->" << endl;)
if (last)
{ {
DBG_HTML(t << "<!-- endFirstParameter -->" << endl;) if (emptyList)
t << endl; {
t << " </b></td>" << endl; t << " </td>" << endl;
//t << " <td width=\"300\"><img src=\"null.gif\"></td>" << endl; t << " <td class=\"md\">)&nbsp;</td>" << endl;
t << " <td class=\"md\">";
}
else
{
t << " </td>" << endl;
t << " </tr>" << endl; t << " </tr>" << endl;
t << " <tr>" << endl;
t << " <td></td>" << endl;
t << " <td class=\"md\">)&nbsp</td>" << endl;
t << " <td class=\"md\" colspan=\"2\">";
}
} }
else else
{ {
DBG_HTML(t << "<!-- endParameter -->" << endl;) t << " </td>" << endl;
t << endl;
t << " </b></td>" << endl;
t << " </tr>" << endl; t << " </tr>" << endl;
} }
} }
void HtmlGenerator::endParameterList()
{
DBG_HTML(t << "<!-- endParameterList -->" << endl;)
t << " </td>" << endl;
t << " </tr>" << endl;
}
void HtmlGenerator::endMemberDoc() void HtmlGenerator::endMemberDoc()
{ {
DBG_HTML(t << "<!-- endMemberDoc -->" << endl;) DBG_HTML(t << "<!-- endMemberDoc -->" << endl;)
......
...@@ -232,8 +232,12 @@ class HtmlGenerator : public OutputGenerator ...@@ -232,8 +232,12 @@ class HtmlGenerator : public OutputGenerator
void endMemberDocPrefixItem(); void endMemberDocPrefixItem();
void startMemberDocName(); void startMemberDocName();
void endMemberDocName(); void endMemberDocName();
void startParameter(bool first); void startParameterType(bool first);
void endParameter(bool last); void endParameterType();
void startParameterName();
void endParameterName(bool last,bool emptyList);
void startParameterList();
void endParameterList();
void startFontClass(const char *s) { t << "<font class=\"" << s << "\">"; } void startFontClass(const char *s) { t << "<font class=\"" << s << "\">"; }
void endFontClass() { t << "</font>"; } void endFontClass() { t << "</font>"; }
......
...@@ -231,7 +231,7 @@ HtmlHelp *HtmlHelp::theInstance = 0; ...@@ -231,7 +231,7 @@ HtmlHelp *HtmlHelp::theInstance = 0;
* The object has to be \link initialize() initialized\endlink before it can * The object has to be \link initialize() initialized\endlink before it can
* be used. * be used.
*/ */
HtmlHelp::HtmlHelp() HtmlHelp::HtmlHelp() : indexFileDict(1009)
{ {
/* initial depth */ /* initial depth */
dc = 0; dc = 0;
...@@ -330,7 +330,7 @@ void HtmlHelp::createProjectFile() ...@@ -330,7 +330,7 @@ void HtmlHelp::createProjectFile()
while (s) while (s)
{ {
t << s << endl; t << s << endl;
s=indexFiles.next(); s = indexFiles.next();
} }
f.close(); f.close();
} }
...@@ -342,7 +342,11 @@ void HtmlHelp::createProjectFile() ...@@ -342,7 +342,11 @@ void HtmlHelp::createProjectFile()
void HtmlHelp::addIndexFile(const char *s) void HtmlHelp::addIndexFile(const char *s)
{ {
if (indexFileDict.find(s)==0)
{
indexFiles.append(s); indexFiles.append(s);
indexFileDict.insert(s,(void *)0x8);
}
} }
/*! Finalizes the HTML help. This will finish and close the /*! Finalizes the HTML help. This will finish and close the
......
...@@ -87,6 +87,7 @@ class HtmlHelp ...@@ -87,6 +87,7 @@ class HtmlHelp
HtmlHelpIndex *index; HtmlHelpIndex *index;
int dc; int dc;
QStrList indexFiles; QStrList indexFiles;
QDict<void> indexFileDict;
static HtmlHelp *theInstance; static HtmlHelp *theInstance;
}; };
......
...@@ -871,6 +871,8 @@ void writeFileIndex(OutputList &ol) ...@@ -871,6 +871,8 @@ void writeFileIndex(OutputList &ol)
{ {
path=stripFromPath(fd->getPath().copy()); path=stripFromPath(fd->getPath().copy());
} }
QCString fullName=fd->name();
if (!path.isEmpty()) fullName.prepend(path+"/");
// --------------- LaTeX/RTF only ------------------------- // --------------- LaTeX/RTF only -------------------------
if (doc) if (doc)
...@@ -907,11 +909,11 @@ void writeFileIndex(OutputList &ol) ...@@ -907,11 +909,11 @@ void writeFileIndex(OutputList &ol)
ol.writeObjectLink(0,fd->getOutputFileBase(),0,fd->name()); ol.writeObjectLink(0,fd->getOutputFileBase(),0,fd->name());
if (hasHtmlHelp) if (hasHtmlHelp)
{ {
htmlHelp->addContentsItem(FALSE,fd->name(),fd->getOutputFileBase()); htmlHelp->addContentsItem(FALSE,fullName,fd->getOutputFileBase());
} }
if (hasFtvHelp) if (hasFtvHelp)
{ {
ftvHelp->addContentsItem(FALSE,fd->getReference(),fd->getOutputFileBase(),0,fd->name()); ftvHelp->addContentsItem(FALSE,fd->getReference(),fd->getOutputFileBase(),0,fullName);
} }
} }
else else
......
...@@ -606,9 +606,13 @@ void LatexGenerator::endIndexSection(IndexSections is) ...@@ -606,9 +606,13 @@ void LatexGenerator::endIndexSection(IndexSections is)
} }
break; break;
case isMainPage: case isMainPage:
{
QCString indexName="index";
if (Config_getBool("GENERATE_TREEVIEW")) indexName="main";
t << "}\n\\label{index}"; t << "}\n\\label{index}";
if (Config_getBool("PDF_HYPERLINKS")) t << "\\hypertarget{index}{}"; if (Config_getBool("PDF_HYPERLINKS")) t << "\\hypertarget{index}{}";
t << "\\input{index}\n"; t << "\\input{" << indexName << "}\n";
}
break; break;
case isPackageIndex: case isPackageIndex:
t << "}\n\\input{packages}\n"; t << "}\n\\input{packages}\n";
......
...@@ -239,8 +239,12 @@ class LatexGenerator : public OutputGenerator ...@@ -239,8 +239,12 @@ class LatexGenerator : public OutputGenerator
void endMemberDocPrefixItem() {} void endMemberDocPrefixItem() {}
void startMemberDocName() {} void startMemberDocName() {}
void endMemberDocName() {} void endMemberDocName() {}
void startParameter(bool) {} void startParameterType(bool) {}
void endParameter(bool) {} void endParameterType() {}
void startParameterName() {}
void endParameterName(bool,bool) {}
void startParameterList() {}
void endParameterList() {}
void startFontClass(const char *) {} void startFontClass(const char *) {}
void endFontClass() {} void endFontClass() {}
......
...@@ -220,8 +220,12 @@ class ManGenerator : public OutputGenerator ...@@ -220,8 +220,12 @@ class ManGenerator : public OutputGenerator
void endMemberDocPrefixItem() {} void endMemberDocPrefixItem() {}
void startMemberDocName() {} void startMemberDocName() {}
void endMemberDocName() {} void endMemberDocName() {}
void startParameter(bool) {} void startParameterType(bool) {}
void endParameter(bool) {} void endParameterType() {}
void startParameterName() {}
void endParameterName(bool,bool) {}
void startParameterList() {}
void endParameterList() {}
void startFontClass(const char *) {} void startFontClass(const char *) {}
void endFontClass() {} void endFontClass() {}
......
...@@ -75,8 +75,18 @@ static void writeDefArgumentList(OutputList &ol,ClassDef *cd, ...@@ -75,8 +75,18 @@ static void writeDefArgumentList(OutputList &ol,ClassDef *cd,
ArgumentList *argList=md->argumentList(); ArgumentList *argList=md->argumentList();
if (argList==0) return; // member has no function like argument list if (argList==0) return; // member has no function like argument list
if (!md->isDefine()) ol.docify(" "); if (!md->isDefine()) ol.docify(" ");
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
ol.endMemberDocName();
ol.startParameterList();
ol.enableAll();
ol.disable(OutputGenerator::Html);
ol.docify("("); // start argument list ol.docify("("); // start argument list
ol.endMemberDocName(); ol.endMemberDocName();
ol.popGeneratorState();
//printf("===> name=%s isDefine=%d\n",md->name().data(),md->isDefine());
Argument *a=argList->first(); Argument *a=argList->first();
QCString cName; QCString cName;
//if (md->scopeDefTemplateArguments()) //if (md->scopeDefTemplateArguments())
...@@ -106,10 +116,10 @@ static void writeDefArgumentList(OutputList &ol,ClassDef *cd, ...@@ -106,10 +116,10 @@ static void writeDefArgumentList(OutputList &ol,ClassDef *cd,
//printf("~~~ %s cName=%s\n",md->name().data(),cName.data()); //printf("~~~ %s cName=%s\n",md->name().data(),cName.data());
//if (!md->isDefine()) ol.startParameter(TRUE); else ol.docify(" "); //if (!md->isDefine()) ol.startParameter(TRUE); else ol.docify(" ");
ol.startParameter(TRUE);
bool first=TRUE; bool first=TRUE;
while (a) while (a)
{ {
if (!md->isDefine() || first) ol.startParameterType(first);
QRegExp re(")("); QRegExp re(")(");
int vp; int vp;
if (!a->attrib.isEmpty()) // argument has an IDL attribute if (!a->attrib.isEmpty()) // argument has an IDL attribute
...@@ -128,6 +138,11 @@ static void writeDefArgumentList(OutputList &ol,ClassDef *cd, ...@@ -128,6 +138,11 @@ static void writeDefArgumentList(OutputList &ol,ClassDef *cd,
if (!cName.isEmpty()) n=addTemplateNames(n,cd->name(),cName); if (!cName.isEmpty()) n=addTemplateNames(n,cd->name(),cName);
linkifyText(TextGeneratorOLImpl(ol),scopeName,md->name(),n); linkifyText(TextGeneratorOLImpl(ol),scopeName,md->name(),n);
} }
if (!md->isDefine())
{
ol.endParameterType();
ol.startParameterName();
}
if (!a->name.isEmpty()) // argument has a name if (!a->name.isEmpty()) // argument has a name
{ {
ol.docify(" "); ol.docify(" ");
...@@ -146,7 +161,8 @@ static void writeDefArgumentList(OutputList &ol,ClassDef *cd, ...@@ -146,7 +161,8 @@ static void writeDefArgumentList(OutputList &ol,ClassDef *cd,
if (vp!=-1) // write the part of the argument type if (vp!=-1) // write the part of the argument type
// that comes after the name // that comes after the name
{ {
linkifyText(TextGeneratorOLImpl(ol),scopeName,md->name(),a->type.right(a->type.length()-vp)); linkifyText(TextGeneratorOLImpl(ol),scopeName,
md->name(),a->type.right(a->type.length()-vp));
} }
if (!a->defval.isEmpty()) // write the default value if (!a->defval.isEmpty()) // write the default value
{ {
...@@ -161,17 +177,30 @@ static void writeDefArgumentList(OutputList &ol,ClassDef *cd, ...@@ -161,17 +177,30 @@ static void writeDefArgumentList(OutputList &ol,ClassDef *cd,
ol.docify(", "); // there are more arguments ol.docify(", "); // there are more arguments
if (!md->isDefine()) if (!md->isDefine())
{ {
ol.endParameter(first); ol.endParameterName(FALSE,FALSE);
ol.startParameter(FALSE); ol.startParameterType(FALSE);
} }
} }
first=FALSE; first=FALSE;
} }
ol.pushGeneratorState(); ol.pushGeneratorState();
ol.disable(OutputGenerator::Html);
//if (!first) ol.writeString("&nbsp;");
ol.docify(")"); // end argument list
ol.enableAll();
ol.disableAllBut(OutputGenerator::Html); ol.disableAllBut(OutputGenerator::Html);
if (!first) ol.writeString("&nbsp;"); if (!md->isDefine())
{
if (first) ol.startParameterName();
ol.endParameterName(TRUE,argList->count()<2);
}
else
{
ol.endParameterType();
ol.startParameterName();
ol.endParameterName(TRUE,TRUE);
}
ol.popGeneratorState(); ol.popGeneratorState();
ol.docify(")"); // end argument list
if (argList->constSpecifier) if (argList->constSpecifier)
{ {
ol.docify(" const"); ol.docify(" const");
...@@ -250,6 +279,12 @@ MemberDef::MemberDef(const char *df,int dl, ...@@ -250,6 +279,12 @@ MemberDef::MemberDef(const char *df,int dl,
m_defTmpArgLists=0; m_defTmpArgLists=0;
initLines=0; initLines=0;
type=t; type=t;
if (mt==Typedef && type.left(8)=="typedef ") type=type.mid(8);
if (type.left(7)=="struct ") type=type.right(type.length()-7);
if (type.left(6)=="class " ) type=type.right(type.length()-6);
if (type.left(6)=="union " ) type=type.right(type.length()-6);
type=removeRedundantWhiteSpace(type);
args=a; args=a;
args=removeRedundantWhiteSpace(args); args=removeRedundantWhiteSpace(args);
if (type.isEmpty()) decl=name()+args; else decl=type+" "+name()+args; if (type.isEmpty()) decl=name()+args; else decl=type+" "+name()+args;
...@@ -635,6 +670,7 @@ void MemberDef::writeDeclaration(OutputList &ol, ...@@ -635,6 +670,7 @@ void MemberDef::writeDeclaration(OutputList &ol,
} }
QCString ltype(type); QCString ltype(type);
if (mtype==Typedef) ltype.prepend("typedef ");
// strip `static' keyword from ltype // strip `static' keyword from ltype
if (ltype.left(7)=="static ") ltype=ltype.right(ltype.length()-7); if (ltype.left(7)=="static ") ltype=ltype.right(ltype.length()-7);
// strip `friend' keyword from ltype // strip `friend' keyword from ltype
...@@ -1092,7 +1128,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ...@@ -1092,7 +1128,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
ol.docify("]"); ol.docify("]");
ol.endTypewriter(); ol.endTypewriter();
} }
if (!isDefine()) ol.endParameter(TRUE); if (!isDefine() && argList) ol.endParameterList();
ol.endMemberDoc(); ol.endMemberDoc();
ol.endDoxyAnchor(cfname,anchor()); ol.endDoxyAnchor(cfname,anchor());
ol.startIndent(); ol.startIndent();
...@@ -1108,6 +1144,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ...@@ -1108,6 +1144,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
) )
) )
{ {
//printf("md=%s initLines=%d init=`%s'\n",name().data(),initLines,init.data());
ol.startBold(); ol.startBold();
if (mtype==Define) if (mtype==Define)
parseText(ol,theTranslator->trDefineValue()); parseText(ol,theTranslator->trDefineValue());
...@@ -1439,7 +1476,8 @@ bool MemberDef::isLinkableInProject() const ...@@ -1439,7 +1476,8 @@ bool MemberDef::isLinkableInProject() const
((hasDocumentation() && !isReference()) ((hasDocumentation() && !isReference())
) && ) &&
(prot!=Private || Config_getBool("EXTRACT_PRIVATE")) && // not a private class member (prot!=Private || Config_getBool("EXTRACT_PRIVATE")) && // not a private class member
(classDef!=0 || Config_getBool("EXTRACT_STATIC") || !isStatic()); // not a static file/namespace member (classDef!=0 || Config_getBool("EXTRACT_STATIC") ||
!isStatic()); // not a static file/namespace member
} }
bool MemberDef::isLinkable() const bool MemberDef::isLinkable() const
......
...@@ -357,8 +357,12 @@ class OutputGenerator : public BaseOutputDocInterface ...@@ -357,8 +357,12 @@ class OutputGenerator : public BaseOutputDocInterface
virtual void endMemberDocPrefixItem() = 0; virtual void endMemberDocPrefixItem() = 0;
virtual void startMemberDocName() = 0; virtual void startMemberDocName() = 0;
virtual void endMemberDocName() = 0; virtual void endMemberDocName() = 0;
virtual void startParameter(bool) = 0; virtual void startParameterType(bool) = 0;
virtual void endParameter(bool) = 0; virtual void endParameterType() = 0;
virtual void startParameterName() = 0;
virtual void endParameterName(bool,bool) = 0;
virtual void startParameterList() = 0;
virtual void endParameterList() = 0;
protected: protected:
QTextStream fs; QTextStream fs;
......
...@@ -399,10 +399,18 @@ class OutputList : public OutputDocInterface ...@@ -399,10 +399,18 @@ class OutputList : public OutputDocInterface
{ forall(&OutputGenerator::startMemberDocName); } { forall(&OutputGenerator::startMemberDocName); }
void endMemberDocName() void endMemberDocName()
{ forall(&OutputGenerator::endMemberDocName); } { forall(&OutputGenerator::endMemberDocName); }
void startParameter(bool first) void startParameterType(bool first)
{ forall(&OutputGenerator::startParameter,first); } { forall(&OutputGenerator::startParameterType,first); }
void endParameter(bool last) void endParameterType()
{ forall(&OutputGenerator::endParameter,last); } { forall(&OutputGenerator::endParameterType); }
void startParameterName()
{ forall(&OutputGenerator::startParameterName); }
void endParameterName(bool last,bool emptyList)
{ forall(&OutputGenerator::endParameterName,last,emptyList); }
void startParameterList()
{ forall(&OutputGenerator::startParameterList); }
void endParameterList()
{ forall(&OutputGenerator::endParameterList); }
void startFontClass(const char *c) void startFontClass(const char *c)
{ forall(&OutputGenerator::startFontClass,c); } { forall(&OutputGenerator::startFontClass,c); }
......
...@@ -859,7 +859,7 @@ void addDefine() ...@@ -859,7 +859,7 @@ void addDefine()
while ((c=*p++) && (c==' ' || c=='\t')) k++; while ((c=*p++) && (c==' ' || c=='\t')) k++;
g_defLitText=g_defLitText.mid(l+1,k-l-1)+g_defLitText.stripWhiteSpace(); g_defLitText=g_defLitText.mid(l+1,k-l-1)+g_defLitText.stripWhiteSpace();
} }
md->setInitializer(g_defLitText); md->setInitializer(g_defLitText.stripWhiteSpace());
//md->setDefFile(g_yyFileName); //md->setDefFile(g_yyFileName);
//md->setDefLine(g_yyLineNr); //md->setDefLine(g_yyLineNr);
......
...@@ -223,8 +223,12 @@ class RTFGenerator : public OutputGenerator ...@@ -223,8 +223,12 @@ class RTFGenerator : public OutputGenerator
void endMemberDocPrefixItem() {} void endMemberDocPrefixItem() {}
void startMemberDocName() {} void startMemberDocName() {}
void endMemberDocName() {} void endMemberDocName() {}
void startParameter(bool) {} void startParameterType(bool) {}
void endParameter(bool) {} void endParameterType() {}
void startParameterName() {}
void endParameterName(bool,bool) {}
void startParameterList() {}
void endParameterList() {}
void startFontClass(const char *) {} void startFontClass(const char *) {}
void endFontClass() {} void endFontClass() {}
......
...@@ -329,6 +329,7 @@ static void checkDocs() ...@@ -329,6 +329,7 @@ static void checkDocs()
} }
} }
#if 0
static QCString extractName(const QCString &s) static QCString extractName(const QCString &s)
{ {
//static const QRegExp id("[a-z_A-Z][a-z_A-Z0-9]*"); //static const QRegExp id("[a-z_A-Z][a-z_A-Z0-9]*");
...@@ -354,6 +355,7 @@ static QCString extractName(const QCString &s) ...@@ -354,6 +355,7 @@ static QCString extractName(const QCString &s)
) l--; ) l--;
return removeRedundantWhiteSpace(result.left(l+1)); return removeRedundantWhiteSpace(result.left(l+1));
} }
#endif
static void setContext() static void setContext()
{ {
...@@ -1459,16 +1461,18 @@ TITLE [tT][iI][tT][lL][eE] ...@@ -1459,16 +1461,18 @@ TITLE [tT][iI][tT][lL][eE]
current->type=current->type.simplifyWhiteSpace(); current->type=current->type.simplifyWhiteSpace();
current->args=current->args.simplifyWhiteSpace(); current->args=current->args.simplifyWhiteSpace();
current->name=current->name.stripWhiteSpace(); current->name=current->name.stripWhiteSpace();
if (!current->name.isEmpty() && current->type.left(8)=="typedef ") //if (!current->name.isEmpty() && current->type.left(8)=="typedef ")
{ //{
// add typedef to dictionary // // add typedef to dictionary
QCString dest = extractName(current->type.right(current->type.length()-8)); // QCString dest = extractName(current->type.right(current->type.length()-8));
if (Doxygen::typedefDict[current->name]==0 && !dest.isEmpty()) // if (Doxygen::typedefDict[current->name]==0 && !dest.isEmpty())
{ // {
//printf("1>>>>>>>>>> adding %s->%s\n",current->name.data(),dest.data()); // //printf("1>>>>>>>>>> adding %s->%s\n",current->name.data(),dest.data());
Doxygen::typedefDict.insert(current->name, new QCString(dest)); // QCString scope;
} // if (current_root->section & Entry::SCOPE_MASK) scope=current_root->name;
} // Doxygen::typedefDict.insert(current->name, new TypedefInfo(dest,scope));
// }
//}
current->section = Entry::VARIABLE_SEC ; current->section = Entry::VARIABLE_SEC ;
current->fileName = yyFileName; current->fileName = yyFileName;
current->startLine = yyLineNr; current->startLine = yyLineNr;
...@@ -1714,16 +1718,18 @@ TITLE [tT][iI][tT][lL][eE] ...@@ -1714,16 +1718,18 @@ TITLE [tT][iI][tT][lL][eE]
//if (!current->name.isEmpty() && current->name[0]!='@' && //if (!current->name.isEmpty() && current->name[0]!='@' &&
// current->parent->section & Entry::COMPOUND_MASK) // current->parent->section & Entry::COMPOUND_MASK)
// varEntry->type+=current->parent->name+"::"; // varEntry->type+=current->parent->name+"::";
if (isTypedef) //if (isTypedef)
{ //{
varEntry->type.prepend("typedef "); // varEntry->type.prepend("typedef ");
//printf("current->name = %s %s\n",current->name.data(),msName.data()); // //printf("current->name = %s %s\n",current->name.data(),msName.data());
if (!current->name.isEmpty() && current->name.at(0)!='@') // if (!current->name.isEmpty() && current->name.at(0)!='@')
{ // {
//printf("2>>>>>>>>>> adding %s->%s\n",msName.data(),current->name.data()); // //printf("2>>>>>>>>>> adding %s->%s\n",msName.data(),current->name.data());
Doxygen::typedefDict.insert(msName,new QCString(current->name)); // QCString scope;
} // if (current_root->section & Entry::SCOPE_MASK) scope=current_root->name;
} // Doxygen::typedefDict.insert(msName,new TypedefInfo(current->name,scope));
// }
//}
varEntry->type+=current->name+msType; varEntry->type+=current->name+msType;
varEntry->fileName = yyFileName; varEntry->fileName = yyFileName;
varEntry->startLine = yyLineNr; varEntry->startLine = yyLineNr;
...@@ -2397,15 +2403,17 @@ TITLE [tT][iI][tT][lL][eE] ...@@ -2397,15 +2403,17 @@ TITLE [tT][iI][tT][lL][eE]
} }
else else
{ {
if (isTypedef) //if (isTypedef)
{ //{
//QCString dest = extractName(current->name); // //QCString dest = extractName(current->name);
//printf("3>>>>>>>>>> adding %s->%s\n",yytext,current->name.data()); // //printf("3>>>>>>>>>> adding %s->%s\n",yytext,current->name.data());
Doxygen::typedefDict.insert(yytext,new QCString(current->name)); // QCString scope;
//current->extends->append( // if (current_root->section & Entry::SCOPE_MASK) scope=current_root->name;
// new BaseInfo(yytext,Public,Normal) // Doxygen::typedefDict.insert(yytext,new TypedefInfo(current->name,scope));
// ); // //current->extends->append(
} // // new BaseInfo(yytext,Public,Normal)
// // );
//}
current->type += ' ' ; current->type += ' ' ;
current->type += current->name ; current->type += current->name ;
current->name = yytext ; current->name = yytext ;
......
...@@ -53,353 +53,125 @@ class Translator ...@@ -53,353 +53,125 @@ class Translator
*/ */
virtual QCString updateNeededMessage() { return ""; } virtual QCString updateNeededMessage() { return ""; }
// Please, have a look at comments inside the translator_en.h file
// to learn the meaning of the following methods. The translator_en.h
// file contains the TranslatorEnglish implementation, which is
// always up-to-date (by definition).
// --- Language control methods ------------------- // --- Language control methods -------------------
/*! Used for identification of the language.
* See the comment for the translator_en.h method implementation
* for details.
*/
virtual QCString idLanguage() = 0; virtual QCString idLanguage() = 0;
/*! Used to get the command(s) for the language support.
* See the comment for the translator_en.h method implementation
* for details.
*/
virtual QCString latexLanguageSupportCommand() = 0; virtual QCString latexLanguageSupportCommand() = 0;
/*! return the language charset. This will be used for the HTML output */
virtual QCString idLanguageCharset() = 0; virtual QCString idLanguageCharset() = 0;
// --- Language translation methods ------------------- // --- Language translation methods -------------------
/*! used in the compound documentation before a list of related functions. */
virtual QCString trRelatedFunctions() = 0; virtual QCString trRelatedFunctions() = 0;
/*! subscript for the related functions. */
virtual QCString trRelatedSubscript() = 0; virtual QCString trRelatedSubscript() = 0;
/*! header that is put before the detailed description of files, classes and namespaces. */
virtual QCString trDetailedDescription() = 0; virtual QCString trDetailedDescription() = 0;
/*! header that is put before the list of typedefs. */
virtual QCString trMemberTypedefDocumentation() = 0; virtual QCString trMemberTypedefDocumentation() = 0;
/*! header that is put before the list of enumerations. */
virtual QCString trMemberEnumerationDocumentation() = 0; virtual QCString trMemberEnumerationDocumentation() = 0;
/*! header that is put before the list of member functions. */
virtual QCString trMemberFunctionDocumentation() = 0; virtual QCString trMemberFunctionDocumentation() = 0;
/*! header that is put before the list of member attributes. */
virtual QCString trMemberDataDocumentation() = 0; virtual QCString trMemberDataDocumentation() = 0;
/*! this is the text of a link put after brief descriptions. */
virtual QCString trMore() = 0; virtual QCString trMore() = 0;
/*! put in the class documentation */
virtual QCString trListOfAllMembers() = 0; virtual QCString trListOfAllMembers() = 0;
/*! used as the title of the "list of all members" page of a class */
virtual QCString trMemberList() = 0; virtual QCString trMemberList() = 0;
/*! this is the first part of a sentence that is followed by a class name */
virtual QCString trThisIsTheListOfAllMembers() = 0; virtual QCString trThisIsTheListOfAllMembers() = 0;
/*! this is the remainder of the sentence after the class name */
virtual QCString trIncludingInheritedMembers() = 0; virtual QCString trIncludingInheritedMembers() = 0;
/*! this is put at the author sections at the bottom of man pages.
* parameter s is name of the project name.
*/
virtual QCString trGeneratedAutomatically(const char *s) = 0; virtual QCString trGeneratedAutomatically(const char *s) = 0;
virtual QCString trEnumName() = 0; virtual QCString trEnumName() = 0;
/*! put after an enum value in the list of all members */
virtual QCString trEnumValue() = 0; virtual QCString trEnumValue() = 0;
/*! put after an undocumented member in the list of all members */
virtual QCString trDefinedIn() = 0; virtual QCString trDefinedIn() = 0;
// quick reference sections // quick reference sections
/*! This is put above each page as a link to the list of all groups of
* compounds or files (see the \\group command).
*/
virtual QCString trModules() = 0; virtual QCString trModules() = 0;
/*! This is put above each page as a link to the class hierarchy */
virtual QCString trClassHierarchy() = 0; virtual QCString trClassHierarchy() = 0;
/*! This is put above each page as a link to the list of annotated classes */
virtual QCString trCompoundList() = 0; virtual QCString trCompoundList() = 0;
/*! This is put above each page as a link to the list of documented files */
virtual QCString trFileList() = 0; virtual QCString trFileList() = 0;
/*! This is put above each page as a link to the list of all verbatim headers */
virtual QCString trHeaderFiles() = 0; virtual QCString trHeaderFiles() = 0;
/*! This is put above each page as a link to all members of compounds. */
virtual QCString trCompoundMembers() = 0; virtual QCString trCompoundMembers() = 0;
/*! This is put above each page as a link to all members of files. */
virtual QCString trFileMembers() = 0; virtual QCString trFileMembers() = 0;
/*! This is put above each page as a link to all related pages. */
virtual QCString trRelatedPages() = 0; virtual QCString trRelatedPages() = 0;
/*! This is put above each page as a link to all examples. */
virtual QCString trExamples() = 0; virtual QCString trExamples() = 0;
/*! This is put above each page as a link to the search engine. */
virtual QCString trSearch() = 0; virtual QCString trSearch() = 0;
/*! This is an introduction to the class hierarchy. */
virtual QCString trClassHierarchyDescription() = 0; virtual QCString trClassHierarchyDescription() = 0;
/*! This is an introduction to the list with all files. */
virtual QCString trFileListDescription(bool extractAll) = 0; virtual QCString trFileListDescription(bool extractAll) = 0;
/*! This is an introduction to the annotated compound list. */
virtual QCString trCompoundListDescription() = 0; virtual QCString trCompoundListDescription() = 0;
/*! This is an introduction to the page with all class members. */
virtual QCString trCompoundMembersDescription(bool extractAll) = 0; virtual QCString trCompoundMembersDescription(bool extractAll) = 0;
/*! This is an introduction to the page with all file members. */
virtual QCString trFileMembersDescription(bool extractAll) = 0; virtual QCString trFileMembersDescription(bool extractAll) = 0;
/*! This is an introduction to the page with the list of all header files. */
virtual QCString trHeaderFilesDescription() = 0; virtual QCString trHeaderFilesDescription() = 0;
/*! This is an introduction to the page with the list of all examples */
virtual QCString trExamplesDescription() = 0; virtual QCString trExamplesDescription() = 0;
/*! This is an introduction to the page with the list of related pages */
virtual QCString trRelatedPagesDescription() = 0; virtual QCString trRelatedPagesDescription() = 0;
/*! This is an introduction to the page with the list of class/file groups */
virtual QCString trModulesDescription() = 0; virtual QCString trModulesDescription() = 0;
/*! This sentences is used in the annotated class/file lists if no brief
* description is given.
*/
virtual QCString trNoDescriptionAvailable() = 0; virtual QCString trNoDescriptionAvailable() = 0;
// index titles (the project name is prepended for these) // index titles (the project name is prepended for these)
/*! This is used in HTML as the title of index.html. */
virtual QCString trDocumentation() = 0; virtual QCString trDocumentation() = 0;
/*! This is used in LaTeX as the title of the chapter with the
* index of all groups.
*/
virtual QCString trModuleIndex() = 0; virtual QCString trModuleIndex() = 0;
/*! This is used in LaTeX as the title of the chapter with the
* class hierarchy.
*/
virtual QCString trHierarchicalIndex() = 0; virtual QCString trHierarchicalIndex() = 0;
/*! This is used in LaTeX as the title of the chapter with the
* annotated compound index.
*/
virtual QCString trCompoundIndex() = 0; virtual QCString trCompoundIndex() = 0;
/*! This is used in LaTeX as the title of the chapter with the
* list of all files.
*/
virtual QCString trFileIndex() = 0; virtual QCString trFileIndex() = 0;
/*! This is used in LaTeX as the title of the chapter containing
* the documentation of all groups.
*/
virtual QCString trModuleDocumentation() = 0; virtual QCString trModuleDocumentation() = 0;
/*! This is used in LaTeX as the title of the chapter containing
* the documentation of all classes, structs and unions.
*/
virtual QCString trClassDocumentation() = 0; virtual QCString trClassDocumentation() = 0;
/*! This is used in LaTeX as the title of the chapter containing
* the documentation of all files.
*/
virtual QCString trFileDocumentation() = 0; virtual QCString trFileDocumentation() = 0;
/*! This is used in LaTeX as the title of the chapter containing
* the documentation of all examples.
*/
virtual QCString trExampleDocumentation() = 0; virtual QCString trExampleDocumentation() = 0;
/*! This is used in LaTeX as the title of the chapter containing
* the documentation of all related pages.
*/
virtual QCString trPageDocumentation() = 0; virtual QCString trPageDocumentation() = 0;
/*! This is used in LaTeX as the title of the document */
virtual QCString trReferenceManual() = 0; virtual QCString trReferenceManual() = 0;
/*! This is used in the documentation of a file as a header before the
* list of defines
*/
virtual QCString trDefines() = 0; virtual QCString trDefines() = 0;
/*! This is used in the documentation of a file as a header before the
* list of function prototypes
*/
virtual QCString trFuncProtos() = 0; virtual QCString trFuncProtos() = 0;
/*! This is used in the documentation of a file as a header before the
* list of typedefs
*/
virtual QCString trTypedefs() = 0; virtual QCString trTypedefs() = 0;
/*! This is used in the documentation of a file as a header before the
* list of enumerations
*/
virtual QCString trEnumerations() = 0; virtual QCString trEnumerations() = 0;
/*! This is used in the documentation of a file as a header before the
* list of (global) functions
*/
virtual QCString trFunctions() = 0; virtual QCString trFunctions() = 0;
/*! This is used in the documentation of a file as a header before the
* list of (global) variables
*/
virtual QCString trVariables() = 0; virtual QCString trVariables() = 0;
/*! This is used in the documentation of a file as a header before the
* list of (global) variables
*/
virtual QCString trEnumerationValues() = 0; virtual QCString trEnumerationValues() = 0;
/*! This is used in the documentation of a file before the list of
* documentation blocks for defines
*/
virtual QCString trDefineDocumentation() = 0; virtual QCString trDefineDocumentation() = 0;
/*! This is used in the documentation of a file/namespace before the list
* of documentation blocks for function prototypes
*/
virtual QCString trFunctionPrototypeDocumentation() = 0; virtual QCString trFunctionPrototypeDocumentation() = 0;
/*! This is used in the documentation of a file/namespace before the list
* of documentation blocks for typedefs
*/
virtual QCString trTypedefDocumentation() = 0; virtual QCString trTypedefDocumentation() = 0;
/*! This is used in the documentation of a file/namespace before the list
* of documentation blocks for enumeration types
*/
virtual QCString trEnumerationTypeDocumentation() = 0; virtual QCString trEnumerationTypeDocumentation() = 0;
/*! This is used in the documentation of a file/namespace before the list
* of documentation blocks for enumeration values
*/
virtual QCString trEnumerationValueDocumentation() = 0; virtual QCString trEnumerationValueDocumentation() = 0;
/*! This is used in the documentation of a file/namespace before the list
* of documentation blocks for functions
*/
virtual QCString trFunctionDocumentation() = 0; virtual QCString trFunctionDocumentation() = 0;
/*! This is used in the documentation of a file/namespace before the list
* of documentation blocks for variables
*/
virtual QCString trVariableDocumentation() = 0; virtual QCString trVariableDocumentation() = 0;
/*! This is used in the documentation of a file/namespace/group before
* the list of links to documented compounds
*/
virtual QCString trCompounds() = 0; virtual QCString trCompounds() = 0;
/*! This is used in the standard footer of each page and indicates when
* the page was generated
*/
virtual QCString trGeneratedAt(const char *date,const char *projName) = 0; virtual QCString trGeneratedAt(const char *date,const char *projName) = 0;
/*! This is part of the sentence used in the standard footer of each page.
*/
virtual QCString trWrittenBy() = 0; virtual QCString trWrittenBy() = 0;
/*! this text is put before a class diagram */
virtual QCString trClassDiagram(const char *clName) = 0; virtual QCString trClassDiagram(const char *clName) = 0;
/*! this text is generated when the \\internal command is used. */
virtual QCString trForInternalUseOnly() = 0; virtual QCString trForInternalUseOnly() = 0;
/*! this text is generated when the \\reimp command is used. */
virtual QCString trReimplementedForInternalReasons() = 0; virtual QCString trReimplementedForInternalReasons() = 0;
/*! this text is generated when the \\warning command is used. */
virtual QCString trWarning() = 0; virtual QCString trWarning() = 0;
/*! this text is generated when the \\bug command is used. */
virtual QCString trBugsAndLimitations() = 0; virtual QCString trBugsAndLimitations() = 0;
/*! this text is generated when the \\version command is used. */
virtual QCString trVersion() = 0; virtual QCString trVersion() = 0;
/*! this text is generated when the \\date command is used. */
virtual QCString trDate() = 0; virtual QCString trDate() = 0;
/*! this text is generated when the \\return command is used. */
virtual QCString trReturns() = 0; virtual QCString trReturns() = 0;
/*! this text is generated when the \\sa command is used. */
virtual QCString trSeeAlso() = 0; virtual QCString trSeeAlso() = 0;
/*! this text is generated when the \\param command is used. */
virtual QCString trParameters() = 0; virtual QCString trParameters() = 0;
/*! this text is generated when the \\exception command is used. */
virtual QCString trExceptions() = 0; virtual QCString trExceptions() = 0;
/*! this text is used in the title page of a LaTeX document. */
virtual QCString trGeneratedBy() = 0; virtual QCString trGeneratedBy() = 0;
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// new since 0.49-990307 // new since 0.49-990307
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/*! used as the title of page containing all the index of all namespaces. */
virtual QCString trNamespaceList() = 0; virtual QCString trNamespaceList() = 0;
/*! used as an introduction to the namespace list */
virtual QCString trNamespaceListDescription(bool extractAll) = 0; virtual QCString trNamespaceListDescription(bool extractAll) = 0;
/*! used in the class documentation as a header before the list of all
* friends of a class
*/
virtual QCString trFriends() = 0; virtual QCString trFriends() = 0;
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// new since 0.49-990405 // new since 0.49-990405
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/*! used in the class documentation as a header before the list of all
* related classes
*/
virtual QCString trRelatedFunctionDocumentation() = 0; virtual QCString trRelatedFunctionDocumentation() = 0;
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// new since 0.49-990425 // new since 0.49-990425
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/*! used as the title of the HTML page of a class/struct/union */
virtual QCString trCompoundReference(const char *clName, virtual QCString trCompoundReference(const char *clName,
ClassDef::CompoundType compType, ClassDef::CompoundType compType,
bool isTemplate) = 0; bool isTemplate) = 0;
/*! used as the title of the HTML page of a file */
virtual QCString trFileReference(const char *fileName) = 0; virtual QCString trFileReference(const char *fileName) = 0;
/*! used as the title of the HTML page of a namespace */
virtual QCString trNamespaceReference(const char *namespaceName) = 0; virtual QCString trNamespaceReference(const char *namespaceName) = 0;
virtual QCString trPublicMembers() = 0; virtual QCString trPublicMembers() = 0;
...@@ -412,86 +184,36 @@ class Translator ...@@ -412,86 +184,36 @@ class Translator
virtual QCString trPrivateMembers() = 0; virtual QCString trPrivateMembers() = 0;
virtual QCString trPrivateSlots() = 0; virtual QCString trPrivateSlots() = 0;
virtual QCString trStaticPrivateMembers() = 0; virtual QCString trStaticPrivateMembers() = 0;
/*! this function is used to produce a comma-separated list of items.
* Use generateMarker(i) to indicate where item i should be put.
*/
virtual QCString trWriteList(int numEntries) = 0; virtual QCString trWriteList(int numEntries) = 0;
/*! used in class documentation to produce a list of base classes,
* if class diagrams are disabled.
*/
virtual QCString trInheritsList(int numEntries) = 0; virtual QCString trInheritsList(int numEntries) = 0;
/*! used in class documentation to produce a list of super classes,
* if class diagrams are disabled.
*/
virtual QCString trInheritedByList(int numEntries) = 0; virtual QCString trInheritedByList(int numEntries) = 0;
/*! used in member documentation blocks to produce a list of
* members that are hidden by this one.
*/
virtual QCString trReimplementedFromList(int numEntries) = 0; virtual QCString trReimplementedFromList(int numEntries) = 0;
/*! used in member documentation blocks to produce a list of
* all member that overwrite the implementation of this member.
*/
virtual QCString trReimplementedInList(int numEntries) = 0; virtual QCString trReimplementedInList(int numEntries) = 0;
/*! This is put above each page as a link to all members of namespaces. */
virtual QCString trNamespaceMembers() = 0; virtual QCString trNamespaceMembers() = 0;
/*! This is an introduction to the page with all namespace members */
virtual QCString trNamespaceMemberDescription(bool extractAll) = 0; virtual QCString trNamespaceMemberDescription(bool extractAll) = 0;
/*! This is used in LaTeX as the title of the chapter with the
* index of all namespaces.
*/
virtual QCString trNamespaceIndex() = 0; virtual QCString trNamespaceIndex() = 0;
/*! This is used in LaTeX as the title of the chapter containing
* the documentation of all namespaces.
*/
virtual QCString trNamespaceDocumentation() = 0; virtual QCString trNamespaceDocumentation() = 0;
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// new since 0.49-990522 // new since 0.49-990522
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/*! This is used in the documentation before the list of all
* namespaces in a file.
*/
virtual QCString trNamespaces() = 0; virtual QCString trNamespaces() = 0;
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// new since 0.49-990728 // new since 0.49-990728
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/*! This is put at the bottom of a class documentation page and is
* followed by a list of files that were used to generate the page.
*/
virtual QCString trGeneratedFromFiles(ClassDef::CompoundType compType, virtual QCString trGeneratedFromFiles(ClassDef::CompoundType compType,
bool single) = 0; bool single) = 0;
/*! This is in the (quick) index as a link to the alphabetical compound
* list.
*/
virtual QCString trAlphabeticalList() = 0; virtual QCString trAlphabeticalList() = 0;
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// new since 0.49-990901 // new since 0.49-990901
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/*! This is used as the heading text for the retval command. */
virtual QCString trReturnValues() = 0; virtual QCString trReturnValues() = 0;
/*! This is in the (quick) index as a link to the main page (index.html)
*/
virtual QCString trMainPage() = 0; virtual QCString trMainPage() = 0;
/*! This is used in references to page that are put in the LaTeX
* documentation. It should be an abbreviation of the word page.
*/
virtual QCString trPageAbbreviation() = 0; virtual QCString trPageAbbreviation() = 0;
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
...@@ -499,9 +221,7 @@ class Translator ...@@ -499,9 +221,7 @@ class Translator
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
virtual QCString trSources() = 0; virtual QCString trSources() = 0;
virtual QCString trDefinedAtLineInSourceFile() = 0; virtual QCString trDefinedAtLineInSourceFile() = 0;
virtual QCString trDefinedInSourceFile() = 0; virtual QCString trDefinedInSourceFile() = 0;
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
...@@ -514,34 +234,15 @@ class Translator ...@@ -514,34 +234,15 @@ class Translator
// new since 1.0.0 // new since 1.0.0
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/*! this text is put before a collaboration diagram */
virtual QCString trCollaborationDiagram(const char *clName) = 0; virtual QCString trCollaborationDiagram(const char *clName) = 0;
/*! this text is put before an include dependency graph */
virtual QCString trInclDepGraph(const char *fName) = 0; virtual QCString trInclDepGraph(const char *fName) = 0;
/*! header that is put before the list of constructor/destructors. */
virtual QCString trConstructorDocumentation() = 0; virtual QCString trConstructorDocumentation() = 0;
/*! Used in the file documentation to point to the corresponding sources. */
virtual QCString trGotoSourceCode() = 0; virtual QCString trGotoSourceCode() = 0;
/*! Used in the file sources to point to the corresponding documentation. */
virtual QCString trGotoDocumentation() = 0; virtual QCString trGotoDocumentation() = 0;
/*! Text for the \\pre command */
virtual QCString trPrecondition() = 0; virtual QCString trPrecondition() = 0;
/*! Text for the \\post command */
virtual QCString trPostcondition() = 0; virtual QCString trPostcondition() = 0;
/*! Text for the \\invariant command */
virtual QCString trInvariant() = 0; virtual QCString trInvariant() = 0;
/*! Text shown before a multi-line variable/enum initialization */
virtual QCString trInitialValue() = 0; virtual QCString trInitialValue() = 0;
/*! Text used the source code in the file index */
virtual QCString trCode() = 0; virtual QCString trCode() = 0;
virtual QCString trGraphicalHierarchy() = 0; virtual QCString trGraphicalHierarchy() = 0;
...@@ -568,10 +269,7 @@ class Translator ...@@ -568,10 +269,7 @@ class Translator
// new since 1.1.3 // new since 1.1.3
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/*! Used as a marker that is put before a \\todo item */
virtual QCString trTodo() = 0; virtual QCString trTodo() = 0;
/*! Used as the header of the todo list */
virtual QCString trTodoList() = 0; virtual QCString trTodoList() = 0;
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
...@@ -588,97 +286,60 @@ class Translator ...@@ -588,97 +286,60 @@ class Translator
// new since 1.1.5 // new since 1.1.5
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/*! title of the graph legend page */
virtual QCString trLegendTitle() = 0; virtual QCString trLegendTitle() = 0;
/*! page explaining how the dot graph's should be interpreted */
virtual QCString trLegendDocs() = 0; virtual QCString trLegendDocs() = 0;
/*! text for the link to the legend page */
virtual QCString trLegend() = 0; virtual QCString trLegend() = 0;
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// new since 1.2.0 // new since 1.2.0
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/*! Used as a marker that is put before a test item */
virtual QCString trTest() = 0; virtual QCString trTest() = 0;
/*! Used as the header of the test list */
virtual QCString trTestList() = 0; virtual QCString trTestList() = 0;
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// new since 1.2.1 // new since 1.2.1
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/*! Used as a section header for KDE-2 IDL methods */
virtual QCString trDCOPMethods() = 0; virtual QCString trDCOPMethods() = 0;
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// new since 1.2.2 // new since 1.2.2
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/*! Used as a section header for IDL properties */
virtual QCString trProperties() = 0; virtual QCString trProperties() = 0;
/*! Used as a section header for IDL property documentation */
virtual QCString trPropertyDocumentation() = 0; virtual QCString trPropertyDocumentation() = 0;
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// new since 1.2.4 // new since 1.2.4
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/*! Used for Java interfaces in the summary section of Java packages */
virtual QCString trInterfaces() = 0; virtual QCString trInterfaces() = 0;
/*! Used for Java classes in the summary section of Java packages */
virtual QCString trClasses() = 0; virtual QCString trClasses() = 0;
/*! Used as the title of a Java package */
virtual QCString trPackage(const char *name) = 0; virtual QCString trPackage(const char *name) = 0;
/*! Title of the package index page */
virtual QCString trPackageList() = 0; virtual QCString trPackageList() = 0;
/*! The description of the package index page */
virtual QCString trPackageListDescription() = 0; virtual QCString trPackageListDescription() = 0;
/*! The link name in the Quick links header for each page */
virtual QCString trPackages() = 0; virtual QCString trPackages() = 0;
/*! Used as a chapter title for Latex & RTF output */
virtual QCString trPackageDocumentation() = 0; virtual QCString trPackageDocumentation() = 0;
/*! Text shown before a multi-line define */
virtual QCString trDefineValue() = 0; virtual QCString trDefineValue() = 0;
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// new since 1.2.5 // new since 1.2.5
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/*! Used as a marker that is put before a \\bug item */
virtual QCString trBug() = 0; virtual QCString trBug() = 0;
/*! Used as the header of the bug list */
virtual QCString trBugList() = 0; virtual QCString trBugList() = 0;
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// new since 1.2.6 // new since 1.2.6
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/*! Used as ansicpg for RTF file */
virtual QCString trRTFansicp() = 0; virtual QCString trRTFansicp() = 0;
/*! Used as ansicpg for RTF fcharset */
virtual QCString trRTFCharSet() = 0; virtual QCString trRTFCharSet() = 0;
/*! Used as header RTF general index */
virtual QCString trRTFGeneralIndex() = 0; virtual QCString trRTFGeneralIndex() = 0;
/*! The following are used for translation of the word that will // Translation of the word
* possibly be followed by a single name or by a list of names
* of the category.
*/
virtual QCString trClass(bool first_capital, bool singular) = 0; virtual QCString trClass(bool first_capital, bool singular) = 0;
virtual QCString trFile(bool first_capital, bool singular) = 0; virtual QCString trFile(bool first_capital, bool singular) = 0;
virtual QCString trNamespace(bool first_capital, bool singular) = 0; virtual QCString trNamespace(bool first_capital, bool singular) = 0;
...@@ -688,14 +349,10 @@ class Translator ...@@ -688,14 +349,10 @@ class Translator
virtual QCString trField(bool first_capital, bool singular) = 0; virtual QCString trField(bool first_capital, bool singular) = 0;
virtual QCString trGlobal(bool first_capital, bool singular) = 0; virtual QCString trGlobal(bool first_capital, bool singular) = 0;
//////////////////////////////////////////////////////////////////////////
// new since 1.2.7
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
// new since 1.2.7
//////////////////////////////////////////////////////////////////////////
/*! This text is generated when the \\author command is used and
* for the author section in man pages.
*/
virtual QCString trAuthor(bool first_capital, bool singular) = 0; virtual QCString trAuthor(bool first_capital, bool singular) = 0;
}; };
......
...@@ -12,9 +12,8 @@ ...@@ -12,9 +12,8 @@
* *
* Brazilian Portuguese version by * Brazilian Portuguese version by
* Fabio "FJTC" Jun Takada Chino <chino@grad.icmc.sc.usp.br> * Fabio "FJTC" Jun Takada Chino <chino@grad.icmc.sc.usp.br>
* Version: 1.2.6.1 (2001/04/13) * Version: 1.2.8.2 (2001/07/24)
*/ */
#ifndef TRANSLATOR_BR_H #ifndef TRANSLATOR_BR_H
#define TRANSLATOR_BR_H #define TRANSLATOR_BR_H
...@@ -33,8 +32,9 @@ class TranslatorBrazilian: public Translator ...@@ -33,8 +32,9 @@ class TranslatorBrazilian: public Translator
*/ */
virtual QCString idLanguage() virtual QCString idLanguage()
{ {
/* I'm not sure if it is correct. I did not found the documentation
of BabelPackage. If you know the right string, please contact me. */
return "portuges"; return "portuges";
/* I'm not sure if it is correct. I did not found the documentation of BabelPackage*/
} }
/*! Used to get the command(s) for the language support. This method /*! Used to get the command(s) for the language support. This method
...@@ -47,10 +47,6 @@ class TranslatorBrazilian: public Translator ...@@ -47,10 +47,6 @@ class TranslatorBrazilian: public Translator
return "Brazilian"; return "Brazilian";
} }
/*! returns the name of the package that is included by LaTeX */
virtual QCString latexBabelPackage()
{ return ""; }
/*! return the language charset. This will be used for the HTML output */ /*! return the language charset. This will be used for the HTML output */
virtual QCString idLanguageCharset() virtual QCString idLanguageCharset()
{ {
...@@ -138,12 +134,6 @@ class TranslatorBrazilian: public Translator ...@@ -138,12 +134,6 @@ class TranslatorBrazilian: public Translator
virtual QCString trDefinedIn() virtual QCString trDefinedIn()
{ return "definida em"; } { return "definida em"; }
/*! put as in introduction in the verbatim header file of a class.
* parameter f is the name of the include file.
*/
virtual QCString trVerbatimText(const char *f)
{ return (QCString)"Este é o texto original do arquivo "+f+"."; }
// quick reference sections // quick reference sections
/*! This is put above each page as a link to the list of all groups of /*! This is put above each page as a link to the list of all groups of
...@@ -417,10 +407,6 @@ class TranslatorBrazilian: public Translator ...@@ -417,10 +407,6 @@ class TranslatorBrazilian: public Translator
virtual QCString trEnumerationValues() virtual QCString trEnumerationValues()
{ return "Valores Enumerados"; } { return "Valores Enumerados"; }
/*! This is used in man pages as the author section. */
virtual QCString trAuthor()
{ return "Autor"; }
/*! This is used in the documentation of a file before the list of /*! This is used in the documentation of a file before the list of
* documentation blocks for defines * documentation blocks for defines
*/ */
...@@ -478,12 +464,6 @@ class TranslatorBrazilian: public Translator ...@@ -478,12 +464,6 @@ class TranslatorBrazilian: public Translator
} }
} }
/*! This is used in the documentation of a group before the list of
* links to documented files
*/
virtual QCString trFiles()
{ return "Arquivos"; }
/*! This is used in the standard footer of each page and indicates when /*! This is used in the standard footer of each page and indicates when
* the page was generated * the page was generated
*/ */
...@@ -531,10 +511,6 @@ class TranslatorBrazilian: public Translator ...@@ -531,10 +511,6 @@ class TranslatorBrazilian: public Translator
virtual QCString trDate() virtual QCString trDate()
{ return "Data"; } { return "Data"; }
/*! this text is generated when the \\author command is used. */
virtual QCString trAuthors()
{ return "Autor(es)"; }
/*! this text is generated when the \\return command is used. */ /*! this text is generated when the \\return command is used. */
virtual QCString trReturns() virtual QCString trReturns()
{ return "Retorna"; } { return "Retorna"; }
...@@ -1322,6 +1298,5 @@ and ...@@ -1322,6 +1298,5 @@ and
if (!singular) result+="es"; if (!singular) result+="es";
return result; return result;
} }
}; };
#endif #endif
...@@ -49,6 +49,9 @@ ...@@ -49,6 +49,9 @@
// - Update for "new since 1.2.7-20010524" version: // - Update for "new since 1.2.7-20010524" version:
// removed trAuthors(), trAuthor(), added trAuthor(bool, bool) // removed trAuthors(), trAuthor(), added trAuthor(bool, bool)
// //
// 2001/07/24 Jens Seidel (jensseidel@users.sourceforge.net)
// - trClassDocumentation() updated as in the English translator.
//
// Todo: // Todo:
// - translation of all Config_getBool("OPTIMIZE_OUTPUT_FOR_C") // - translation of all Config_getBool("OPTIMIZE_OUTPUT_FOR_C")
// strings (see translator_en.h) // strings (see translator_en.h)
...@@ -334,7 +337,12 @@ class TranslatorGerman : public Translator ...@@ -334,7 +337,12 @@ class TranslatorGerman : public Translator
* the documentation of all classes, structs and unions. * the documentation of all classes, structs and unions.
*/ */
virtual QCString trClassDocumentation() virtual QCString trClassDocumentation()
{ return "Klassen-Dokumentation"; } {
if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C"))
return "Datenstruktur-Dokumentation";
else
return "Klassen-Dokumentation";
}
/* This is used in LaTeX as the title of the chapter containing /* This is used in LaTeX as the title of the chapter containing
* the documentation of all files. * the documentation of all files.
...@@ -990,7 +998,8 @@ class TranslatorGerman : public Translator ...@@ -990,7 +998,8 @@ class TranslatorGerman : public Translator
return "Erklärung des Graphen"; return "Erklärung des Graphen";
} }
/* page explaining how the dot graph's should be interpreted */ /* page explaining how the dot graph's should be interpreted
The %A in the text below are to prevent link to classes called "A". */
virtual QCString trLegendDocs() virtual QCString trLegendDocs()
{ {
return return
......
...@@ -1092,6 +1092,7 @@ class TranslatorSpanish : public TranslatorAdapter_1_2_7 ...@@ -1092,6 +1092,7 @@ class TranslatorSpanish : public TranslatorAdapter_1_2_7
/*! Used as ansicpg for RTF file /*! Used as ansicpg for RTF file
* *
* The following table shows the correlation of Charset name, Charset Value and * The following table shows the correlation of Charset name, Charset Value and
* <pre>
* Codepage number: * Codepage number:
* Charset Name Charset Value(hex) Codepage number * Charset Name Charset Value(hex) Codepage number
* ------------------------------------------------------ * ------------------------------------------------------
...@@ -1110,6 +1111,7 @@ class TranslatorSpanish : public TranslatorAdapter_1_2_7 ...@@ -1110,6 +1111,7 @@ class TranslatorSpanish : public TranslatorAdapter_1_2_7
* HANGEUL_CHARSET 129 (x81) 949 * HANGEUL_CHARSET 129 (x81) 949
* GB2313_CHARSET 134 (x86) 936 * GB2313_CHARSET 134 (x86) 936
* CHINESEBIG5_CHARSET 136 (x88) 950 * CHINESEBIG5_CHARSET 136 (x88) 950
* </pre>
* *
*/ */
virtual QCString trRTFansicp() virtual QCString trRTFansicp()
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
* The translation into French was provided by * The translation into French was provided by
* Christophe Bordeux (bordeux@lig.di.epfl.ch) * Christophe Bordeux (bordeux@lig.di.epfl.ch)
* and after version 1.2.0 by Xavier Outhier (xouthier@yahoo.fr) * and after version 1.2.0 by Xavier Outhier (xouthier@yahoo.fr)
* member of of the non for profit association D2SET (http://www.d2set.org, * member of the non for profit association D2SET (http://www.d2set.org,
* d2set@d2set.org). * d2set@d2set.org).
*/ */
......
...@@ -34,7 +34,7 @@ class TranslatorSlovak : public TranslatorAdapter_1_2_7 ...@@ -34,7 +34,7 @@ class TranslatorSlovak : public TranslatorAdapter_1_2_7
} }
public: public:
// --- Language contol methods ------------------- // --- Language control methods -------------------
virtual QCString idLanguage() virtual QCString idLanguage()
{ return "slovak"; } { return "slovak"; }
......
...@@ -332,6 +332,77 @@ int guessSection(const char *name) ...@@ -332,6 +332,77 @@ int guessSection(const char *name)
return 0; return 0;
} }
QCString resolveTypeDef(Definition *d,const QCString &name)
{
//printf("resolveTypeDef(%s,%s)\n",d ? d->name().data() : "<none>",name.data());
QCString result;
if (name.isEmpty()) return result;
Definition *mContext=d;
MemberDef *md=0;
while (mContext && md==0)
{
MemberNameDict *mnd=0;
if (mContext->definitionType()==Definition::TypeClass)
{
mnd=&Doxygen::memberNameDict;
}
else
{
mnd=&Doxygen::functionNameDict;
}
MemberName *mn=mnd->find(name);
if (mn)
{
MemberNameIterator mni(*mn);
MemberDef *tmd=0;
for (;(tmd=mni.current());++mni)
{
//printf("Found member %s scope=%p mContext=%p\n",tmd->name().data(),
// tmd->getOuterScope(),mContext);
if (tmd->isTypedef() && tmd->getOuterScope()==mContext)
{
md=tmd;
}
}
}
mContext=mContext->getOuterScope();
}
if (md)
{
//printf("Found typedef name `%s' in scope `%s' value=`%s'\n",
// name.data(),d->name().data(),md->typeString()
// );
result=md->typeString();
}
else
{
//printf("Typedef `%s' not found in scope `%s'!\n",
// name.data(),d ? d->name().data() : "<global>");
}
return result;
#if 0
QCString typeName;
if (!name.isEmpty())
{
TypedefInfo *ti = Doxygen::typedefDict[name];
if (ti)
{
int count=0;
typeName=ti->value;
TypedefInfo *newTi;
while ((newTi=Doxygen::typedefDict[typeName]) && count<10)
{
if (typeName==newTi->value) break; // prevent lock-up
typeName=newTi->value;
count++;
}
}
}
return typeName;
#endif
}
/*! Get a class definition given its name. /*! Get a class definition given its name.
* Returns 0 if the class is not found. * Returns 0 if the class is not found.
*/ */
...@@ -366,32 +437,54 @@ NamespaceDef *getResolvedNamespace(const char *name) ...@@ -366,32 +437,54 @@ NamespaceDef *getResolvedNamespace(const char *name)
} }
} }
ClassDef *getResolvedClass(const char *n,bool *pIsTypeDef,QCString *pTemplSpec) ClassDef *getResolvedClass(
Definition *scope,
const char *n,
bool *pIsTypeDef,
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 (name.isEmpty()) return 0;
if (scope==0) scope=Doxygen::globalScope;
int i = name.findRev("::"); int i = name.findRev("::");
QCString *subst = 0; //QCString subst = 0;
if (i!=-1) subst = Doxygen::typedefDict[name.right(name.length()-i-2)]; //if (i!=-1) subst = Doxygen::typedefDict[name.right(name.length()-i-2)];
if (subst==0) subst = Doxygen::typedefDict[name],i=-1; //if (subst==0) subst = Doxygen::typedefDict[name],i=-1;
if (subst) // there is a typedef with this name //if (subst) // there is a typedef with this name
QCString subst;
if (i!=-1)
{
subst = resolveTypeDef(scope,name.right(name.length()-i-2));
}
else
{
subst = resolveTypeDef(scope,name);
}
if (!subst.isEmpty())
{ {
if (pIsTypeDef) *pIsTypeDef=TRUE; if (pIsTypeDef) *pIsTypeDef=TRUE;
//printf("getResolvedClass `%s'->`%s'\n",name.data(),subst->data()); //printf("getResolvedClass `%s'->`%s'\n",name.data(),subst->data());
if (*subst==name) // avoid resolving typedef struct foo foo; if (subst==name) // avoid resolving typedef struct foo foo;
{ {
return Doxygen::classSDict.find(name); return Doxygen::classSDict.find(name);
} }
int count=0; // recursion detection guard int count=0; // recursion detection guard
QCString *newSubst; QCString newSubst;
QCString typeName = *subst; QCString typeName = subst;
if (i!=-1) typeName.prepend(name.left(i)+"::"); if (i!=-1) typeName.prepend(name.left(i)+"::");
while ((newSubst=Doxygen::typedefDict[typeName]) && count<10) while (!(newSubst=resolveTypeDef(scope,typeName)).isEmpty()
&& count<10)
{
if (typeName==newSubst)
{ {
if (typeName==*newSubst) return Doxygen::classSDict.find(subst); // for breaking typedef struct A A;
return Doxygen::classSDict.find(subst->data()); // for breaking typedef struct A A; }
subst=newSubst; subst=newSubst;
typeName=*newSubst; typeName=newSubst;
if (i!=-1) typeName.prepend(name.left(i)+"::"); if (i!=-1) typeName.prepend(name.left(i)+"::");
count++; count++;
} }
...@@ -437,15 +530,19 @@ static bool findOperator(const QCString &s,int i) ...@@ -437,15 +530,19 @@ static bool findOperator(const QCString &s,int i)
return TRUE; return TRUE;
} }
static const char constScope[] = { 'c', 'o', 'n', 's', 't', ':' };
QCString removeRedundantWhiteSpace(const QCString &s) QCString removeRedundantWhiteSpace(const QCString &s)
{ {
if (s.isEmpty()) return s; if (s.isEmpty()) return s;
QCString result; QCString result;
uint i; uint i;
uint l=s.length(); uint l=s.length();
uint csp=0;
for (i=0;i<l;i++) for (i=0;i<l;i++)
{ {
char c=s.at(i); char c=s.at(i);
if (csp<6 && c==constScope[csp]) csp++; else csp=0;
if (i<l-2 && c=='<' && // current char is a < if (i<l-2 && c=='<' && // current char is a <
(isId(s.at(i+1)) || isspace(s.at(i+1))) && // next char is an id char or space (isId(s.at(i+1)) || isspace(s.at(i+1))) && // next char is an id char or space
(i<8 || !findOperator(s,i)) // string in front is not "operator" (i<8 || !findOperator(s,i)) // string in front is not "operator"
...@@ -469,6 +566,11 @@ QCString removeRedundantWhiteSpace(const QCString &s) ...@@ -469,6 +566,11 @@ QCString removeRedundantWhiteSpace(const QCString &s)
result+=' '; result+=' ';
result+=s.at(i); result+=s.at(i);
} }
else if (c==':' && csp==6)
{
result+=" :";
csp=0;
}
else if (!isspace(c) || else if (!isspace(c) ||
( i!=0 && i!=l-1 && ( i!=0 && i!=l-1 &&
(isId(s.at(i-1)) || s.at(i-1)==')' || s.at(i-1)==',' || s.at(i-1)=='>' || s.at(i-1)==']') && (isId(s.at(i-1)) || s.at(i-1)==')' || s.at(i-1)==',' || s.at(i-1)=='>' || s.at(i-1)==']') &&
...@@ -914,46 +1016,24 @@ int minClassDistance(ClassDef *cd,ClassDef *bcd,int level) ...@@ -914,46 +1016,24 @@ int minClassDistance(ClassDef *cd,ClassDef *bcd,int level)
// strip any template specifiers that follow className in string s // strip any template specifiers that follow className in string s
static QCString trimTemplateSpecifiers(const QCString &className,const QCString &s) static QCString trimTemplateSpecifiers(const QCString &className,const QCString &s)
{ {
// first we resolve any defines //printf("trimTemplateSpecifiers(%s,%s)\n",className.data(),s.data());
//int i=0,p,l; ClassDef *cd=getClass(className);
//QCString result; if (cd==0) return s;
//QRegExp r("[A-Z_a-z][A-Z_a-z0-9]*");
//while ((p=r.match(s,i,&l))!=-1)
//{
// if (p>i) result+=s.mid(i,p-i);
// result+=resolveDefines(s.mid(p,l));
// i=p+l;
//}
//if (i<(int)s.length()) result+=s.mid(i,s.length()-i);
QCString qualName=cd->qualifiedNameWithTemplateParameters();
//printf("QualifiedName = %s\n",qualName.data());
// We strip the template arguments following className (if any) // We strip the template arguments following className (if any)
QCString result=s.copy(); QCString result=s;
int l=className.length(); if (!qualName.isEmpty()) // there is a class name
if (l>0) // there is a class name
{ {
int i,p=0; int i,p=0;
while ((i=result.find(className,p))!=-1) // class name is in the argument type // TODO: also try smaller parts of the qualName, since we
{ // could be inside a namespace or class.
uint s=i+l; while ((i=result.find(qualName,p))!=-1) // class name is in the argument type
if (s<result.length() && result.at(s)=='<') // class has template args
{ {
int b=1; int ql=qualName.length();
uint e=s+1; result=result.left(i)+cd->name()+result.right(result.length()-i-ql);
while (b>0 && e<result.length()) // find matching > p=i+cd->name().length();
{
if (result.at(e)=='<') b++;
else if (result.at(e)=='>') b--;
e++;
}
// remove template argument
result=result.left(s)+result.right(result.length()-e);
if (result.length()>s && (result.at(s)=='*' || result.at(s)=='&'))
{
// insert a space to keep the argument in the canonical form
result=result.left(s)+" "+result.right(result.length()-s);
}
}
p=i+l;
} }
} }
return result; return result;
...@@ -981,6 +1061,7 @@ static QCString trimScope(const QCString &name,const QCString &s) ...@@ -981,6 +1061,7 @@ static QCString trimScope(const QCString &name,const QCString &s)
scopeOffset=name.findRev("::",scopeOffset-1); scopeOffset=name.findRev("::",scopeOffset-1);
result = tmp; result = tmp;
} while (scopeOffset>0); } while (scopeOffset>0);
//printf("trimScope(name=%s,scope=%s)=%s\n",name.data(),s.data(),result.data());
return result; return result;
} }
...@@ -1085,6 +1166,23 @@ void stripIrrelevantConstVolatile(QCString &s) ...@@ -1085,6 +1166,23 @@ void stripIrrelevantConstVolatile(QCString &s)
} }
} }
#if 0 // should be done differently
static QCString resolveTypeDefs(const QCString &s)
{
QCString result;
static QRegExp re("[a-z_A-Z][a-z_A-Z0-9]*");
int p=0,l,i;
while ((i=re.match(s,p,&l))!=-1)
{
result += s.mid(p,i-p);
result += resolveTypeDef(s.mid(i,l));
p=i+l;
}
result+=s.right(s.length()-p);
return result;
}
#endif
// a bit of debug support for matchArguments // a bit of debug support for matchArguments
#define MATCH #define MATCH
#define NOMATCH #define NOMATCH
...@@ -1097,6 +1195,15 @@ static bool matchArgument(const Argument *srcA,const Argument *dstA, ...@@ -1097,6 +1195,15 @@ static bool matchArgument(const Argument *srcA,const Argument *dstA,
NamespaceList *usingNamespaces, NamespaceList *usingNamespaces,
ClassList *usingClasses) ClassList *usingClasses)
{ {
//printf("match argument start %s:%s <-> %s:%s\n",
// srcA->type.data(),srcA->name.data(),
// dstA->type.data(),dstA->name.data());
// TODO: resolve any typedefs names that are part of srcA->type
// before matching. This should use className and namespaceName
// and usingNamespaces and usingClass to determine which typedefs
// are in-scope, so it will not be very efficient :-(
QCString srcAType=trimTemplateSpecifiers(className,srcA->type); QCString srcAType=trimTemplateSpecifiers(className,srcA->type);
QCString dstAType=trimTemplateSpecifiers(className,dstA->type); QCString dstAType=trimTemplateSpecifiers(className,dstA->type);
if (srcAType.left(6)=="class ") srcAType=srcAType.right(srcAType.length()-6); if (srcAType.left(6)=="class ") srcAType=srcAType.right(srcAType.length()-6);
...@@ -1106,21 +1213,34 @@ static bool matchArgument(const Argument *srcA,const Argument *dstA, ...@@ -1106,21 +1213,34 @@ static bool matchArgument(const Argument *srcA,const Argument *dstA,
// from a syntactic point of view they would be two names of the same // from a syntactic point of view they would be two names of the same
// type "const". This is not fool prove ofcourse, but should at least // type "const". This is not fool prove ofcourse, but should at least
// catch the most common cases. // catch the most common cases.
if (srcAType=="const" && !srcA->name.isEmpty()) if ((srcAType=="const" || srcAType=="volatile") && !srcA->name.isEmpty())
{ {
srcAType+=" "; srcAType+=" ";
srcAType+=srcA->name; srcAType+=srcA->name;
} }
if (dstAType=="const" && !dstA->name.isEmpty()) if ((dstAType=="const" || dstAType=="volatile") && !dstA->name.isEmpty())
{ {
dstAType+=" "; dstAType+=" ";
dstAType+=dstA->name; dstAType+=dstA->name;
} }
//printf("scope=`%s': `%s' <=> `%s'\n",className.data(),srcAType.data(),dstAType.data()); if (srcA->name=="const" || srcA->name=="volatile")
{
srcAType+=srcA->name;
}
if (dstA->name=="const" || dstA->name=="volatile")
{
dstAType+=dstA->name;
}
stripIrrelevantConstVolatile(srcAType); stripIrrelevantConstVolatile(srcAType);
stripIrrelevantConstVolatile(dstAType); stripIrrelevantConstVolatile(dstAType);
//srcAType=stripTemplateSpecifiersFromScope(srcAType,FALSE);
//dstAType=stripTemplateSpecifiersFromScope(dstAType,FALSE);
//printf("srcA=%s:%s dstA=%s:%s\n",srcAType.data(),srcA->name.data(),
// dstAType.data(),dstA->name.data());
if (srcA->array!=dstA->array) // nomatch for char[] against char if (srcA->array!=dstA->array) // nomatch for char[] against char
{ {
NOMATCH NOMATCH
...@@ -1192,7 +1312,8 @@ static bool matchArgument(const Argument *srcA,const Argument *dstA, ...@@ -1192,7 +1312,8 @@ static bool matchArgument(const Argument *srcA,const Argument *dstA,
MATCH MATCH
return TRUE; return TRUE;
} }
//printf("srcA=%s::%s dstA=%s::%s\n",srcAType.data(),srcA->name.data(),
//printf("2. srcA=%s:%s dstA=%s:%s\n",srcAType.data(),srcA->name.data(),
// dstAType.data(),dstA->name.data()); // dstAType.data(),dstA->name.data());
uint srcPos=0,dstPos=0; uint srcPos=0,dstPos=0;
...@@ -1309,10 +1430,28 @@ static void mergeArgument(Argument *srcA,Argument *dstA, ...@@ -1309,10 +1430,28 @@ static void mergeArgument(Argument *srcA,Argument *dstA,
NamespaceList *usingNamespaces, NamespaceList *usingNamespaces,
ClassList *usingClasses) ClassList *usingClasses)
{ {
//printf("merge argument start %s:%s <-> %s:%s\n",
// srcA->type.data(),srcA->name.data(),
// dstA->type.data(),dstA->name.data());
if ((srcA->type=="const" || srcA->type=="volatile") && !srcA->name.isEmpty())
{
srcA->type+=" ";
srcA->type+=srcA->name;
srcA->name.resize(0);
}
if ((dstA->type=="const" || dstA->type=="volatile") && !dstA->name.isEmpty())
{
dstA->type+=" ";
dstA->type+=dstA->name;
dstA->name.resize(0);
}
QCString srcAType=trimTemplateSpecifiers(className,srcA->type); QCString srcAType=trimTemplateSpecifiers(className,srcA->type);
QCString dstAType=trimTemplateSpecifiers(className,dstA->type); QCString dstAType=trimTemplateSpecifiers(className,dstA->type);
if (srcAType.left(6)=="class ") srcAType=srcAType.right(srcAType.length()-6); if (srcAType.left(6)=="class ") srcAType=srcAType.right(srcAType.length()-6);
if (dstAType.left(6)=="class ") dstAType=dstAType.right(dstAType.length()-6); if (dstAType.left(6)=="class ") dstAType=dstAType.right(dstAType.length()-6);
stripIrrelevantConstVolatile(srcAType); stripIrrelevantConstVolatile(srcAType);
stripIrrelevantConstVolatile(dstAType); stripIrrelevantConstVolatile(dstAType);
...@@ -1324,6 +1463,7 @@ static void mergeArgument(Argument *srcA,Argument *dstA, ...@@ -1324,6 +1463,7 @@ static void mergeArgument(Argument *srcA,Argument *dstA,
// (assuming a using statement was used) // (assuming a using statement was used)
trimNamespaceScope(srcAType,dstAType); trimNamespaceScope(srcAType,dstAType);
//QCString srcScope; //QCString srcScope;
//QCString dstScope; //QCString dstScope;
...@@ -1376,14 +1516,14 @@ static void mergeArgument(Argument *srcA,Argument *dstA, ...@@ -1376,14 +1516,14 @@ static void mergeArgument(Argument *srcA,Argument *dstA,
{ {
srcA->type=srcAType+" "+srcA->name; srcA->type=srcAType+" "+srcA->name;
srcA->name.resize(0); srcA->name.resize(0);
return; goto done;
} }
else if (!dstA->name.isEmpty() && !srcA->type.isEmpty() && else if (!dstA->name.isEmpty() && !srcA->type.isEmpty() &&
(dstAType+" "+dstA->name)==srcAType) (dstAType+" "+dstA->name)==srcAType)
{ {
dstA->type=dstAType+" "+dstA->name; dstA->type=dstAType+" "+dstA->name;
dstA->name.resize(0); dstA->name.resize(0);
return; goto done;
} }
//printf("srcA=%s::%s dstA=%s::%s\n",srcAType.data(),srcA->name.data(), //printf("srcA=%s::%s dstA=%s::%s\n",srcAType.data(),srcA->name.data(),
// dstAType.data(),dstA->name.data()); // dstAType.data(),dstA->name.data());
...@@ -1465,7 +1605,7 @@ static void mergeArgument(Argument *srcA,Argument *dstA, ...@@ -1465,7 +1605,7 @@ static void mergeArgument(Argument *srcA,Argument *dstA,
srcA->type=srcAType.left(startPos).stripWhiteSpace(); srcA->type=srcAType.left(startPos).stripWhiteSpace();
} }
} }
return; goto done;
} }
//printf("match exactly\n"); //printf("match exactly\n");
if (srcA->name.isEmpty() && dstA->name.isEmpty()) if (srcA->name.isEmpty() && dstA->name.isEmpty())
...@@ -1491,6 +1631,10 @@ static void mergeArgument(Argument *srcA,Argument *dstA, ...@@ -1491,6 +1631,10 @@ static void mergeArgument(Argument *srcA,Argument *dstA,
{ {
dstA->name = srcA->name.copy(); dstA->name = srcA->name.copy();
} }
done:
//printf("merge argument result %s:%s <-> %s:%s\n",
// srcA->type.data(),srcA->name.data(),
// dstA->type.data(),dstA->name.data());
return; return;
} }
...@@ -1632,6 +1776,8 @@ void mergeArguments(ArgumentList *srcAl,ArgumentList *dstAl) ...@@ -1632,6 +1776,8 @@ void mergeArguments(ArgumentList *srcAl,ArgumentList *dstAl)
//printf("Defval changing `%s'->`%s'\n",dstA->defval.data(),srcA->defval.data()); //printf("Defval changing `%s'->`%s'\n",dstA->defval.data(),srcA->defval.data());
dstA->defval=srcA->defval.copy(); dstA->defval=srcA->defval.copy();
} }
if (srcA->type==dstA->type)
{
if (srcA->name.isEmpty() && !dstA->name.isEmpty()) if (srcA->name.isEmpty() && !dstA->name.isEmpty())
{ {
//printf("type: `%s':=`%s'\n",srcA->type.data(),dstA->type.data()); //printf("type: `%s':=`%s'\n",srcA->type.data(),dstA->type.data());
...@@ -1650,6 +1796,7 @@ void mergeArguments(ArgumentList *srcAl,ArgumentList *dstAl) ...@@ -1650,6 +1796,7 @@ void mergeArguments(ArgumentList *srcAl,ArgumentList *dstAl)
{ {
srcA->name = dstA->name.copy(); srcA->name = dstA->name.copy();
} }
}
int i1=srcA->type.find("::"), int i1=srcA->type.find("::"),
i2=dstA->type.find("::"), i2=dstA->type.find("::"),
j1=srcA->type.length()-i1-2, j1=srcA->type.length()-i1-2,
...@@ -1766,7 +1913,7 @@ bool getDefs(const QCString &scName,const QCString &memberName, ...@@ -1766,7 +1913,7 @@ bool getDefs(const QCString &scName,const QCString &memberName,
//printf("Trying class scope %s\n",className.data()); //printf("Trying class scope %s\n",className.data());
ClassDef *fcd=0; ClassDef *fcd=0;
if ((fcd=getResolvedClass(className)) && // is it a documented class if ((fcd=getResolvedClass(Doxygen::globalScope,className)) && // is it a documented class
fcd->isLinkable() fcd->isLinkable()
) )
{ {
...@@ -2002,7 +2149,7 @@ bool getDefs(const QCString &scName,const QCString &memberName, ...@@ -2002,7 +2149,7 @@ bool getDefs(const QCString &scName,const QCString &memberName,
bmd = 0; bmd = 0;
break; break;
} }
if (!(md->isStatic())) bmd = md; if (!(md->isStatic()) || Config_getBool("EXTRACT_STATIC")) bmd = md;
} }
if (bmd) md=bmd; if (bmd) md=bmd;
} }
...@@ -2195,7 +2342,7 @@ bool generateRef(OutputDocInterface &od,const char *scName, ...@@ -2195,7 +2342,7 @@ bool generateRef(OutputDocInterface &od,const char *scName,
if (getDefs(scopeStr,nameStr,argsStr,md,cd,fd,nd,gd, if (getDefs(scopeStr,nameStr,argsStr,md,cd,fd,nd,gd,
scopePos==0 && !memberScopeFirst)) scopePos==0 && !memberScopeFirst))
{ {
//printf("after getDefs nd=%p\n",nd); //printf("after getDefs md=%p cd=%p fd=%p nd=%p gd=%p\n",md,cd,fd,nd,gd);
QCString anchor; QCString anchor;
if (md->isLinkable()) anchor = md->anchor(); if (md->isLinkable()) anchor = md->anchor();
QCString cName,aName; QCString cName,aName;
......
...@@ -41,6 +41,7 @@ class NamespaceList; ...@@ -41,6 +41,7 @@ class NamespaceList;
class ClassList; class ClassList;
class MemberGroupList; class MemberGroupList;
class MemberGroupDict; class MemberGroupDict;
class Definition;
//-------------------------------------------------------------------- //--------------------------------------------------------------------
...@@ -104,7 +105,8 @@ extern QCString substituteClassNames(const QCString &s); ...@@ -104,7 +105,8 @@ extern QCString substituteClassNames(const QCString &s);
extern QCString substitute(const char *s,const char *src,const char *dst); extern QCString substitute(const char *s,const char *src,const char *dst);
extern QCString resolveDefines(const char *n); extern QCString resolveDefines(const char *n);
extern ClassDef *getClass(const char *key); extern ClassDef *getClass(const char *key);
extern ClassDef *getResolvedClass(const char *key, extern ClassDef *getResolvedClass(Definition *scope,
const char *key,
bool *pIsTypeDef=0, bool *pIsTypeDef=0,
QCString *pTemplSpec=0); QCString *pTemplSpec=0);
extern NamespaceDef *getResolvedNamespace(const char *key); extern NamespaceDef *getResolvedNamespace(const char *key);
...@@ -157,6 +159,7 @@ ArgumentList *copyArgumentList(const ArgumentList *src); ...@@ -157,6 +159,7 @@ ArgumentList *copyArgumentList(const ArgumentList *src);
QList<ArgumentList> *copyArgumentLists(const QList<ArgumentList> *srcLists); QList<ArgumentList> *copyArgumentLists(const QList<ArgumentList> *srcLists);
QCString stripTemplateSpecifiersFromScope(const QCString &fullName, QCString stripTemplateSpecifiersFromScope(const QCString &fullName,
bool parentOnly=TRUE); bool parentOnly=TRUE);
QCString resolveTypeDef(Definition *d,const QCString &name);
#endif #endif
...@@ -26,12 +26,14 @@ ...@@ -26,12 +26,14 @@
#include "classlist.h" #include "classlist.h"
#include "util.h" #include "util.h"
#include "defargs.h" #include "defargs.h"
#include "outputgen.h"
#include "doc.h"
#include <qdir.h> #include <qdir.h>
#include <qfile.h> #include <qfile.h>
#include <qtextstream.h> #include <qtextstream.h>
static void writeXMLString(QTextStream &t,const char *s) static inline void writeXMLString(QTextStream &t,const char *s)
{ {
t << convertToXML(s); t << convertToXML(s);
} }
...@@ -75,6 +77,629 @@ class TextGeneratorXMLImpl : public TextGeneratorIntf ...@@ -75,6 +77,629 @@ class TextGeneratorXMLImpl : public TextGeneratorIntf
QTextStream &m_t; QTextStream &m_t;
}; };
template<class T> class ValStack
{
public:
ValStack() : m_values(10), m_sp(0), m_size(10) {}
virtual ~ValStack() {}
ValStack(const ValStack &s)
{
m_values=s.m_values.copy();
m_sp=s.m_sp;
m_size=s.m_size;
}
ValStack &operator=(const ValStack &s)
{
m_values=s.m_values.copy();
m_sp=s.m_sp;
m_size=s.m_size;
return *this;
}
void push(T v)
{
m_sp++;
if (m_sp>=m_size)
{
m_size+=10;
m_values.resize(m_size);
}
m_values[m_sp]=v;
}
T pop()
{
ASSERT(m_sp!=0);
return m_values[m_sp--];
}
T& top()
{
ASSERT(m_sp!=0);
return m_values[m_sp];
}
bool isEmpty()
{
return m_sp==0;
}
private:
QArray<T> m_values;
int m_sp;
int m_size;
};
/*! This class is used by the documentation parser.
* Its methods are called when some XML text or markup
* needs to be written.
*/
class XMLGenerator : public OutputDocInterface
{
public:
// helper functions
void startParMode()
{
if (!m_inParStack.isEmpty() && !m_inParStack.top())
{
m_inParStack.top() = TRUE;
m_t << "<para>" << endl;
}
else if (m_inParStack.isEmpty())
{
m_inParStack.push(TRUE);
m_t << "<para>" << endl;
}
}
void endParMode()
{
if (!m_inParStack.isEmpty() && m_inParStack.top())
{
m_inParStack.top() = FALSE;
m_t << "</para>" << endl;
}
}
void startNestedPar()
{
m_inParStack.push(FALSE);
}
void endNestedPar()
{
if (m_inParStack.pop())
{
m_t << "</para>" << endl;
}
}
// Standard generator functions to be implemented by all generators
void docify(const char *s)
{
startParMode();
writeXMLString(m_t,s);
}
void writeChar(char c)
{
startParMode();
char s[2];s[0]=c;s[1]=0;
docify(s);
}
void writeString(const char *text)
{
startParMode();
m_t << text;
}
void startItemList()
{
m_t << "<itemizedlist>" << endl;;
m_inListStack.push(TRUE);
}
void startEnumList()
{
m_t << "<orderedlist>";
m_inListStack.push(TRUE);
}
void writeListItem()
{
if (!m_inListStack.isEmpty() && m_inListStack.top()) // first element
{
m_inListStack.top()=FALSE;
}
else // not first element, end previous element first
{
endParMode();
endNestedPar();
m_t << "</listitem>" << endl;
}
m_t << "<listitem>";
startNestedPar();
}
void endItemList()
{
if (!m_inListStack.isEmpty() && !m_inListStack.pop()) // first element
{
endParMode();
endNestedPar();
m_t << "</listitem>" << endl;
}
m_t << "</itemizedlist>" << endl;
}
void endEnumList()
{
if (!m_inListStack.isEmpty() && !m_inListStack.pop()) // first element
{
endParMode();
m_t << "</listitem>" << endl;
endNestedPar();
}
m_t << "</orderedlist>" << endl;
}
void newParagraph()
{
endParMode();
startParMode();
}
void startBold()
{
startParMode();
m_t << "<bold>"; // non DocBook
}
void endBold()
{
m_t << "</bold>"; // non DocBook
}
void startTypewriter()
{
startParMode();
m_t << "<computeroutput>";
}
void endTypewriter()
{
m_t << "</computeroutput>";
}
void startEmphasis()
{
startParMode();
m_t << "<emphasis>";
}
void endEmphasis()
{
m_t << "</emphasis>";
}
void startCodeFragment()
{
endParMode();
m_t << "<programlisting>";
}
void endCodeFragment()
{
m_t << "</programlisting>";
}
void startPreFragment()
{
endParMode();
m_t << "<programlisting>";
}
void endPreFragment()
{
m_t << "</programlisting>";
}
void writeRuler()
{
endParMode();
m_t << "<hruler/>";
}
void startDescription()
{
m_t << "<variablelist>";
m_inListStack.push(TRUE);
}
void endDescription()
{
if (!m_inListStack.isEmpty() && !m_inListStack.pop()) // first element
{
endNestedPar();
m_t << "</listitem>" << endl;
}
m_t << "</variablelist>";
if (!m_inListStack.isEmpty()) m_inListStack.pop();
}
void startDescItem()
{
if (!m_inListStack.isEmpty() && m_inListStack.top()) // first element
{
m_inListStack.top()=FALSE;
}
else // not first element, end previous element first
{
endNestedPar();
m_t << "</listitem>";
}
m_t << "<varlistentry><term>";
}
void endDescItem()
{
m_t << "</term></varlistentry><listitem>";
startNestedPar();
}
void startDescList()
{
m_t << "<simplesect><title>";
}
void endDescList()
{
endNestedPar();
m_t << "</simplesect>";
}
void startParamList()
{
m_t << "<parameterlist><title>"; // non DocBook
// TODO: what kind of list
// param, retval, exception
m_inParamList = TRUE;
}
void endParamList()
{
m_inParamList = FALSE;
m_t << "</parameterlist>";
}
void endDescTitle()
{
m_t << "</title>";
if (!m_inParamList) startNestedPar();
}
void writeDescItem() { }
void startDescTable() { }
void endDescTable() { }
void startDescTableTitle()
{
m_t << "<parametername>"; // non docbook
}
void endDescTableTitle()
{
m_t << "</parametername>"; // non docbook
}
void startDescTableData()
{
m_t << "<parameterdescription>"; // non docbook
startNestedPar();
}
void endDescTableData()
{
endNestedPar();
m_t << "</parameterdescription>"; // non docbook
}
void lineBreak()
{
m_t << "<linebreak/>"; // non docbook
}
void writeNonBreakableSpace(int num)
{
int i;for (i=0;i<num;i++) m_t << "<nonbreakablespace/>"; // non docbook
}
//// TODO: translate these as well....
void writeObjectLink(const char *ref,const char *file,
const char *anchor, const char *text)
{
if (ref) // TODO: add support for external references
{
docify(text);
}
else
{
writeXMLLink(m_t,file,anchor,text);
}
}
void writeCodeLink(const char *ref,const char *file,
const char *anchor,const char *text)
{
if (ref) // TODO: add support for external references
{
docify(text);
}
else
{
writeXMLLink(m_t,file,anchor,text);
}
}
void startHtmlLink(const char *url)
{
m_t << "<ulink url=\"" << url << "\">";
}
void endHtmlLink()
{
m_t << "</ulink>";
}
void writeMailLink(const char *url)
{
m_t << "<email>";
docify(url);
m_t << "</email>";
}
void startSection(const char *id,const char *,bool)
{
m_t << "<sect1 id=\"" << id << "\">";
}
void endSection(const char *,bool)
{
m_t << "</sect1>";
}
void startSubsection()
{
m_t << "<sect2>";
}
void endSubsection()
{
m_t << "</sect2>";
}
void startSubsubsection()
{
m_t << "<sect3>";
}
void endSubsubsection()
{
m_t << "</sect3>";
}
void startCenter()
{
m_t << "<center>"; // non docbook
}
void endCenter()
{
m_t << "</center>"; // non docbook
}
void startSmall()
{
m_t << "<small>"; // non docbook
}
void endSmall()
{
m_t << "</small>"; // non docbook
}
void startSubscript()
{
m_t << "<subscript>";
}
void endSubscript()
{
m_t << "</subscript>";
}
void startSuperscript()
{
m_t << "<superscript>";
}
void endSuperscript()
{
m_t << "</superscript>";
}
void startTable(int cols)
{
m_t << "<table><tgroup cols=\"" << cols << "\"><tbody>\n";
}
void endTable()
{
m_t << "</row>\n</tbody></tgroup></table>";
}
void nextTableRow()
{
m_t << "<row><entry>";
}
void endTableRow()
{
m_t << "</row>" << endl;
}
void nextTableColumn()
{
m_t << "<entry>";
}
void endTableColumn()
{
m_t << "</entry>";
}
void writeQuote() { m_t << "\""; }
void writeCopyright() { m_t << "&copy;"; }
void writeUmlaut(char c) { m_t << "&" << c << "uml;"; }
void writeAcute(char c) { m_t << "&" << c << "acute;"; }
void writeGrave(char c) { m_t << "&" << c << "grave;"; }
void writeCirc(char c) { m_t << "&" << c << "circ;"; }
void writeTilde(char c) { m_t << "&" << c << "tilde;"; }
void writeRing(char c) { m_t << "&" << c << "ring;"; }
void writeSharpS() { m_t << "&szlig;"; }
void writeCCedil(char c) { m_t << "&" << c << "cedil;"; }
void startTitle()
{
m_t << "<title>";
}
void endTitle()
{
m_t << "</title>" << endl;
}
void writeAnchor(const char *id,const char *name)
{
m_t << "<anchor id=\"" << id << "_" << name << "\"/>";
}
void writeSectionRef(const char *,const char *id,
const char *name,const char *text)
{
m_t << "<link linkend=\"" << id << "_" << name << "\">";
docify(text);
m_t << "</link>";
}
void writeSectionRefItem(const char *,const char *,const char *)
{
m_t << "(writeSectionRefItem)";
}
void addIndexItem(const char *primaryie,const char *secondaryie)
{
m_t << "<indexentry><primaryie>";
docify(primaryie);
m_t << "</primaryie><secondaryie>";
docify(secondaryie);
m_t << "</secondaryie></indexentry>";
}
void writeFormula(const char *id,const char *text)
{
m_t << "<formula id=\"" << id << "\">"; // non Docbook
docify(text);
m_t << "</formula>";
}
void startImage(const char *name,const char *size,bool caption)
{
m_t << "<image name=\"" << name << "\" size=\"" << size
<< "\" caption=\"" << (caption ? "1" : "0") << "\">"; // non docbook
}
void endImage(bool)
{
m_t << "</image>";
}
void startTextLink(const char *name,const char *anchor)
{
m_t << "<ulink url=\"" << name << "#" << anchor << "\">";
}
void endTextLink()
{
m_t << "<ulink>";
}
void startPageRef()
{
}
void endPageRef(const char *,const char *)
{
}
void startCodeLine()
{
m_t << "<linenumber>"; // non DocBook
}
void endCodeLine()
{
m_t << "</linenumber>"; // non DocBook
}
void startCodeAnchor(const char *id)
{
m_t << "<anchor id=\"" << id << "\">";
}
void endCodeAnchor()
{
m_t << "</anchor>";
}
void startFontClass(const char *colorClass)
{
m_t << "<highlight class=\"" << colorClass << "\""; // non DocBook
}
void endFontClass()
{
m_t << "</highlight>"; // non DocBook
}
void codify(const char *text)
{
docify(text);
}
// Generator specific functions
/*! Create a clone of this generator. Uses the copy constructor */
OutputDocInterface *clone()
{
return new XMLGenerator(this);
}
/*! Append the output written to generator \a g to this generator */
void append(const OutputDocInterface *g)
{
const XMLGenerator *xg = (const XMLGenerator *)g;
//if (m_inPar && !mifgen->m_inParStart)
//{
// endParMode();
//}
//else if (!m_inPar && mifgen->m_inParStart)
//{
// startParMode();
//}
//printf("Appending \n>>>>\n`%s'\n<<<<\n and \n>>>>\n`%s'\n<<<<\n",getContents().data(),mifgen->getContents().data());
m_t << xg->getContents();
m_inParStack = xg->m_inParStack;
m_inListStack = xg->m_inListStack;
m_inParamList = xg->m_inParamList;
}
/*! constructor.
*/
XMLGenerator()
{
m_b.setBuffer(m_a);
m_b.open( IO_WriteOnly );
m_t.setDevice(&m_b);
m_t.setEncoding(QTextStream::Latin1);
}
/*! copy constructor */
XMLGenerator(const XMLGenerator *xg)
{
m_b.setBuffer(m_a);
m_b.open( IO_WriteOnly );
m_t.setDevice(&m_b);
m_t.setEncoding(QTextStream::Latin1);
// copy state variables
m_inParStack = xg->m_inParStack;
m_inListStack = xg->m_inListStack;
m_inParamList = xg->m_inParamList;
}
/*! destructor */
virtual ~XMLGenerator()
{
}
/*! Returns the output written to this generator as a string */
QCString getContents() const
{
QCString s;
s.resize(m_a.size()+1);
memcpy(s.data(),m_a.data(),m_a.size());
s.at(m_a.size())='\0';
return s;
}
private:
// only one destination stream, so these do not have to be implemented
void pushGeneratorState() {}
void popGeneratorState() {}
void disableAllBut(OutputGenerator::OutputType) {}
void enableAll() {}
void disableAll() {}
void disable(OutputGenerator::OutputType) {}
void enable(OutputGenerator::OutputType) {}
bool isEnabled(OutputGenerator::OutputType) { return TRUE; }
QTextStream m_t;
QByteArray m_a;
QBuffer m_b;
ValStack<bool> m_inParStack;
ValStack<bool> m_inListStack;
bool m_inParamList;
};
void writeXMLDocBlock(QTextStream &t,
const QCString &fileName,
int lineNr,
const QCString &scope,
const QCString &name,
const QCString &text)
{
XMLGenerator *xmlGen = new XMLGenerator;
parseDoc(*xmlGen,
fileName, // input definition file
lineNr, // input definition line
scope, // scope (which should not be linked to)
name, // member (which should not be linked to)
text // actual text
);
xmlGen->endParMode();
t << xmlGen->getContents();
delete xmlGen;
}
void generateXMLForMember(MemberDef *md,QTextStream &t,Definition *def) void generateXMLForMember(MemberDef *md,QTextStream &t,Definition *def)
{ {
...@@ -235,6 +860,12 @@ void generateXMLForMember(MemberDef *md,QTextStream &t,Definition *def) ...@@ -235,6 +860,12 @@ void generateXMLForMember(MemberDef *md,QTextStream &t,Definition *def)
} }
} }
} }
t << " <briefdescription>" << endl;
writeXMLDocBlock(t,md->getDefFileName(),md->getDefLine(),scopeName,md->name(),md->briefDescription());
t << " </briefdescription>" << endl;
t << " <detaileddescription>" << endl;
writeXMLDocBlock(t,md->getDefFileName(),md->getDefLine(),scopeName,md->name(),md->documentation());
t << " </detaileddescription>" << endl;
t << " </memberdef>" << endl; t << " </memberdef>" << endl;
} }
...@@ -370,6 +1001,12 @@ void generateXMLForClass(ClassDef *cd,QTextStream &t) ...@@ -370,6 +1001,12 @@ void generateXMLForClass(ClassDef *cd,QTextStream &t)
generateXMLClassSection(cd,t,&cd->related,"related"); generateXMLClassSection(cd,t,&cd->related,"related");
//t << " </sectionlist>" << endl; //t << " </sectionlist>" << endl;
} }
t << " <briefdescription>" << endl;
writeXMLDocBlock(t,cd->getDefFileName(),cd->getDefLine(),cd->name(),0,cd->briefDescription());
t << " </briefdescription>" << endl;
t << " <detaileddescription>" << endl;
writeXMLDocBlock(t,cd->getDefFileName(),cd->getDefLine(),cd->name(),0,cd->documentation());
t << " </detaileddescription>" << endl;
t << " </compounddef>" << endl; t << " </compounddef>" << endl;
} }
...@@ -411,6 +1048,12 @@ void generateXMLForFile(FileDef *fd,QTextStream &t) ...@@ -411,6 +1048,12 @@ void generateXMLForFile(FileDef *fd,QTextStream &t)
generateXMLFileSection(fd,t,&fd->decVarMembers,"var"); generateXMLFileSection(fd,t,&fd->decVarMembers,"var");
//t << " </sectionlist>" << endl; //t << " </sectionlist>" << endl;
} }
t << " <briefdescription>" << endl;
writeXMLDocBlock(t,fd->getDefFileName(),fd->getDefLine(),0,0,fd->briefDescription());
t << " </briefdescription>" << endl;
t << " <detaileddescription>" << endl;
writeXMLDocBlock(t,fd->getDefFileName(),fd->getDefLine(),0,0,fd->documentation());
t << " </detaileddescription>" << endl;
t << " </compounddef>" << endl; t << " </compounddef>" << endl;
} }
......
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