diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 1999-12-15 19:29:47 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 1999-12-15 19:29:47 (GMT) |
commit | 6aa7383e23c850af36c25b87e5737a2e2f635083 (patch) | |
tree | 223d088e44a6b0956dd0437ed4851244b2e7f36c /src | |
parent | e04496cb647291b94c0b27b8babb127a79803579 (diff) | |
download | Doxygen-6aa7383e23c850af36c25b87e5737a2e2f635083.zip Doxygen-6aa7383e23c850af36c25b87e5737a2e2f635083.tar.gz Doxygen-6aa7383e23c850af36c25b87e5737a2e2f635083.tar.bz2 |
mods for doxygen-0.49-990728
Diffstat (limited to 'src')
80 files changed, 5741 insertions, 3134 deletions
diff --git a/src/Makefile b/src/Makefile index e57994c..9812d37 100644 --- a/src/Makefile +++ b/src/Makefile @@ -39,6 +39,6 @@ clean: $(MAKE) -f Makefile.doxysearch clean -rm -f scanner.cpp code.cpp config.cpp pre.cpp ce_lex.cpp \ ce_parse.cpp ce_parse.h doxytag.cpp tag.cpp \ - declinfo.cpp defargs.cpp version.cpp + declinfo.cpp defargs.cpp FORCE: diff --git a/src/classdef.cpp b/src/classdef.cpp index 50cd54c..005a397 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -29,9 +29,9 @@ #include "diagram.h" #include "language.h" -static QString stripExtension(const char *fName) +static QCString stripExtension(const char *fName) { - QString result=fName; + QCString result=fName; if (result.right(5)==".html") result=result.left(result.length()-5); return result; } @@ -47,7 +47,7 @@ ClassDef::ClassDef(const char *nm,CompoundType ct,const char *ref,const char *fN fileName="class_"+nameToFile(nm); if (ref) { - //url=(QString)"doxygen=\""+ref+":\" href=\""+fileName; + //url=(QCString)"doxygen=\""+ref+":\" href=\""+fileName; exampleList = 0; exampleDict = 0; } @@ -105,7 +105,7 @@ void ClassDef::insertMember(const MemberDef *md) //printf("adding %s::%s\n",name(),md->name()); if (!reference) { - if (md->isRelated() && (extractPrivateFlag || md->protection()!=Private)) + if (md->isRelated() && (Config::extractPrivateFlag || md->protection()!=Private)) { related.append(md); } @@ -152,7 +152,7 @@ void ClassDef::insertMember(const MemberDef *md) } } // check if we should add this member in the `all members' list - if (md->isFriend() || md->protection()!=Private || extractPrivateFlag) + if (md->isFriend() || md->protection()!=Private || Config::extractPrivateFlag) { MemberInfo *mi = new MemberInfo((MemberDef *)md,Public,Normal); MemberNameInfo *mni=0; @@ -220,8 +220,8 @@ static void writeInheritanceSpecifier(OutputList &ol,BaseClassDef *bcd) void ClassDef::writeDocumentation(OutputList &ol) { // write title - QString pageTitle=name().copy(); - QString pageType; + QCString pageTitle=name().copy(); + QCString pageType; switch(compType) { case Class: pageType=" Class"; break; @@ -257,12 +257,12 @@ void ClassDef::writeDocumentation(OutputList &ol) if (incFile) { - QString nm=incName.copy(); + QCString nm=incName.copy(); if (incName.isNull()) nm=incFile->name(); ol.startTypewriter(); ol.docify("#include <"); ol.disable(OutputGenerator::Man); - if (verbatimHeaderFlag) + if (Config::verbatimHeaderFlag) { ol.writeObjectLink(0,fileName+"-include",0,nm); } @@ -279,9 +279,9 @@ void ClassDef::writeDocumentation(OutputList &ol) ol.newParagraph(); } - if (genTagFile.length()>0) tagFile << ">" << name() << ":"; + if (Config::genTagFile.length()>0) tagFile << ">" << name() << ":"; - if (classDiagramFlag) ol.disableAllBut(OutputGenerator::Man); + if (Config::classDiagramFlag) ol.disableAllBut(OutputGenerator::Man); // write superclasses int count; @@ -289,7 +289,7 @@ void ClassDef::writeDocumentation(OutputList &ol) { //parseText(ol,theTranslator->trInherits()+" "); - QString inheritLine = theTranslator->trInheritsList(inherits->count()); + QCString inheritLine = theTranslator->trInheritsList(inherits->count()); QRegExp marker("@[0-9]+"); int index=0,newIndex,matchLen; // now replace all markers in inheritLine with links to the classes @@ -304,7 +304,7 @@ void ClassDef::writeDocumentation(OutputList &ol) ClassDef *cd=bcd->classDef; if (cd->hasDocumentation() || cd->isReference()) { - if (genTagFile.length()>0) tagFile << cd->getOutputFileBase() << "?"; + if (Config::genTagFile.length()>0) tagFile << cd->getOutputFileBase() << "?"; ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,cd->name()+bcd->templSpecifiers); } else @@ -320,41 +320,14 @@ void ClassDef::writeDocumentation(OutputList &ol) } parseText(ol,inheritLine.right(inheritLine.length()-index)); ol.newParagraph(); - -#if 0 - BaseClassDef *bcd=inherits->first(); - while (bcd) - { - ClassDef *cd=bcd->classDef; - if (cd->hasDocumentation() || cd->isReference()) - { - if (genTagFile.length()>0) tagFile << cd->classFile() << "?"; - ol.writeObjectLink(cd->getReference(),cd->classFile(),0,cd->name()+bcd->templSpecifiers); - } - else - { - ol.docify(cd->name()); - } - writeInheritanceSpecifier(ol,bcd); - bcd=inherits->next(); - if (bcd) - { - if (inherits->at()==count-1) - parseText(ol," "+theTranslator->trAnd()+" "); - else - ol.writeString(", "); - } - } - ol.writeString("."); -#endif } - if (genTagFile.length()>0) tagFile << " \"" << fileName << ".html\"\n"; + if (Config::genTagFile.length()>0) tagFile << " \"" << fileName << ".html\"\n"; // write subclasses if ((count=inheritedBy->count())>0) { - QString inheritLine = theTranslator->trInheritedByList(inheritedBy->count()); + QCString inheritLine = theTranslator->trInheritedByList(inheritedBy->count()); QRegExp marker("@[0-9]+"); int index=0,newIndex,matchLen; // now replace all markers in inheritLine with links to the classes @@ -381,37 +354,9 @@ void ClassDef::writeDocumentation(OutputList &ol) } parseText(ol,inheritLine.right(inheritLine.length()-index)); ol.newParagraph(); - -#if 0 - parseText(ol,theTranslator->trInheritedBy()+" "); - BaseClassDef *bcd=inheritedBy->first(); - while (bcd) - { - ClassDef *cd=bcd->classDef; - if (cd->hasDocumentation() || cd->isReference()) - { - ol.writeObjectLink(cd->getReference(),cd->classFile(),0,cd->name()); - } - else - { - ol.docify(cd->name()); - } - writeInheritanceSpecifier(ol,bcd); - bcd=inheritedBy->next(); - if (bcd) - { - if (inheritedBy->at()==count-1) - parseText(ol," "+theTranslator->trAnd()+" "); - else - ol.writeString(", "); - } - } - ol.writeString("."); - ol.newParagraph(); -#endif } - if (classDiagramFlag) ol.enableAll(); + if (Config::classDiagramFlag) ol.enableAll(); count=0; BaseClassDef *ibcd; @@ -419,23 +364,17 @@ void ClassDef::writeDocumentation(OutputList &ol) while (ibcd) { ClassDef *icd=ibcd->classDef; - if (//(icd->protection()!=Private || extractPrivateFlag) && - //(icd->hasDocumentation() || !hideClassFlag || icd->isReference()) - icd->isVisibleExt() - ) count++; + if ( icd->isVisibleExt()) count++; ibcd=inheritedBy->next(); } ibcd=inherits->first(); while (ibcd) { ClassDef *icd=ibcd->classDef; - if (//(icd->protection()!=Private || extractPrivateFlag) && - //(icd->hasDocumentation() || !hideClassFlag | icd->isReference()) - icd->isVisibleExt() - ) count++; + if ( icd->isVisibleExt()) count++; ibcd=inherits->next(); } - if (classDiagramFlag && count>0) + if (Config::classDiagramFlag && count>0) // write class diagram { ClassDiagram diagram(this); // create a diagram of this class. @@ -465,7 +404,7 @@ void ClassDef::writeDocumentation(OutputList &ol) writeMemberDecs(ol,this,0,0,theTranslator->trProtectedMembers(),0,&proMembers); writeMemberDecs(ol,this,0,0,theTranslator->trProtectedSlots(),0,&proSlots); writeMemberDecs(ol,this,0,0,theTranslator->trStaticProtectedMembers(),0,&proStaticMembers); - if (extractPrivateFlag) + if (Config::extractPrivateFlag) { writeMemberDecs(ol,this,0,0,theTranslator->trPrivateMembers(),0,&priMembers); writeMemberDecs(ol,this,0,0,theTranslator->trPrivateSlots(),0,&priSlots); @@ -491,10 +430,28 @@ void ClassDef::writeDocumentation(OutputList &ol) ol.startGroupHeader(); parseText(ol,theTranslator->trDetailedDescription()); ol.endGroupHeader(); - if (tempArgs) // class is a template + + ArgumentList *al=0; + int ti; + ClassDef *pcd=0; + int pi=0; + // find the outer most class scope + while ((ti=name().find("::",pi))!=-1 && + (pcd=getClass(name().left(ti)))==0 + ) pi=ti+2; + + if (pcd) + { + al=pcd->templateArguments(); + } + else + { + al=tempArgs; + } + + if (al) // class is a template { ol.startSubsubsection(); - ArgumentList *al=tempArgs; ol.docify("template<"); Argument *a=al->first(); while (a) @@ -554,7 +511,7 @@ void ClassDef::writeDocumentation(OutputList &ol) signals.countDocMembers(); if ( pubMembers.typedefCount() + proMembers.typedefCount() + - (extractPrivateFlag ? priMembers.typedefCount() : 0 ) + (Config::extractPrivateFlag ? priMembers.typedefCount() : 0 ) ) { ol.writeRuler(); @@ -564,7 +521,7 @@ void ClassDef::writeDocumentation(OutputList &ol) writeMemberDocs(ol,&pubMembers,name(),MemberDef::Typedef); writeMemberDocs(ol,&proMembers,name(),MemberDef::Typedef); - if (extractPrivateFlag) + if (Config::extractPrivateFlag) { writeMemberDocs(ol,&priMembers,name(),MemberDef::Typedef); } @@ -572,7 +529,7 @@ void ClassDef::writeDocumentation(OutputList &ol) if (pubMembers.enumCount() + proMembers.enumCount() + - ( extractPrivateFlag ? priMembers.enumCount() : 0 ) + ( Config::extractPrivateFlag ? priMembers.enumCount() : 0 ) ) { ol.writeRuler(); @@ -582,7 +539,7 @@ void ClassDef::writeDocumentation(OutputList &ol) writeMemberDocs(ol,&pubMembers,name(),MemberDef::Enumeration); writeMemberDocs(ol,&proMembers,name(),MemberDef::Enumeration); - if (extractPrivateFlag) + if (Config::extractPrivateFlag) { writeMemberDocs(ol,&priMembers,name(),MemberDef::Enumeration); } @@ -590,7 +547,7 @@ void ClassDef::writeDocumentation(OutputList &ol) if (pubMembers.enumValueCount() + proMembers.enumValueCount() + - ( extractPrivateFlag ? priMembers.enumValueCount() : 0 ) + ( Config::extractPrivateFlag ? priMembers.enumValueCount() : 0 ) ) { ol.writeRuler(); @@ -600,7 +557,7 @@ void ClassDef::writeDocumentation(OutputList &ol) writeMemberDocs(ol,&pubMembers,name(),MemberDef::EnumValue); writeMemberDocs(ol,&proMembers,name(),MemberDef::EnumValue); - if (extractPrivateFlag) + if (Config::extractPrivateFlag) { writeMemberDocs(ol,&priMembers,name(),MemberDef::EnumValue); } @@ -610,7 +567,7 @@ void ClassDef::writeDocumentation(OutputList &ol) pubStaticMembers.funcCount() + proMembers.funcCount() + proSlots.funcCount() + proStaticMembers.funcCount() + - (extractPrivateFlag ? + (Config::extractPrivateFlag ? priMembers.funcCount() + priSlots.funcCount() + priStaticMembers.funcCount() : 0 ) @@ -628,7 +585,7 @@ void ClassDef::writeDocumentation(OutputList &ol) writeMemberDocs(ol,&proMembers,name(),MemberDef::Function); writeMemberDocs(ol,&proSlots,name(),MemberDef::Slot); writeMemberDocs(ol,&proStaticMembers,name(),MemberDef::Function); - if (extractPrivateFlag) + if (Config::extractPrivateFlag) { writeMemberDocs(ol,&priMembers,name(),MemberDef::Function); writeMemberDocs(ol,&priSlots,name(),MemberDef::Slot); @@ -636,7 +593,7 @@ void ClassDef::writeDocumentation(OutputList &ol) } } - if ( friends.count() + related.count() ) + if ( friends.friendCount() + related.count() ) { ol.writeRuler(); ol.startGroupHeader(); @@ -649,7 +606,7 @@ void ClassDef::writeDocumentation(OutputList &ol) if ( pubMembers.varCount() + pubStaticMembers.varCount() + proMembers.varCount() + proStaticMembers.varCount() + - (extractPrivateFlag ? + (Config::extractPrivateFlag ? priMembers.varCount() + priStaticMembers.varCount() : 0 ) ) @@ -663,7 +620,7 @@ void ClassDef::writeDocumentation(OutputList &ol) writeMemberDocs(ol,&pubStaticMembers,name(),MemberDef::Variable); writeMemberDocs(ol,&proMembers,name(),MemberDef::Variable); writeMemberDocs(ol,&proStaticMembers,name(),MemberDef::Variable); - if (extractPrivateFlag) + if (Config::extractPrivateFlag) { writeMemberDocs(ol,&priMembers,name(),MemberDef::Variable); writeMemberDocs(ol,&priStaticMembers,name(),MemberDef::Variable); @@ -691,13 +648,13 @@ void ClassDef::writeDocumentation(OutputList &ol) } ol.writeListItem(); - QString path=fd->getPath().copy(); - if (fullPathNameFlag) + QCString path=fd->getPath().copy(); + if (Config::fullPathNameFlag) { // strip part of the path - if (path.left(stripFromPath.length())==stripFromPath) + if (path.left(Config::stripFromPath.length())==Config::stripFromPath) { - path=path.right(path.length()-stripFromPath.length()); + path=path.right(path.length()-Config::stripFromPath.length()); } ol.docify(path); } @@ -723,7 +680,7 @@ void ClassDef::writeDocumentation(OutputList &ol) ol.startGroupHeader(); parseText(ol,theTranslator->trAuthor()); ol.endGroupHeader(); - parseText(ol,theTranslator->trGeneratedAutomatically(projectName)); + parseText(ol,theTranslator->trGeneratedAutomatically(Config::projectName)); ol.enableAll(); endFile(ol); @@ -776,7 +733,7 @@ void ClassDef::writeMemberList(OutputList &ol) if (cd && !md->name().isEmpty() && md->name()[0]!='@' && ( md->isFriend() || - (mi->prot!=Private && (protect!=Private || extractPrivateFlag)) + (mi->prot!=Private && (protect!=Private || Config::extractPrivateFlag)) ) ) { @@ -784,7 +741,7 @@ void ClassDef::writeMemberList(OutputList &ol) if (cd->isVisible() && (md->hasDocumentation() || md->isReference())) // create a link to the documentation { - QString name=mi->ambiguityResolutionScope+md->name(); + QCString name=mi->ambiguityResolutionScope+md->name(); ol.writeListItem(); ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(), md->anchor(),name); @@ -801,7 +758,7 @@ void ClassDef::writeMemberList(OutputList &ol) ol.writeString("\n"); memberWritten=TRUE; } - else if (!hideMemberFlag) // no documentation, + else if (!Config::hideMemberFlag) // no documentation, // generate link to the class instead. { ol.writeListItem(); @@ -874,7 +831,7 @@ void ClassDef::writeIncludeFile(OutputList &ol) ol.disableAllBut(OutputGenerator::Html); startFile(ol,fileName+"-include",name()+" Include File"); startTitle(ol); - QString n=incName.copy(); + QCString n=incName.copy(); if (incName.isNull()) n=incFile->name(); parseText(ol,n); endTitle(ol,0); @@ -917,7 +874,7 @@ bool ClassDef::hasExamples() // write the list of all examples that are use this class. void ClassDef::writeExample(OutputList &ol) { - QString exampleLine=theTranslator->trWriteList(exampleList->count()); + QCString exampleLine=theTranslator->trWriteList(exampleList->count()); QRegExp marker("@[0-9]+"); int index=0,newIndex,matchLen; @@ -970,9 +927,9 @@ void ClassDef::setTemplateArguments(ArgumentList *al) } } -QString ClassDef::getTemplateNameString() +QCString ClassDef::getTemplateNameString() { - QString result; + QCString result; if (!tempArgs || tempArgs->count()==0) return result; result="<"; Argument *a=tempArgs->first(); diff --git a/src/classdef.h b/src/classdef.h index d5fc466..dd24b69 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -17,11 +17,11 @@ #ifndef CLASSDEF_H #define CLASSDEF_H -#include <qstring.h> +//#include <qtstream.h> +#include "qtbc.h" #include <qfileinf.h> #include <qlist.h> #include <qdict.h> -#include <qtstream.h> #include <qstrlist.h> #include "membername.h" @@ -51,8 +51,8 @@ class ClassDef : public Definition ClassDef(const char *name,CompoundType ct,const char *ref=0,const char *fName=0); ~ClassDef(); - //QString classFile() const { return fileName; } - QString getOutputFileBase() const { return fileName; } + //QCString classFile() const { return fileName; } + QCString getOutputFileBase() const { return fileName; } CompoundType compoundType() const { return compType; } const char *memberListFileName() const { return memListFileName; } void insertBaseClass(ClassDef *,Protection p,Specifier s,const char *t=0); @@ -81,34 +81,35 @@ class ClassDef : public Definition Protection protection() const { return prot; } bool isVisible() { return !name().isEmpty() && name().at(0)!='@' && - (prot!=Private || extractPrivateFlag) && + (prot!=Private || Config::extractPrivateFlag) && hasDocumentation(); } bool hasNonReferenceSuperClass(); bool isVisibleExt() - { return (allExtFlag || hasNonReferenceSuperClass()) && + { return (Config::allExtFlag || hasNonReferenceSuperClass()) && !name().isEmpty() && name().at(0)!='@' && - (prot!=Private || extractPrivateFlag) && - (hasDocumentation() || !hideClassFlag || !reference.isNull()); + (prot!=Private || Config::extractPrivateFlag) && + (hasDocumentation() || !Config::hideClassFlag || + !reference.isNull()); } // template argument functions ArgumentList *templateArguments() const { return tempArgs; } void setTemplateArguments(ArgumentList *al); - QString getTemplateNameString(); + QCString getTemplateNameString(); void setNamespace(NamespaceDef *nd) { nspace = nd; } NamespaceDef *getNamespace() { return nspace; } bool visited; private: - //QString name; // name of the class - QString fileName; // HTML containing the class docs - //QString doc; // general class documentation + //QCString name; // name of the class + QCString fileName; // HTML containing the class docs + //QCString doc; // general class documentation FileDef *incFile; // header file to refer to - QString incName; // alternative include file name - //QString brief; // brief class discription - QString memListFileName; + QCString incName; // alternative include file name + //QCString brief; // brief class discription + QCString memListFileName; BaseClassList *inherits; BaseClassList *inheritedBy; NamespaceDef *nspace; // the namespace this class is in @@ -128,7 +129,7 @@ class ClassDef : public Definition MemberNameInfoDict *allMemberNameInfoDict; ArgumentList *tempArgs; QStrList files; - QString reference; + QCString reference; ExampleList *exampleList; ExampleDict *exampleDict; CompoundType compType; @@ -143,7 +144,7 @@ struct BaseClassDef ClassDef *classDef; Protection prot; Specifier virt; - QString templSpecifiers; + QCString templSpecifiers; }; class BaseClassList : public QList<BaseClassDef> @@ -17,12 +17,12 @@ #ifndef CODE_H #define CODE_H +#include "qtbc.h" #include <stdio.h> -#include <qstring.h> class OutputList; -extern void parseCode(OutputList &,const char *,const QString &, +extern void parseCode(OutputList &,const char *,const QCString &, bool ,const char *); extern void initParseCodeContext(); #endif @@ -24,8 +24,7 @@ #include <assert.h> #include <ctype.h> -#include <qstring.h> - +#include "qtbc.h" #include "scanner.h" #include "entry.h" #include "doxygen.h" @@ -47,7 +46,7 @@ class CodeClassDef } ~CodeClassDef() {} - QString name; + QCString name; QStrList bases; }; @@ -63,9 +62,9 @@ class CodeVarDef } ~CodeVarDef() {} - QString name; - QString type; - QString classScope; + QCString name; + QCString type; + QCString classScope; }; typedef QList<CodeClassDef> CodeClassList; @@ -91,19 +90,19 @@ static int bracketCount = 0; static int curlyCount = 0; static int sharpCount = 0; static int yyLineNr = 0; -static QString type; -static QString name; -static QString args; -static QString parmType; -static QString parmName; +static QCString type; +static QCString name; +static QCString args; +static QCString parmType; +static QCString parmName; static bool inClass; -static QString classScope; +static QCString classScope; static OutputList *code; static CodeClassDef ccd; static CodeVarDef cvd; static bool exampleBlock; -static QString exampleName; -static QString exampleFile; +static QCString exampleName; +static QCString exampleFile; static int anchorCount; static void addType() @@ -125,9 +124,9 @@ static void addParmType() parmName.resize(0) ; } -static void setClassScope(const QString &name) +static void setClassScope(const QCString &name) { - QString n=name; + QCString n=name; n=n.simplifyWhiteSpace(); int index; if ((index=n.find("::"))!=-1) @@ -165,14 +164,14 @@ static void addParameter() static void generateClassLink(OutputList &ol,const char *clName) { - QString className=clName; + QCString className=clName; if (className.length()==0) return; ClassDef *cd; if ((cd=getClass(className)) && cd->isVisible()) { if (exampleBlock) { - QString anchor; + QCString anchor; anchor.sprintf("_a%d",anchorCount); //printf("addExampleClass(%s,%s,%s)\n",anchor.data(),exampleName.data(), // exampleFile.data()); @@ -200,16 +199,16 @@ static bool getLink(const char *className, ClassDef *cd; FileDef *fd; NamespaceDef *nd; - QString m=memberName; - QString c=className; + QCString m=memberName; + QCString c=className; //printf("Trying `%s'::`%s'\n",c.data(),m.data()); - if (getDefs(m,c,"()",md,cd,fd,nd) && + if (getDefs(c,m,"()",md,cd,fd,nd) && (md->hasDocumentation() || md->isReference())) { //printf("Found!\n"); if (exampleBlock) { - QString anchor; + QCString anchor; anchor.sprintf("a%d",anchorCount); //printf("addExampleFile(%s,%s,%s)\n",anchor.data(),exampleName.data(), // exampleFile.data()); @@ -339,6 +338,8 @@ static int yyread(char *buf,int max_size) ID [a-z_A-Z][a-z_A-Z0-9]* +%option noyywrap + %x SkipString %x SkipCPP %x SkipComment @@ -380,7 +381,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]* code->codify(yytext); } char c=yyinput(); - QString text; + QCString text; text+=c; code->codify(text); BEGIN( Body ); @@ -663,7 +664,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]* } <SkipSpecialComment>[ \t]*"*/"[ \t\n]*"\n"/"/*" { //code->codify("\n"); - QString lineText=yytext; + QCString lineText=yytext; yyLineNr+=lineText.contains('\n'); BEGIN( lastDContext ) ; } @@ -700,7 +701,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]* code->codify(yytext); } <*>([ \t\n]*"\n"){2,} { // combine multiple blank lines - QString sepLine=yytext; + QCString sepLine=yytext; code->codify("\n\n"); yyLineNr+=sepLine.contains('\n'); } @@ -723,7 +724,7 @@ void initParseCodeContext() anchorCount = 0; } -void parseCode(OutputList &ol,const char *className,const QString &s, +void parseCode(OutputList &ol,const char *className,const QCString &s, bool e, const char *exName) { code = new OutputList(&ol); @@ -752,6 +753,6 @@ void parseCode(OutputList &ol,const char *className,const QString &s, } extern "C" { // some bogus code to keep the compiler happy - int codeYYwrap() { return 1 ; } +// int codeYYwrap() { return 1 ; } void codeYYdummy() { yy_flex_realloc(0,0); } } diff --git a/src/config.h b/src/config.h index 492f356..d2bec11 100644 --- a/src/config.h +++ b/src/config.h @@ -17,66 +17,78 @@ #ifndef CONFIG_H #define CONFIG_H -#include <qstring.h> +#ifndef DOXYWIZARD +#include "qtbc.h" +#endif #include <qstrlist.h> #include <qfile.h> -extern void parseConfig(const QString &config); +extern void parseConfig(const QCString &config); extern void writeTemplateConfig(QFile *f,bool shortList); +extern void checkConfig(); + +struct Config +{ + static void init(); -extern QString projectName; // the name of the project -extern QString projectNumber; // the number of the project -extern QString htmlOutputDir; // the directory to put the HTML files -extern QString latexOutputDir; // the directory to put the Latex files -extern QString manOutputDir; // the directory to put the man pages -extern QString headerFile; // the name of the personal HTML header -extern QString footerFile; // the name of the personal HTML footer -extern QString cgiName; // the name of the CGI binary -extern QString cgiURL; // the absolute URL to the CGI binary -extern QString docURL; // the absolute URL to the documentation -extern QString binAbsPath; // the absolute path to the doxysearch -extern QString docAbsPath; // the absolute path to the documentation -extern QString perlPath; // the absolute path to perl -extern QString genTagFile; // the tag file to generate -extern QString inputFilter; // a filter command that is applied to input files -extern QString paperType; // the page type to generate docs for -extern QString stripFromPath; // the string to strip from the file path -extern QString manExtension; // extension the man page files -extern QStrList includePath; // list of include paths -extern QStrList examplePath; // list of example paths -extern QStrList inputSources; // list of input files -extern QStrList excludeSources; // list of files to exclude from the input -extern QStrList filePatternList; // list of file patterns -extern QStrList excludePatternList; // list of patterns to exclude from input -extern QStrList tagFileList; // list of tag files -extern QStrList extDocPathList; // list of external doc. directories. -extern QStrList predefined; // list of predefined macro names. -extern QStrList extraPackageList; // list of extra LaTeX packages. -extern bool quietFlag; // generate progress messages flag -extern bool warningFlag; // generate warnings flag -extern bool recursiveFlag; // scan directories recursively -extern bool allExtFlag; // include all external classes flag -extern bool searchEngineFlag; // generate search engine flag -extern bool extractAllFlag; // gererate docs for all classes flag -extern bool extractPrivateFlag; // generate docs for private members flag -extern bool noIndexFlag; // generate condensed index flag -extern bool generateHtml; // generate HTML output -extern bool generateLatex; // generate Latex output -extern bool generateMan; // generate Man pages -extern bool preprocessingFlag; // enable preprocessing -extern bool briefMemDescFlag; // enable `inline' brief member descr. -extern bool hideMemberFlag; // hide undocumented members. -extern bool hideClassFlag; // hide undocumented members. -extern bool searchIncludeFlag; // search for included files -extern bool macroExpansionFlag; // expand macros in the source. -extern bool onlyPredefinedFlag; // expand only predefined macros -extern bool fullPathNameFlag; // using full path name in output -extern bool classDiagramFlag; // enable the generation of class diagrams. -extern bool compactLatexFlag; // generate compact LaTeX documentation. -extern bool repeatBriefFlag; // repeat brief descriptions. -extern bool internalDocsFlag; // determines what happens to internal docs. -extern bool caseSensitiveNames; // determines if output can be mixed case. -extern bool verbatimHeaderFlag; // enable/disable generation of verb headers. -extern bool htmlAlignMemberFlag; // align members in HTML using tables. + static QCString projectName; // the name of the project + static QCString projectNumber; // the number of the project + static QCString outputDir; // the global output directory + static QCString htmlOutputDir; // the directory to put the HTML files + static QCString latexOutputDir; // the directory to put the Latex files + static QCString manOutputDir; // the directory to put the man pages + static QCString outputLanguage; // the output language + static QCString headerFile; // the name of the personal HTML header + static QCString footerFile; // the name of the personal HTML footer + static QCString cgiName; // the name of the CGI binary + static QCString cgiURL; // the absolute URL to the CGI binary + static QCString docURL; // the absolute URL to the documentation + static QCString binAbsPath; // the absolute path to the doxysearch + static QCString docAbsPath; // the absolute path to the documentation + static QCString perlPath; // the absolute path to perl + static QCString genTagFile; // the tag file to generate + static QCString inputFilter; // a filter command that is applied to input files + static QCString paperType; // the page type to generate docs for + static QCString stripFromPath; // the string to strip from the file path + static QCString manExtension; // extension the man page files + static QStrList includePath; // list of include paths + static QStrList examplePath; // list of example paths + static QStrList inputSources; // list of input files + static QStrList excludeSources; // list of files to exclude from the input + static QStrList filePatternList; // list of file patterns + static QStrList excludePatternList; // list of patterns to exclude from input + static QStrList tagFileList; // list of tag files + static QStrList extDocPathList; // list of external doc. directories. + static QStrList predefined; // list of predefined macro names. + static QStrList extraPackageList; // list of extra LaTeX packages. + static bool quietFlag; // generate progress messages flag + static bool warningFlag; // generate warnings flag + static bool recursiveFlag; // scan directories recursively + static bool allExtFlag; // include all external classes flag + static bool searchEngineFlag; // generate search engine flag + static bool extractAllFlag; // gererate docs for all classes flag + static bool extractPrivateFlag; // generate docs for private members flag + static bool noIndexFlag; // generate condensed index flag + static bool generateHtml; // generate HTML output + static bool generateLatex; // generate Latex output + static bool generateMan; // generate Man pages + static bool preprocessingFlag; // enable preprocessing + static bool briefMemDescFlag; // enable `inline' brief member descr. + static bool hideMemberFlag; // hide undocumented members. + static bool hideClassFlag; // hide undocumented members. + static bool searchIncludeFlag; // search for included files + static bool macroExpansionFlag; // expand macros in the source. + static bool onlyPredefinedFlag; // expand only predefined macros + static bool fullPathNameFlag; // using full path name in output + static bool classDiagramFlag; // enable the generation of class diagrams. + static bool compactLatexFlag; // generate compact LaTeX documentation. + static bool repeatBriefFlag; // repeat brief descriptions. + static bool internalDocsFlag; // determines what happens to internal docs. + static bool caseSensitiveNames; // determines if output can be mixed case. + static bool verbatimHeaderFlag; // enable/disable generation of verb headers. + static bool htmlAlignMemberFlag; // align members in HTML using tables. + static bool includeSourceFlag; // include source code in documentation. + static bool autoBriefFlag; // javadoc comments behaves as Qt comments. +}; #endif diff --git a/src/config.l b/src/config.l index 0545f32..57897e9 100644 --- a/src/config.l +++ b/src/config.l @@ -24,17 +24,36 @@ #include <assert.h> #include <ctype.h> -#include <qstring.h> #include <qfileinf.h> #include <qdir.h> #include <qtstream.h> -#include "doxygen.h" #include "config.h" +#include "version.h" + +#ifdef DOXYWIZARD +#include <stdarg.h> +void err(const char *fmt, ...) +{ + va_list args; + va_start(args, fmt); + vfprintf(stderr, fmt, args); + va_end(args); +} +void warn(const char *fmt, ...) +{ + va_list args; + va_start(args, fmt); + vfprintf(stderr, fmt, args); + va_end(args); +} +#else +#include "doxygen.h" #include "message.h" #include "pre.h" #include "version.h" #include "language.h" +#endif #define YY_NEVER_INTERACTIVE 1 @@ -43,62 +62,65 @@ * exported variables */ -QString projectName; -QString projectNumber; -QString outputDir; -QString htmlOutputDir; -QString latexOutputDir; -QString manOutputDir; -QString headerFile; -QString footerFile; -QString cgiName; -QString cgiURL; -QString docURL; -QString binAbsPath; -QString docAbsPath; -QString perlPath; -QString genTagFile; -QString inputFilter; -QString paperType; -QString outputLanguage; -QString stripFromPath; -QString manExtension; -QStrList includePath; -QStrList examplePath; -QStrList inputSources; -QStrList excludeSources; -QStrList filePatternList; -QStrList excludePatternList; -QStrList tagFileList; -QStrList extDocPathList; -QStrList predefined; -QStrList extraPackageList; -bool quietFlag = FALSE; -bool warningFlag = FALSE; -bool recursiveFlag = FALSE; -bool allExtFlag = FALSE; -bool searchEngineFlag = FALSE; -bool extractAllFlag = FALSE; -bool extractPrivateFlag = FALSE; -bool noIndexFlag = FALSE; -bool hideMemberFlag = FALSE; -bool hideClassFlag = FALSE; -bool macroExpansionFlag = FALSE; -bool onlyPredefinedFlag = FALSE; -bool fullPathNameFlag = FALSE; -bool compactLatexFlag = FALSE; -bool internalDocsFlag = FALSE; -bool caseSensitiveNames = FALSE; -bool generateHtml = TRUE; -bool generateLatex = TRUE; -bool generateMan = TRUE; -bool preprocessingFlag = TRUE; -bool briefMemDescFlag = TRUE; -bool searchIncludeFlag = TRUE; -bool classDiagramFlag = TRUE; -bool repeatBriefFlag = TRUE; -bool verbatimHeaderFlag = TRUE; -bool htmlAlignMemberFlag = TRUE; + +QCString Config::projectName; +QCString Config::projectNumber; +QCString Config::outputDir; +QCString Config::htmlOutputDir; +QCString Config::latexOutputDir; +QCString Config::manOutputDir; +QCString Config::outputLanguage; +QCString Config::headerFile; +QCString Config::footerFile; +QCString Config::cgiName; +QCString Config::cgiURL; +QCString Config::docURL; +QCString Config::binAbsPath; +QCString Config::docAbsPath; +QCString Config::perlPath; +QCString Config::genTagFile; +QCString Config::inputFilter; +QCString Config::paperType; +QCString Config::stripFromPath; +QCString Config::manExtension; +QStrList Config::includePath; +QStrList Config::examplePath; +QStrList Config::inputSources; +QStrList Config::excludeSources; +QStrList Config::filePatternList; +QStrList Config::excludePatternList; +QStrList Config::tagFileList; +QStrList Config::extDocPathList; +QStrList Config::predefined; +QStrList Config::extraPackageList; +bool Config::quietFlag = FALSE; +bool Config::recursiveFlag = FALSE; +bool Config::allExtFlag = FALSE; +bool Config::searchEngineFlag = FALSE; +bool Config::extractAllFlag = FALSE; +bool Config::extractPrivateFlag = FALSE; +bool Config::noIndexFlag = FALSE; +bool Config::hideMemberFlag = FALSE; +bool Config::hideClassFlag = FALSE; +bool Config::macroExpansionFlag = FALSE; +bool Config::onlyPredefinedFlag = FALSE; +bool Config::fullPathNameFlag = FALSE; +bool Config::compactLatexFlag = FALSE; +bool Config::internalDocsFlag = FALSE; +bool Config::caseSensitiveNames = FALSE; +bool Config::includeSourceFlag = FALSE; +bool Config::autoBriefFlag = TRUE; +bool Config::warningFlag = TRUE; +bool Config::generateHtml = TRUE; +bool Config::generateLatex = TRUE; +bool Config::generateMan = TRUE; +bool Config::preprocessingFlag = TRUE; +bool Config::briefMemDescFlag = TRUE; +bool Config::searchIncludeFlag = TRUE; +bool Config::classDiagramFlag = TRUE; +bool Config::repeatBriefFlag = TRUE; +bool Config::verbatimHeaderFlag = TRUE; +bool Config::htmlAlignMemberFlag = TRUE; /* ----------------------------------------------------------------- * @@ -108,13 +130,13 @@ bool htmlAlignMemberFlag = TRUE; static const char * inputString; static int inputPosition; static int yyLineNr; -static QString tmpString; -static QString * s=0; +static QCString tmpString; +static QCString * s=0; static bool * b=0; static QStrList * l=0; static int lastState; static int lastEnvState; -static QString elemStr; +static QCString elemStr; /* ----------------------------------------------------------------- */ @@ -134,6 +156,8 @@ static int yyread(char *buf,int max_size) %} +%option noyywrap + %x Start %x SkipComment %x GetString @@ -146,62 +170,64 @@ static int yyread(char *buf,int max_size) <*>\0x0d <Start,GetString,GetStrList,GetBool>"#" { BEGIN(SkipComment); } -<Start>"PROJECT_NAME"[ \t]*"=" { BEGIN(GetString); s=&projectName; } -<Start>"PROJECT_NUMBER"[ \t]*"=" { BEGIN(GetString); s=&projectNumber; } -<Start>"OUTPUT_DIRECTORY"[ \t]*"=" { BEGIN(GetString); s=&outputDir; } -<Start>"HTML_OUTPUT"[ \t]*"=" { BEGIN(GetString); s=&htmlOutputDir; } -<Start>"MAN_OUTPUT"[ \t]*"=" { BEGIN(GetString); s=&manOutputDir; } -<Start>"LATEX_OUTPUT"[ \t]*"=" { BEGIN(GetString); s=&latexOutputDir; } -<Start>"HTML_HEADER"[ \t]*"=" { BEGIN(GetString); s=&headerFile; } -<Start>"HTML_FOOTER"[ \t]*"=" { BEGIN(GetString); s=&footerFile; } -<Start>"CGI_NAME"[ \t]*"=" { BEGIN(GetString); s=&cgiName; } -<Start>"CGI_URL"[ \t]*"=" { BEGIN(GetString); s=&cgiURL; } -<Start>"DOC_URL"[ \t]*"=" { BEGIN(GetString); s=&docURL; } -<Start>"BIN_ABSPATH"[ \t]*"=" { BEGIN(GetString); s=&binAbsPath; } -<Start>"DOC_ABSPATH"[ \t]*"=" { BEGIN(GetString); s=&docAbsPath; } -<Start>"PERL_PATH"[ \t]*"=" { BEGIN(GetString); s=&perlPath; } -<Start>"GENERATE_TAGFILE"[ \t]*"=" { BEGIN(GetString); s=&genTagFile; } -<Start>"INPUT_FILTER"[ \t]*"=" { BEGIN(GetString); s=&inputFilter; } -<Start>"PAPER_TYPE"[ \t]*"=" { BEGIN(GetString); s=&paperType; } -<Start>"OUTPUT_LANGUAGE"[ \t]*"=" { BEGIN(GetString); s=&outputLanguage; } -<Start>"STRIP_FROM_PATH"[ \t]*"=" { BEGIN(GetString); s=&stripFromPath; } -<Start>"MAN_EXTENSION"[ \t]*"=" { BEGIN(GetString); s=&manExtension; } -<Start>"INCLUDE_PATH"[ \t]*"=" { BEGIN(GetStrList); l=&includePath; elemStr=""; } -<Start>"EXAMPLE_PATH"[ \t]*"=" { BEGIN(GetStrList); l=&examplePath; elemStr=""; } -<Start>"INPUT"[ \t]*"=" { BEGIN(GetStrList); l=&inputSources; elemStr=""; } -<Start>"EXCLUDE"[ \t]*"=" { BEGIN(GetStrList); l=&excludeSources; elemStr=""; } -<Start>"FILE_PATTERNS"[ \t]*"=" { BEGIN(GetStrList); l=&filePatternList; elemStr=""; } -<Start>"EXCLUDE_PATTERNS"[ \t]*"=" { BEGIN(GetStrList); l=&excludePatternList; elemStr=""; } -<Start>"TAGFILES"[ \t]*"=" { BEGIN(GetStrList); l=&tagFileList; elemStr=""; } -<Start>"EXT_DOC_PATHS"[ \t]*"=" { BEGIN(GetStrList); l=&extDocPathList; elemStr=""; } -<Start>"PREDEFINED"[ \t]*"=" { BEGIN(GetStrList); l=&predefined; elemStr=""; } -<Start>"EXTRA_PACKAGES"[ \t]*"=" { BEGIN(GetStrList); l=&extraPackageList; elemStr=""; } -<Start>"QUIET"[ \t]*"=" { BEGIN(GetBool); b=&quietFlag; } -<Start>"WARNINGS"[ \t]*"=" { BEGIN(GetBool); b=&warningFlag; } -<Start>"RECURSIVE"[ \t]*"=" { BEGIN(GetBool); b=&recursiveFlag; } -<Start>"ALLEXTERNALS"[ \t]*"=" { BEGIN(GetBool); b=&allExtFlag; } -<Start>"SEARCHENGINE"[ \t]*"=" { BEGIN(GetBool); b=&searchEngineFlag; } -<Start>"EXTRACT_ALL"[ \t]*"=" { BEGIN(GetBool); b=&extractAllFlag; } -<Start>"EXTRACT_PRIVATE"[ \t]*"=" { BEGIN(GetBool); b=&extractPrivateFlag; } -<Start>"DISABLE_INDEX"[ \t]*"=" { BEGIN(GetBool); b=&noIndexFlag; } -<Start>"GENERATE_LATEX"[ \t]*"=" { BEGIN(GetBool); b=&generateLatex; } -<Start>"GENERATE_HTML"[ \t]*"=" { BEGIN(GetBool); b=&generateHtml; } -<Start>"GENERATE_MAN"[ \t]*"=" { BEGIN(GetBool); b=&generateMan; } -<Start>"ENABLE_PREPROCESSING"[ \t]*"=" { BEGIN(GetBool); b=&preprocessingFlag; } -<Start>"MACRO_EXPANSION"[ \t]*"=" { BEGIN(GetBool); b=¯oExpansionFlag; } -<Start>"SEARCH_INCLUDES"[ \t]*"=" { BEGIN(GetBool); b=&searchIncludeFlag; } -<Start>"BRIEF_MEMBER_DESC"[ \t]*"=" { BEGIN(GetBool); b=&briefMemDescFlag; } -<Start>"HIDE_UNDOC_MEMBERS"[ \t]*"=" { BEGIN(GetBool); b=&hideMemberFlag; } -<Start>"HIDE_UNDOC_CLASSES"[ \t]*"=" { BEGIN(GetBool); b=&hideClassFlag; } -<Start>"EXPAND_ONLY_PREDEF"[ \t]*"=" { BEGIN(GetBool); b=&onlyPredefinedFlag; } -<Start>"FULL_PATH_NAMES"[ \t]*"=" { BEGIN(GetBool); b=&fullPathNameFlag; } -<Start>"CLASS_DIAGRAMS"[ \t]*"=" { BEGIN(GetBool); b=&classDiagramFlag; } -<Start>"COMPACT_LATEX"[ \t]*"=" { BEGIN(GetBool); b=&compactLatexFlag; } -<Start>"REPEAT_BRIEF"[ \t]*"=" { BEGIN(GetBool); b=&repeatBriefFlag; } -<Start>"INTERNAL_DOCS"[ \t]*"=" { BEGIN(GetBool); b=&internalDocsFlag; } -<Start>"CASE_SENSE_NAMES"[ \t]*"=" { BEGIN(GetBool); b=&caseSensitiveNames; } -<Start>"VERBATIM_HEADERS"[ \t]*"=" { BEGIN(GetBool); b=&verbatimHeaderFlag; } -<Start>"HTML_ALIGN_MEMBERS"[ \t]*"=" { BEGIN(GetBool); b=&htmlAlignMemberFlag; } +<Start>"PROJECT_NAME"[ \t]*"=" { BEGIN(GetString); s=&Config::projectName; } +<Start>"PROJECT_NUMBER"[ \t]*"=" { BEGIN(GetString); s=&Config::projectNumber; } +<Start>"OUTPUT_DIRECTORY"[ \t]*"=" { BEGIN(GetString); s=&Config::outputDir; } +<Start>"HTML_OUTPUT"[ \t]*"=" { BEGIN(GetString); s=&Config::htmlOutputDir; } +<Start>"MAN_OUTPUT"[ \t]*"=" { BEGIN(GetString); s=&Config::manOutputDir; } +<Start>"LATEX_OUTPUT"[ \t]*"=" { BEGIN(GetString); s=&Config::latexOutputDir; } +<Start>"HTML_HEADER"[ \t]*"=" { BEGIN(GetString); s=&Config::headerFile; } +<Start>"HTML_FOOTER"[ \t]*"=" { BEGIN(GetString); s=&Config::footerFile; } +<Start>"CGI_NAME"[ \t]*"=" { BEGIN(GetString); s=&Config::cgiName; } +<Start>"CGI_URL"[ \t]*"=" { BEGIN(GetString); s=&Config::cgiURL; } +<Start>"DOC_URL"[ \t]*"=" { BEGIN(GetString); s=&Config::docURL; } +<Start>"BIN_ABSPATH"[ \t]*"=" { BEGIN(GetString); s=&Config::binAbsPath; } +<Start>"DOC_ABSPATH"[ \t]*"=" { BEGIN(GetString); s=&Config::docAbsPath; } +<Start>"PERL_PATH"[ \t]*"=" { BEGIN(GetString); s=&Config::perlPath; } +<Start>"GENERATE_TAGFILE"[ \t]*"=" { BEGIN(GetString); s=&Config::genTagFile; } +<Start>"INPUT_FILTER"[ \t]*"=" { BEGIN(GetString); s=&Config::inputFilter; } +<Start>"PAPER_TYPE"[ \t]*"=" { BEGIN(GetString); s=&Config::paperType; } +<Start>"OUTPUT_LANGUAGE"[ \t]*"=" { BEGIN(GetString); s=&Config::outputLanguage; } +<Start>"STRIP_FROM_PATH"[ \t]*"=" { BEGIN(GetString); s=&Config::stripFromPath; } +<Start>"MAN_EXTENSION"[ \t]*"=" { BEGIN(GetString); s=&Config::manExtension; } +<Start>"INCLUDE_PATH"[ \t]*"=" { BEGIN(GetStrList); l=&Config::includePath; elemStr=""; } +<Start>"EXAMPLE_PATH"[ \t]*"=" { BEGIN(GetStrList); l=&Config::examplePath; elemStr=""; } +<Start>"INPUT"[ \t]*"=" { BEGIN(GetStrList); l=&Config::inputSources; elemStr=""; } +<Start>"EXCLUDE"[ \t]*"=" { BEGIN(GetStrList); l=&Config::excludeSources; elemStr=""; } +<Start>"FILE_PATTERNS"[ \t]*"=" { BEGIN(GetStrList); l=&Config::filePatternList; elemStr=""; } +<Start>"EXCLUDE_PATTERNS"[ \t]*"=" { BEGIN(GetStrList); l=&Config::excludePatternList; elemStr=""; } +<Start>"TAGFILES"[ \t]*"=" { BEGIN(GetStrList); l=&Config::tagFileList; elemStr=""; } +<Start>"EXT_DOC_PATHS"[ \t]*"=" { BEGIN(GetStrList); l=&Config::extDocPathList; elemStr=""; } +<Start>"PREDEFINED"[ \t]*"=" { BEGIN(GetStrList); l=&Config::predefined; elemStr=""; } +<Start>"EXTRA_PACKAGES"[ \t]*"=" { BEGIN(GetStrList); l=&Config::extraPackageList; elemStr=""; } +<Start>"QUIET"[ \t]*"=" { BEGIN(GetBool); b=&Config::quietFlag; } +<Start>"WARNINGS"[ \t]*"=" { BEGIN(GetBool); b=&Config::warningFlag; } +<Start>"RECURSIVE"[ \t]*"=" { BEGIN(GetBool); b=&Config::recursiveFlag; } +<Start>"ALLEXTERNALS"[ \t]*"=" { BEGIN(GetBool); b=&Config::allExtFlag; } +<Start>"SEARCHENGINE"[ \t]*"=" { BEGIN(GetBool); b=&Config::searchEngineFlag; } +<Start>"EXTRACT_ALL"[ \t]*"=" { BEGIN(GetBool); b=&Config::extractAllFlag; } +<Start>"EXTRACT_PRIVATE"[ \t]*"=" { BEGIN(GetBool); b=&Config::extractPrivateFlag; } +<Start>"DISABLE_INDEX"[ \t]*"=" { BEGIN(GetBool); b=&Config::noIndexFlag; } +<Start>"GENERATE_LATEX"[ \t]*"=" { BEGIN(GetBool); b=&Config::generateLatex; } +<Start>"GENERATE_HTML"[ \t]*"=" { BEGIN(GetBool); b=&Config::generateHtml; } +<Start>"GENERATE_MAN"[ \t]*"=" { BEGIN(GetBool); b=&Config::generateMan; } +<Start>"ENABLE_PREPROCESSING"[ \t]*"=" { BEGIN(GetBool); b=&Config::preprocessingFlag; } +<Start>"MACRO_EXPANSION"[ \t]*"=" { BEGIN(GetBool); b=&Config::macroExpansionFlag; } +<Start>"SEARCH_INCLUDES"[ \t]*"=" { BEGIN(GetBool); b=&Config::searchIncludeFlag; } +<Start>"BRIEF_MEMBER_DESC"[ \t]*"=" { BEGIN(GetBool); b=&Config::briefMemDescFlag; } +<Start>"HIDE_UNDOC_MEMBERS"[ \t]*"=" { BEGIN(GetBool); b=&Config::hideMemberFlag; } +<Start>"HIDE_UNDOC_CLASSES"[ \t]*"=" { BEGIN(GetBool); b=&Config::hideClassFlag; } +<Start>"EXPAND_ONLY_PREDEF"[ \t]*"=" { BEGIN(GetBool); b=&Config::onlyPredefinedFlag; } +<Start>"FULL_PATH_NAMES"[ \t]*"=" { BEGIN(GetBool); b=&Config::fullPathNameFlag; } +<Start>"CLASS_DIAGRAMS"[ \t]*"=" { BEGIN(GetBool); b=&Config::classDiagramFlag; } +<Start>"COMPACT_LATEX"[ \t]*"=" { BEGIN(GetBool); b=&Config::compactLatexFlag; } +<Start>"REPEAT_BRIEF"[ \t]*"=" { BEGIN(GetBool); b=&Config::repeatBriefFlag; } +<Start>"INTERNAL_DOCS"[ \t]*"=" { BEGIN(GetBool); b=&Config::internalDocsFlag; } +<Start>"CASE_SENSE_NAMES"[ \t]*"=" { BEGIN(GetBool); b=&Config::caseSensitiveNames; } +<Start>"VERBATIM_HEADERS"[ \t]*"=" { BEGIN(GetBool); b=&Config::verbatimHeaderFlag; } +<Start>"HTML_ALIGN_MEMBERS"[ \t]*"=" { BEGIN(GetBool); b=&Config::htmlAlignMemberFlag; } +<Start>"SOURCE_BROWSER"[ \t]*"=" { BEGIN(GetBool); b=&Config::includeSourceFlag; } +<Start>"JAVADOC_AUTOBRIEF"[ \t]*"=" { BEGIN(GetBool); b=&Config::autoBriefFlag; } <Start>[a-z_A-Z0-9]+ { err("Warning: ignoring unknown tag `%s' at line %d\n",yytext,yyLineNr); } <GetString,GetBool>\n { yyLineNr++; BEGIN(Start); } <GetStrList>\n { @@ -258,7 +284,7 @@ static int yyread(char *buf,int max_size) } <GetQuotedString>. { tmpString+=*yytext; } <GetBool>[a-zA-Z]+ { - QString bs=yytext; + QCString bs=yytext; bs=bs.upper(); if (bs=="YES") *b=TRUE; @@ -272,11 +298,6 @@ static int yyread(char *buf,int max_size) bs.data(),yyLineNr); } } - /* -<GetStrList>[a-z_A-Z.*:?~0-9/\\\-]+ { - elemStr+=yytext; - } - */ <GetStrList>[^ \#\"\$\t\r\n]+ { elemStr+=yytext; } @@ -294,56 +315,122 @@ static int yyread(char *buf,int max_size) void dumpConfig() { - printf("projectName=`%s'\n",projectName.data()); - printf("outputDir=`%s'\n", outputDir.data()); - printf("headerFile=`%s'\n", headerFile.data()); - printf("footerFile=`%s'\n", footerFile.data()); - char *ip=includePath.first(); + printf("projectName=`%s'\n",Config::projectName.data()); + printf("outputDir=`%s'\n", Config::outputDir.data()); + printf("headerFile=`%s'\n", Config::headerFile.data()); + printf("footerFile=`%s'\n", Config::footerFile.data()); + char *ip=Config::includePath.first(); while (ip) { printf("includePath=`%s'\n",ip); - ip=includePath.next(); + ip=Config::includePath.next(); } - printf("quiet=`%d'\n", quietFlag); - printf("warnings=`%d'\n", warningFlag); - char *is=inputSources.first(); + printf("quiet=`%d'\n", Config::quietFlag); + printf("warnings=`%d'\n", Config::warningFlag); + char *is=Config::inputSources.first(); while (is) { printf("inputSources=`%s'\n",is); - is=inputSources.next(); + is=Config::inputSources.next(); } - char *fp=filePatternList.first(); + char *fp=Config::filePatternList.first(); while (fp) { printf("filePattern=`%s'\n",fp); - fp=filePatternList.next(); + fp=Config::filePatternList.next(); } - printf("recusive=`%d'\n",recursiveFlag); - printf("inputFilter=`%s'\n",inputFilter.data()); - char *tf=tagFileList.first(); + printf("recusive=`%d'\n",Config::recursiveFlag); + printf("inputFilter=`%s'\n",Config::inputFilter.data()); + char *tf=Config::tagFileList.first(); while (tf) { printf("tagFile=`%s'\n",tf); - tf=tagFileList.next(); - } - printf("allExternals=`%d'\n",allExtFlag); - printf("searchEngine=`%d'\n",searchEngineFlag); - printf("cgiName=`%s'\n",cgiName.data()); - printf("cgiURL=`%s'\n",cgiURL.data()); - printf("docURL=`%s'\n",docURL.data()); - printf("binAbsPath=`%s'\n",binAbsPath.data()); - char *ed=extDocPathList.first(); + tf=Config::tagFileList.next(); + } + printf("allExternals=`%d'\n",Config::allExtFlag); + printf("searchEngine=`%d'\n",Config::searchEngineFlag); + printf("cgiName=`%s'\n",Config::cgiName.data()); + printf("cgiURL=`%s'\n",Config::cgiURL.data()); + printf("docURL=`%s'\n",Config::docURL.data()); + printf("binAbsPath=`%s'\n",Config::binAbsPath.data()); + char *ed=Config::extDocPathList.first(); while (ed) { printf("binAbsPathFile=`%s'\n",ed); - ed=extDocPathList.next(); + ed=Config::extDocPathList.next(); } } +void Config::init() +{ + Config::projectName.resize(0); + Config::projectNumber.resize(0); + Config::outputDir.resize(0); + Config::htmlOutputDir = "html"; + Config::latexOutputDir ="latex"; + Config::manOutputDir ="man"; + Config::outputLanguage = "English"; + Config::headerFile.resize(0); + Config::footerFile.resize(0); + Config::cgiName = "search.cgi"; + Config::cgiURL.resize(0); + Config::docURL.resize(0); + Config::binAbsPath = "/usr/local/bin/"; + Config::docAbsPath.resize(0); + Config::perlPath = "/usr/bin/perl"; + Config::genTagFile.resize(0); + Config::inputFilter.resize(0); + Config::paperType = "a4wide"; + Config::stripFromPath.resize(0); + Config::manExtension = ".3"; + Config::includePath.clear(); + Config::examplePath.clear(); + Config::inputSources.clear(); + Config::excludeSources.clear(); + Config::filePatternList.clear(); + Config::excludePatternList.clear(); + Config::tagFileList.clear(); + Config::extDocPathList.clear(); + Config::predefined.clear(); + Config::extraPackageList.clear(); + Config::quietFlag = FALSE; + Config::recursiveFlag = FALSE; + Config::allExtFlag = FALSE; + Config::searchEngineFlag = FALSE; + Config::extractAllFlag = FALSE; + Config::extractPrivateFlag = FALSE; + Config::noIndexFlag = FALSE; + Config::hideMemberFlag = FALSE; + Config::hideClassFlag = FALSE; + Config::macroExpansionFlag = FALSE; + Config::onlyPredefinedFlag = FALSE; + Config::fullPathNameFlag = FALSE; + Config::compactLatexFlag = FALSE; + Config::internalDocsFlag = FALSE; + Config::caseSensitiveNames = FALSE; + Config::includeSourceFlag = FALSE; + Config::warningFlag = TRUE; + Config::generateHtml = TRUE; + Config::generateLatex = TRUE; + Config::generateMan = TRUE; + Config::preprocessingFlag = TRUE; + Config::briefMemDescFlag = TRUE; + Config::searchIncludeFlag = TRUE; + Config::classDiagramFlag = TRUE; + Config::repeatBriefFlag = TRUE; + Config::verbatimHeaderFlag = TRUE; + Config::htmlAlignMemberFlag = TRUE; + Config::autoBriefFlag = TRUE; +} + void writeTemplateConfig(QFile *f,bool sl) { QTextStream t(f); +#ifdef DOXYWIZARD + t << "# Doxygen configuration generated by Doxywizard version " << versionString << endl; +#else t << "# Doxyfile " << versionString << endl; +#endif if (!sl) { t << "# This file describes the settings to be used by doxygen for a project\n"; @@ -387,7 +474,8 @@ void writeTemplateConfig(QFile *f,bool sl) t << "# The OUTPUT_LANGUAGE tag is used to specify the language in which all\n"; t << "# documentation generated by doxygen is written. Doxygen will use this\n"; t << "# information to generate all constant output in the proper language.\n"; - t << "# The default language is English, other supported languages are: Dutch\n"; + t << "# The default language is English, other supported languages are: \n"; + t << "# Dutch, French, Italian, Czech, Swedish, German and Japanese\n"; t << "\n"; } t << "OUTPUT_LANGUAGE = English\n"; @@ -516,11 +604,20 @@ void writeTemplateConfig(QFile *f,bool sl) t << "# supports case sensitive file names.\n"; t << "\n"; } + t << "SOURCE_BROWSER = NO\n"; + if (!sl) + { + t << "\n"; + t << "# If the SOURCE_BROWSER tag is set to YES than the body of a member or\n"; + t << "# function will be appended as a block of code to the documentation of.\n"; + t << "# that member or function.\n"; + t << "\n"; + } t << "CASE_SENSE_NAMES = NO\n"; if (!sl) { t << "\n"; - t << "# If the VERBATIM_HEADERS tag is set the YES (the default) then Doxygen\n"; + t << "# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen\n"; t << "# will generate a verbatim copy of the header file for each class for\n"; t << "# which an include is specified. Set to NO to disable this.\n"; t << "\n"; @@ -529,6 +626,16 @@ void writeTemplateConfig(QFile *f,bool sl) if (!sl) { t << "\n"; + t << "# If the JAVADOC_NO_AUTOBRIEF is set to YES (the default) then Doxygen\n"; + t << "# will interpret the first line (until the first dot) of a JavaDoc-style\n"; + t << "# comment as the brief description. If set to NO, the Javadoc-style will\n"; + t << "# behave just like the Qt-style comments.\n"; + t << "\n"; + } + t << "JAVADOC_AUTOBRIEF = YES\n"; + if (!sl) + { + t << "\n"; t << "#---------------------------------------------------------------------------\n"; t << "# configuration options related to the input files\n"; t << "#---------------------------------------------------------------------------\n"; @@ -817,7 +924,7 @@ void writeTemplateConfig(QFile *f,bool sl) t << "# interpreter (i.e. the result of `which perl').\n"; t << "\n"; } - t << "PERL_PATH = /usr/local/bin/perl\n"; + t << "PERL_PATH = /usr/bin/perl\n"; if (!sl) { t << "\n"; @@ -893,147 +1000,154 @@ void checkConfig() //} // set default man page extension if non is given by the user - if (manExtension.isEmpty()) + if (Config::manExtension.isEmpty()) { - manExtension=".3"; + Config::manExtension=".3"; } - paperType = paperType.lower().stripWhiteSpace(); - if (paperType.isEmpty()) + Config::paperType = Config::paperType.lower().stripWhiteSpace(); + if (Config::paperType.isEmpty()) { - paperType = "a4wide"; + Config::paperType = "a4wide"; } - if (paperType!="a4" && paperType!="a4wide" && paperType!="letter" && - paperType!="legal" && paperType!="executive") + if (Config::paperType!="a4" && Config::paperType!="a4wide" && Config::paperType!="letter" && + Config::paperType!="legal" && Config::paperType!="executive") { err("Error: Unknown page type specified"); } - outputLanguage=outputLanguage.stripWhiteSpace(); - if (outputLanguage.isEmpty()) + Config::outputLanguage=Config::outputLanguage.stripWhiteSpace(); + if (Config::outputLanguage.isEmpty()) { + Config::outputLanguage = "English"; +#ifndef DOXYWIZARD setTranslator("English"); +#endif } else { - if (!setTranslator(outputLanguage)) +#ifndef DOXYWIZARD + if (!setTranslator(Config::outputLanguage)) { - err("Error: Output language %s not supported! Using english instead.\n", - outputLanguage.data()); + err("Error: Output language %s not supported! Using English instead.\n", + Config::outputLanguage.data()); } +#endif } // Test to see if output directory is valid - if (outputDir.isEmpty()) - outputDir=QDir::currentDirPath(); + if (Config::outputDir.isEmpty()) + Config::outputDir=QDir::currentDirPath(); else { - QDir dir(outputDir); + QDir dir(Config::outputDir); if (!dir.exists()) { dir.setPath(QDir::currentDirPath()); - if (!dir.mkdir(outputDir)) + if (!dir.mkdir(Config::outputDir)) { err("Error: tag OUTPUT_DIRECTORY: Output directory `%s' does not " - "exist and cannot be created\n",outputDir.data()); + "exist and cannot be created\n",Config::outputDir.data()); exit(1); } - else if (!quietFlag) + else if (!Config::quietFlag) { err("Notice: Output directory `%s' does not exist. " - "I have created it for you.\n", outputDir.data()); + "I have created it for you.\n", Config::outputDir.data()); } - dir.cd(outputDir); + dir.cd(Config::outputDir); } - outputDir=dir.absPath(); + Config::outputDir=dir.absPath(); } - if (htmlOutputDir.isEmpty() && generateHtml) + if (Config::htmlOutputDir.isEmpty() && Config::generateHtml) { - htmlOutputDir=outputDir+"/html"; + Config::htmlOutputDir=Config::outputDir+"/html"; } - else if (htmlOutputDir && htmlOutputDir[0]!='/') + else if (Config::htmlOutputDir && Config::htmlOutputDir[0]!='/') { - htmlOutputDir.prepend(outputDir+'/'); + Config::htmlOutputDir.prepend(Config::outputDir+'/'); } - QDir htmlDir(htmlOutputDir); - if (!htmlDir.exists() && !htmlDir.mkdir(htmlOutputDir)) + QDir htmlDir(Config::htmlOutputDir); + if (!htmlDir.exists() && !htmlDir.mkdir(Config::htmlOutputDir)) { - err("Could not create output directory %s\n",htmlOutputDir.data()); + err("Could not create output directory %s\n",Config::htmlOutputDir.data()); exit(1); } - if (latexOutputDir.isEmpty() && generateLatex) + if (Config::latexOutputDir.isEmpty() && Config::generateLatex) { - latexOutputDir=outputDir+"/latex"; + Config::latexOutputDir=Config::outputDir+"/latex"; } - else if (latexOutputDir && latexOutputDir[0]!='/') + else if (Config::latexOutputDir && Config::latexOutputDir[0]!='/') { - latexOutputDir.prepend(outputDir+'/'); + Config::latexOutputDir.prepend(Config::outputDir+'/'); } - QDir latexDir(latexOutputDir); - if (!latexDir.exists() && !latexDir.mkdir(latexOutputDir)) + QDir latexDir(Config::latexOutputDir); + if (!latexDir.exists() && !latexDir.mkdir(Config::latexOutputDir)) { - err("Could not create output directory %s\n",latexOutputDir.data()); + err("Could not create output directory %s\n",Config::latexOutputDir.data()); exit(1); } - if (manOutputDir.isEmpty() && generateMan) + if (Config::manOutputDir.isEmpty() && Config::generateMan) { - manOutputDir=outputDir+"/man"; + Config::manOutputDir=Config::outputDir+"/man"; } - else if (manOutputDir && manOutputDir[0]!='/') + else if (Config::manOutputDir && Config::manOutputDir[0]!='/') { - manOutputDir.prepend(outputDir+'/'); + Config::manOutputDir.prepend(Config::outputDir+'/'); } - QDir manDir(manOutputDir); - if (!manDir.exists() && !manDir.mkdir(manOutputDir)) + QDir manDir(Config::manOutputDir); + if (!manDir.exists() && !manDir.mkdir(Config::manOutputDir)) { - err("Could not create output directory %s\n",manOutputDir.data()); + err("Could not create output directory %s\n",Config::manOutputDir.data()); exit(1); } // Test to see if HTML header is valid - if (headerFile.length()>0) + if (Config::headerFile.length()>0) { - QFileInfo fi(headerFile); + QFileInfo fi(Config::headerFile); if (!fi.exists()) { err("Error: tag HTML_HEADER: header file `%s' " - "does not exist\n",headerFile.data()); + "does not exist\n",Config::headerFile.data()); exit(1); } } // Test to see if HTML footer is valid - if (footerFile.length()>0) + if (Config::footerFile.length()>0) { - QFileInfo fi(footerFile); + QFileInfo fi(Config::footerFile); if (!fi.exists()) { err("Error: tag HTML_FOOTER: footer file `%s' " - "does not exist\n",footerFile.data()); + "does not exist\n",Config::footerFile.data()); exit(1); } } // check include path - char *s=includePath.first(); + char *s=Config::includePath.first(); while (s) { QFileInfo fi(s); if (!fi.exists()) err("Warning: tag INCLUDE_PATH: include path `%s' " "does not exist\n",s); +#ifndef DOXYWIZARD addSearchDir(fi.absFilePath()); - s=includePath.next(); +#endif + s=Config::includePath.next(); } // check input - if (inputSources.count()==0) + if (Config::inputSources.count()==0) { err("Error: tag INPUT: no input files specified after the INPUT tag.\n"); exit(1); } else { - s=inputSources.first(); + s=Config::inputSources.first(); while (s) { QFileInfo fi(s); @@ -1042,89 +1156,105 @@ void checkConfig() err("Error: tag INPUT: input source `%s' does not exist\n",s); exit(1); } - s=inputSources.next(); + s=Config::inputSources.next(); } } // add default pattern if needed - if (filePatternList.count()==0) + if (Config::filePatternList.count()==0) { - filePatternList.append("*"); + Config::filePatternList.append("*"); } // more checks needed if and only if the search engine is enabled. - if (searchEngineFlag) + if (Config::searchEngineFlag) { // check cgi name - if (cgiName.length()==0) + if (Config::cgiName.length()==0) { err("Error: tag CGI_NAME: no cgi script name after the CGI_NAME tag.\n"); exit(1); } // check cgi URL - if (cgiURL.length()==0) + if (Config::cgiURL.length()==0) { err("Error: tag CGI_URL: no URL to cgi directory specified.\n"); exit(1); } - else if (cgiURL.left(7)!="http://") + else if (Config::cgiURL.left(7)!="http://") { err("Error: tag CGI_URL: URL to cgi directory is invalid (must " "start with http://).\n"); exit(1); } // check documentation URL - if (docURL.length()==0) + if (Config::docURL.length()==0) { - docURL = outputDir.copy().prepend("file://").append("html"); + Config::docURL = Config::outputDir.copy().prepend("file://").append("html"); } - else if (docURL.left(7)!="http://" && docURL.left(7)!="file://") + else if (Config::docURL.left(7)!="http://" && Config::docURL.left(7)!="file://") { err("Error: tag DOC_URL: URL to documentation is invalid or " "not absolute.\n"); exit(1); } // check absolute documentation path - if (docAbsPath.length()==0) + if (Config::docAbsPath.length()==0) { - docAbsPath = outputDir+"/html"; + Config::docAbsPath = Config::outputDir+"/html"; } - else if (docAbsPath && docAbsPath[0]!='/') + else if (Config::docAbsPath[0]!='/' && Config::docAbsPath[1]!=':') { - err("Error: tag DOC_ABSPATH: path is not absolute\n"); + err("Error: tag DOC_ABSPATH: path is not absolute!\n"); exit(1); } // check path to doxysearch - if (binAbsPath.length()==0) + if (Config::binAbsPath.length()==0) { err("Error: tag BIN_ABSPATH: no absolute path to doxysearch " "specified.\n"); exit(1); } - else + else if (Config::binAbsPath[0]!='/' && Config::binAbsPath[1]!=':') { - if (binAbsPath && binAbsPath[0]!='/') - { - err("Error: tag BIN_ABSPATH: path is not absolute " - "(must start with /).\n"); - exit(1); - } + err("Error: tag BIN_ABSPATH: path is not absolute!\n"); + exit(1); } + // check perl path - if (perlPath.length()==0) + bool found=FALSE; + if (Config::perlPath.length()==0) { - perlPath="/usr/local/bin/perl"; + QFileInfo fi; + fi.setFile("/usr/bin/perl"); + if (fi.exists()) + { + Config::perlPath="/usr/bin/perl"; + found=TRUE; + } + else + { + fi.setFile("/usr/local/bin/perl"); + if (fi.exists()) + { + Config::perlPath="/usr/local/bin/perl"; + found=TRUE; + } + } } - QFileInfo fi(perlPath); - if (!fi.exists()) + if (!found) { - err("Error: tag PERL_PATH: perl interpreter not found at `%s'\n", - perlPath.data()); - exit(1); + QFileInfo fi(Config::perlPath); + if (!fi.exists()) + { + warn("Warning: tag PERL_PATH: perl interpreter not found at default or" + "user specified (%s) location\n", + Config::perlPath.data()); + } } } } -void parseConfig(const QString &s) +void parseConfig(const QCString &s) { inputString = s; inputPosition = 0; @@ -1132,9 +1262,8 @@ void parseConfig(const QString &s) configYYrestart( configYYin ); BEGIN( Start ); configYYlex(); - checkConfig(); } -extern "C" { // some bogus code to keep the compiler happy - int configYYwrap() { return 1 ; } -} +//extern "C" { // some bogus code to keep the compiler happy +// int configYYwrap() { return 1 ; } +//} diff --git a/src/constexp.h b/src/constexp.h index 9979bfd..8c33a5e 100644 --- a/src/constexp.h +++ b/src/constexp.h @@ -18,13 +18,13 @@ #ifndef _CONSTEXP_H #define _CONSTEXP_H -#include <qstring.h> +#include "qtbc.h" #include "cppvalue.h" -extern bool parseCppExpression(const QString &s); +extern bool parseCppExpression(const QCString &s); extern int cppExpYYparse(); extern int cppExpYYdebug; -extern QString strToken; +extern QCString strToken; extern CPPValue resultValue; #endif diff --git a/src/constexp.l b/src/constexp.l index f023507..43c7167 100644 --- a/src/constexp.l +++ b/src/constexp.l @@ -24,7 +24,7 @@ #define YY_NO_UNPUT #define YY_NEVER_INTERACTIVE 1 -QString strToken; +QCString strToken; static const char *inputString; static int inputPosition; @@ -94,7 +94,7 @@ static int yyread(char *buf,int max_size) %% -bool parseCppExpression(const QString &s) +bool parseCppExpression(const QCString &s) { //printf("Expression: `%s'\n",s.data()); inputString = s; diff --git a/src/debug.cpp b/src/debug.cpp index fc2731d..d7f1ba8 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -14,10 +14,11 @@ * */ -#include "debug.h" #include <stdarg.h> #include <stdio.h> -#include <qstring.h> + +#include "qtbc.h" +#include "debug.h" Debug::DebugMask Debug::curMask = Debug::Quiet; int Debug::curPrio = 0; @@ -35,7 +36,7 @@ void Debug::print(DebugMask mask,int prio,const char *fmt,...) static int labelToEnumValue(const char *l) { - QString label=l; + QCString label=l; if (label=="FindMembers") return Debug::FindMembers; else if (label=="Functions") diff --git a/src/declinfo.h b/src/declinfo.h index 4ec3ec5..df206e0 100644 --- a/src/declinfo.h +++ b/src/declinfo.h @@ -17,16 +17,16 @@ #ifndef DECLINFO_H #define DECLINFO_H +#include "qtbc.h" #include <stdio.h> -#include <qstring.h> -extern void parseFuncDecl(const QString &decl, - QString &clName, - QString &classTempList, - QString &type, - QString &name, - QString &args, - QString &funcTempList, - QString &exceptions +extern void parseFuncDecl(const QCString &decl, + QCString &clName, + QCString &classTempList, + QCString &type, + QCString &name, + QCString &args, + QCString &funcTempList, + QCString &exceptions ); #endif diff --git a/src/declinfo.l b/src/declinfo.l index 0f0505d..dfa3e47 100644 --- a/src/declinfo.l +++ b/src/declinfo.l @@ -37,18 +37,18 @@ static const char * inputString; static int inputPosition; -static QString scope; -static QString className; -static QString classTempList; -static QString funcTempList; -static QString type; -static QString name; -static QString args; -static QString tmpType; +static QCString scope; +static QCString className; +static QCString classTempList; +static QCString funcTempList; +static QCString type; +static QCString name; +static QCString args; +static QCString tmpType; static int sharpCount; static bool classTempListFound; static bool funcTempListFound; -static QString exceptionString; +static QCString exceptionString; static void addType() { @@ -95,6 +95,8 @@ static int yyread(char *buf,int max_size) B [ \t] ID [a-z_A-Z][a-z_A-Z0-9]* +%option noyywrap + %x Start %x Template %x ReadArgs @@ -198,8 +200,8 @@ ID [a-z_A-Z][a-z_A-Z0-9]* /*@ ---------------------------------------------------------------------------- */ -void parseFuncDecl(const QString &decl,QString &cl,QString &ctl,QString &t, - QString &n,QString &a,QString &ftl,QString &exc) +void parseFuncDecl(const QCString &decl,QCString &cl,QCString &ctl,QCString &t, + QCString &n,QCString &a,QCString &ftl,QCString &exc) { inputString = decl; //printf("Input=`%s'\n",inputString); @@ -221,17 +223,18 @@ void parseFuncDecl(const QString &decl,QString &cl,QString &ctl,QString &t, declinfoYYlex(); cl=scope.copy(); - int i; - if ((i=cl.find('<'))!=-1) // split up scope and template arguments + int il,ir; + if ((il=cl.find('<'))!=-1 && (ir=cl.findRev('>'))!=-1) // split up scope and template arguments { - ctl=removeRedundantWhiteSpace(cl.right(cl.length()-i)); - cl=cl.left(i); + if (ir==-1) ir=cl.length(); else ir++; + ctl=removeRedundantWhiteSpace(cl.mid(il,ir-il)); + cl=cl.left(il)+cl.right(cl.length()-ir); } n=removeRedundantWhiteSpace(name); - if ((i=n.find('<'))!=-1 && n.left(8)!="operator") + if ((il=n.find('<'))!=-1 && n.left(8)!="operator") { - ftl=removeRedundantWhiteSpace(n.right(n.length()-i)); - n=n.left(i); + ftl=removeRedundantWhiteSpace(n.right(n.length()-il)); + n=n.left(il); } //ctl=classTempList.copy(); @@ -253,20 +256,20 @@ void parseFuncDecl(const QString &decl,QString &cl,QString &ctl,QString &t, } -extern "C" { // some bogus code to keep the compiler happy - int declinfoYYwrap() { return 1 ; } - void declinfoYYdummy() { yy_flex_realloc(0,0); } -} +//extern "C" { // some bogus code to keep the compiler happy +// int declinfoYYwrap() { return 1 ; } +// void declinfoYYdummy() { yy_flex_realloc(0,0); } +//} #if 0 void dumpDecl(const char *s) { - QString className; - QString classTNames; - QString type; - QString name; - QString args; - QString funcTNames; + QCString className; + QCString classTNames; + QCString type; + QCString name; + QCString args; + QCString funcTNames; printf("-----------------------------------------\n"); parseFuncDecl(s,className,classTNames,type,name,args,funcTNames); printf("type=`%s' class=`%s' classTempl=`%s' name=`%s' " diff --git a/src/defargs.h b/src/defargs.h index d2cd8f2..70e901c 100644 --- a/src/defargs.h +++ b/src/defargs.h @@ -17,8 +17,8 @@ #ifndef DEFARGS_H #define DEFARGS_H +#include "qtbc.h" #include <stdio.h> -#include <qstring.h> class ArgumentList; diff --git a/src/defargs.l b/src/defargs.l index b7dfd57..d82c2fe 100644 --- a/src/defargs.l +++ b/src/defargs.l @@ -19,6 +19,7 @@ /* * includes */ +#include "qtbc.h" #include <stdio.h> #include <iostream.h> #include <assert.h> @@ -40,10 +41,10 @@ static const char *inputString; static int inputPosition; static ArgumentList *argList; -static QString *copyArgValue; -static QString curArgTypeName; -static QString curArgDefValue; -static QString curArgName; +static QCString *copyArgValue; +static QCString curArgTypeName; +static QCString curArgDefValue; +static QCString curArgName; static int argRoundCount; static int argSharpCount; static int argCurlyCount; @@ -72,6 +73,8 @@ static int yyread(char *buf,int max_size) B [ \t] ID [a-z_A-Z][a-z_A-Z0-9]* +%option noyywrap + %x Start %x CopyArgString %x CopyArgRound @@ -239,7 +242,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]* } } <ReadFuncArgType,ReadFuncArgPtr>{ID} { - QString name=yytext; //resolveDefines(yytext); + QCString name=yytext; //resolveDefines(yytext); //printf("resolveName `%s'->`%s'\n",yytext,name.data()); curArgTypeName+=name; } @@ -250,7 +253,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]* curArgDefValue+=*yytext; } <CopyArgRound,CopyArgRound2,CopyArgSharp,CopyArgCurly>{ID} { - QString name=yytext; //resolveDefines(yytext); + QCString name=yytext; //resolveDefines(yytext); *copyArgValue+=name; } <CopyArgRound,CopyArgRound2,CopyArgSharp,CopyArgCurly>. { @@ -293,6 +296,6 @@ void stringToArgumentList(const char *argsString,ArgumentList* &al) } extern "C" { // some bogus code to keep the compiler happy - int defargsYYwrap() { return 1 ; } +// int defargsYYwrap() { return 1 ; } void defargsYYdummy() { yy_flex_realloc(0,0); } } diff --git a/src/define.cpp b/src/define.cpp index 2fa7fa4..336d6da 100644 --- a/src/define.cpp +++ b/src/define.cpp @@ -39,5 +39,5 @@ Define::~Define() bool Define::hasDocumentation() { - return definition && (doc || extractAllFlag); + return definition && (doc || Config::extractAllFlag); } diff --git a/src/define.h b/src/define.h index 14ac008..92027af 100644 --- a/src/define.h +++ b/src/define.h @@ -17,8 +17,8 @@ #ifndef DEFINE_H #define DEFINE_H +#include "qtbc.h" #include <qdict.h> -#include <qstring.h> #include "util.h" class FileDef; @@ -30,13 +30,13 @@ class Define Define(const Define &d); ~Define(); bool hasDocumentation(); - QString name; - QString definition; - QString fileName; - QString doc; - QString brief; - QString args; - QString anchor; + QCString name; + QCString definition; + QCString fileName; + QCString doc; + QCString brief; + QCString args; + QCString anchor; FileDef *fileDef; int lineNr; int nargs; @@ -67,7 +67,7 @@ class DefineName : public QList<Define> } private: - QString name; + QCString name; }; class DefineNameList : public QList<DefineName> diff --git a/src/definition.cpp b/src/definition.cpp index 328bebe..4474113 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -14,6 +14,7 @@ * */ +#include "qtbc.h" #include <ctype.h> #include "definition.h" #include "doxygen.h" @@ -28,23 +29,23 @@ Definition::~Definition() delete sectionList; } -QString Definition::nameToFile(const char *name) +QCString Definition::nameToFile(const char *name) { - QString result; + QCString result; char c; const char *p=name; while ((c=*p++)!=0) { switch(c) { - case ':': break; + case ':': result+="_"; break; case '<': result+="_lt"; break; case '>': result+="_gt"; break; case '*': result+="_ast"; break; case '&': result+="_amp"; break; case ' ': break; default: - if (caseSensitiveNames) + if (Config::caseSensitiveNames) result+=c; else result+=tolower(c); @@ -54,10 +55,10 @@ QString Definition::nameToFile(const char *name) return result; } -void Definition::addSectionsToDefinition(QList<QString> *anchorList) +void Definition::addSectionsToDefinition(QList<QCString> *anchorList) { if (!anchorList) return; - QString *s=anchorList->first(); + QCString *s=anchorList->first(); while (s) { SectionInfo *si=0; diff --git a/src/definition.h b/src/definition.h index 48301bc..282ecdc 100644 --- a/src/definition.h +++ b/src/definition.h @@ -17,7 +17,7 @@ #ifndef DEFINITION_H #define DEFINITION_H -#include <qstring.h> +#include "qtbc.h" #include <qlist.h> #include "config.h" #include "section.h" @@ -31,13 +31,13 @@ class Definition //! destroys the definition virtual ~Definition(); //! returns the name of the definition - QString name() const { return n; } + QCString name() const { return n; } //! returns the base name of the output file that contains this definition. - virtual QString getOutputFileBase() const = 0; + virtual QCString getOutputFileBase() const = 0; //! returns the detailed description of this definition - QString documentation() const { return doc; } + QCString documentation() const { return doc; } //! returns the brief description of this definition - QString briefDescription() const { return brief; } + QCString briefDescription() const { return brief; } //! sets a new name for the definition void setName(const char *name) { n=name; } //! sets the documentation of this definition @@ -54,16 +54,16 @@ class Definition brief.at(bl-1)!='?') brief+='.'; } //! returns TRUE iff the definition is documented - bool hasDocumentation() - { return !doc.isNull() || !brief.isNull() || extractAllFlag; } - QString nameToFile(const char *name); + virtual bool hasDocumentation() + { return !doc.isNull() || !brief.isNull() || Config::extractAllFlag; } + QCString nameToFile(const char *name); - void addSectionsToDefinition(QList<QString> *anchorList); + void addSectionsToDefinition(QList<QCString> *anchorList); private: - QString n; // name of the definition - QString brief; // brief description - QString doc; // detailed description + QCString n; // name of the definition + QCString brief; // brief description + QCString doc; // detailed description SectionList *sectionList; // list of all sections }; diff --git a/src/diagram.cpp b/src/diagram.cpp index 87d5488..8cbe128 100644 --- a/src/diagram.cpp +++ b/src/diagram.cpp @@ -15,10 +15,10 @@ * */ +#include "qtbc.h" #include <stdio.h> #include <stdlib.h> #include <qlist.h> -#include <qstring.h> #include <qarray.h> #include <qtstream.h> #include <qfile.h> @@ -43,9 +43,9 @@ const uint labelVertSpacing = 32; // vertical distance between labels const uint labelHorMargin = 6; // horiz. spacing between label and box const uint fontHeight = 12; // height of a character -//static QString escapeLatex(const char *s) +//static QCString escapeLatex(const char *s) //{ -// QString result; +// QCString result; // char c; // while ((c=*s++)) // { @@ -77,7 +77,7 @@ static uint protToColor(Protection p) return 0; } -static QString protToString(Protection p) +static QCString protToString(Protection p) { switch(p) { @@ -180,12 +180,12 @@ DiagramItem::~DiagramItem() delete children; } -QString DiagramItem::label() const +QCString DiagramItem::label() const { return classDef->name()+templSpec; } -QString DiagramItem::fileName() const +QCString DiagramItem::fileName() const { return classDef->getOutputFileBase(); } @@ -960,10 +960,10 @@ void ClassDiagram::writeFigure(QTextStream &output,const char *path, //printf("writeFigure rows=%d cols=%d\n",rows,cols); - QFile f1((QString)path+"/"+fileName+".eps"); + QFile f1((QCString)path+"/"+fileName+".eps"); if (!f1.open(IO_WriteOnly)) { - err("Could not open file %s for writing\n",f1.name()); + err("Could not open file %s for writing\n",convertToQCString(f1.name()).data()); exit(1); } QTextStream t(&f1); @@ -1229,7 +1229,7 @@ void ClassDiagram::writeImageMap(QTextStream &t,const char *path, base->drawConnectors(t,&image,TRUE,TRUE,baseRows,superRows,cellWidth,cellHeight); super->drawConnectors(t,&image,FALSE,TRUE,baseRows,superRows,cellWidth,cellHeight); - image.save((QString)path+"/"+fileName+".gif"); + image.save((QCString)path+"/"+fileName+".gif"); t << "</MAP></P>" << endl; } diff --git a/src/diagram.h b/src/diagram.h index 5bc30f8..792aa8f 100644 --- a/src/diagram.h +++ b/src/diagram.h @@ -15,6 +15,7 @@ * */ +#include "qtbc.h" #include "entry.h" class ClassDef; @@ -30,8 +31,8 @@ class DiagramItem DiagramItem(DiagramItem *p,int number,ClassDef *cd, Protection prot,Specifier virt,const char *ts); ~DiagramItem(); - QString label() const; - QString fileName() const; + QCString label() const; + QCString fileName() const; DiagramItem *parentItem() { return parent; } DiagramItemList *getChildren() { return children; } void move(int dx,int dy) { x+=dx; y+=dy; } @@ -53,7 +54,7 @@ class DiagramItem int num; Protection prot; Specifier virt; - QString templSpec; + QCString templSpec; bool inList; ClassDef *classDef; }; diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 8c11c0b..76518ba 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -15,7 +15,7 @@ * */ -#include <qstring.h> +#include "qtbc.h" #include <qfileinf.h> #include <qfile.h> #include <qdir.h> @@ -109,6 +109,7 @@ QTextStream tagFile; void addMemberDocs(Entry *root,MemberDef *md, const char *funcDecl, bool over_load); +const char idMask[] = "[A-Za-z_][A-Za-z_0-9]*"; //---------------------------------------------------------------------- // Returns the standard string that is generated when the \overload @@ -166,8 +167,8 @@ void buildGroupList(Entry *root) // // if ((gd=groupDict[root->name])) // { -// QListIterator<QString> sli(*root->groups); -// QString *s; +// QListIterator<QCString> sli(*root->groups); +// QCString *s; // for (;(s=sli.current());++sli) // { // GroupDef *pgd; @@ -192,7 +193,7 @@ void buildGroupList(Entry *root) void buildFileList(Entry *root) { if (((root->section==Entry::FILEDOC_SEC) || - ((root->section & Entry::FILE_MASK) && extractAllFlag)) && + ((root->section & Entry::FILE_MASK) && Config::extractAllFlag)) && root->name.length()>0 ) { @@ -212,8 +213,8 @@ void buildFileList(Entry *root) fd->setDocumentation(root->doc); fd->setBriefDescription(root->brief); fd->addSectionsToDefinition(root->anchors); - QListIterator<QString> sli(*root->groups); - QString *s; + QListIterator<QCString> sli(*root->groups); + QCString *s; for (;(s=sli.current());++sli) { GroupDef *gd=0; @@ -307,11 +308,11 @@ void addIncludeFile(ClassDef *cd,FileDef *ifd,Entry *root) /*! Input is a scopeName, output is the scopename split into a * namespace part (as large as possible) and a classname part. */ -void extractNamespaceName(const QString &scopeName, - QString &className,QString &namespaceName) +void extractNamespaceName(const QCString &scopeName, + QCString &className,QCString &namespaceName) { - QString clName=scopeName.copy(); - QString nsName; + QCString clName=scopeName.copy(); + QCString nsName; if (clName.length()>0 && namespaceDict[clName]) { // the whole name is a namespace namespaceName=clName.copy(); @@ -346,7 +347,9 @@ static bool addNamespace(Entry *root,ClassDef *cd) if (e->section==Entry::NAMESPACE_SEC) { NamespaceDef *nd=0; - if (!e->name.isEmpty() && (nd=namespaceDict[e->name])) + if (!e->name.isEmpty() && e->name.at(0)!='@' && + (nd=namespaceDict[e->name]) + ) { cd->setNamespace(nd); nd->insertClass(cd); @@ -359,6 +362,7 @@ static bool addNamespace(Entry *root,ClassDef *cd) return FALSE; } + //---------------------------------------------------------------------- // build a list of all classes mentioned in the documentation // and all classes that have a documentation block before their definition. @@ -370,7 +374,7 @@ void buildClassList(Entry *root) root->name.length()>0 ) { - QString fullName=root->name.copy(); + QCString fullName=root->name.copy(); if (fullName.length()==0) { // this should not be called @@ -379,19 +383,7 @@ void buildClassList(Entry *root) } else { - //QString className; - //QString namespaceName; - //extractNamespaceName(fullName,className,namespaceName); - - //printf("Found class %s in %s at line %d\n",fullName.data(), - // root->fileName.data(),root->startLine); - // add class name substitution entry iff the class name is alterned by a - // define. This is needed to properly document Qt's template classes - // (although, it's quite general) - //if (resolveDefines(fullName)!=fullName) - //{ - // substituteDict.insert(resolveDefines(fullName),new QString(fullName)); - //} + fullName=stripAnnonymousScope(fullName); bool ambig; ClassDef *cd; @@ -427,13 +419,7 @@ void buildClassList(Entry *root) } addNamespace(root,cd); } - else if (fullName[0]!='@' /* && - (root->doc.length()>0 || - root->brief.length()>0 || - extractAllFlag - )*/ - ) - // new class + else // new class { ClassDef::CompoundType sec=ClassDef::Class; switch(root->section) @@ -448,13 +434,12 @@ void buildClassList(Entry *root) ClassDef *cd=new ClassDef(fullName,sec); cd->setDocumentation(root->doc); // copy docs to definition cd->setBriefDescription(root->brief); - //printf("new ClassDef tempArgList=%p\n",root->tArgList); cd->setTemplateArguments(root->tArgList); cd->setProtection(root->protection); cd->addSectionsToDefinition(root->anchors); - QListIterator<QString> sli(*root->groups); - QString *s; + QListIterator<QCString> sli(*root->groups); + QCString *s; for (;(s=sli.current());++sli) { GroupDef *gd=0; @@ -475,7 +460,7 @@ void buildClassList(Entry *root) // if the class is not in a namespace then we insert // it in the file definition if (!found && ifd) ifd->insertClass(cd); - + // the empty string test is needed for extract all case cd->setBriefDescription(root->brief); cd->insertUsedFile(root->fileName); @@ -506,7 +491,7 @@ void buildNamespaceList(Entry *root) root->name.length()>0 ) { - QString fullName=root->name.copy(); + QCString fullName=root->name.copy(); if (fullName.length()==0) { // this should not be called @@ -549,7 +534,7 @@ void buildNamespaceList(Entry *root) } else /* if (root->doc.length()>0 || root->brief.length()>0 || - extractAllFlag + Config::extractAllFlag ) */ { @@ -558,8 +543,8 @@ void buildNamespaceList(Entry *root) nd->setBriefDescription(root->brief); nd->addSectionsToDefinition(root->anchors); - QListIterator<QString> sli(*root->groups); - QString *s; + QListIterator<QCString> sli(*root->groups); + QCString *s; for (;(s=sli.current());++sli) { GroupDef *gd=0; @@ -645,35 +630,29 @@ void buildVarList(Entry *root) } } - QString scope,name=root->name.copy(); + QCString scope,name=root->name.copy(); bool stat=root->stat; - ClassDef *cd=0; Entry *p = root->parent; - while ((p->section & Entry::COMPOUND_MASK) || - p->section==Entry::NAMESPACE_SEC) + while ((p->section & Entry::SCOPE_MASK)) { - if (p->name.length()>0 && p->name[0]!='@') + QCString scopeName = stripAnnonymousScope(p->name); + if (!scopeName.isEmpty()) { - if (!scope.isEmpty()) scope.prepend("::"); - scope.prepend(p->name); + scope.prepend(scopeName); break; } + //if (p->name.length()>0 && p->name[0]!='@') + //{ + // if (!scope.isEmpty()) scope.prepend("::"); + // scope.prepend(p->name); + // break; + //} p=p->parent; } //printf("scope=%s\n",scope.data()); int ni; -#if 0 - if ((ni=root->name.findRev("::"))!=-1) - { - if (scope.length()>0) scope+="::"; - scope+=root->name.left(ni); - name=root->name.right(root->name.length()-ni-2); - stat=TRUE; - } -#endif - if ((ni=root->name.findRev("::"))!=-1) goto nextMember; /* skip this member, because it is a * static variable definition (always?), which will be @@ -684,7 +663,7 @@ void buildVarList(Entry *root) MemberDef::MemberType mtype; // NamespaceDef *nd = 0; - QString type=root->type.stripWhiteSpace(); + QCString type=root->type.stripWhiteSpace(); if (type=="@") mtype=MemberDef::EnumValue; else if (type.left(8)=="typedef ") @@ -694,6 +673,7 @@ void buildVarList(Entry *root) else mtype=MemberDef::Variable; + ClassDef *cd=0; if (scope.length()>0 && name.length()>0 && (cd=getClass(scope))) { @@ -712,7 +692,7 @@ void buildVarList(Entry *root) // scope+=cd->getTemplateNameString(); //} // generate member definition. - QString def; + QCString def; if (root->type.length()>0) { if (mtype==MemberDef::Friend) @@ -743,23 +723,6 @@ void buildVarList(Entry *root) if (md->memberClass()==cd) // member already in the scope { addMemberDocs(root,md,def,FALSE); - -#if 0 - // always trust the most protected scope, so adjust if needed - // This is needed to properly place static private variables, - // which are defined in a `public' scope. - printf("Checking protection level\n"); - if (root->protection==Private || md->protection()!=Private) - { - printf("Set to private\n"); - md->setProtection(Private); - } - else if (root->protection==Protected && md->protection()==Public) - { - printf("Set to protected\n"); - md->setProtection(Protected); - } -#endif found=TRUE; } md=mn->next(); @@ -802,56 +765,6 @@ void buildVarList(Entry *root) cd->insertUsedFile(root->fileName); } } -#if 0 - else if (scope.length()>0 && name.length()>0 && (nd=namespaceDict[scope])) - { - Debug::print(Debug::Variables,0, - " namespace variable:\n" - " type=`%s' scope=`%s' name=`%s' args=`%s' prot=`%d\n", - root->type.data(), - scope.data(), - name.data(), - root->args.data(), - root->protection - ); - // new global variable, enum value or typedef - MemberDef *md=new MemberDef(root->type,name,root->args,0, - Public, Normal,root->stat,FALSE, - mtype,0,0); - md->setDefFile(root->fileName); - md->setDefLine(root->startLine); - md->setDocumentation(root->doc); - md->setBriefDescription(root->brief); - md->addSectionsToDefinition(root->anchors); - QString def; - nd->insertMember(md); - md->setNamespace(nd); - if (root->type.length()>0) - { - def=root->type+" "+nd->name()+"::"+name+root->args; - } - else - { - def=nd->name()+"::"+name+root->args; - } - if (def.left(7)=="static ") def=def.right(def.length()-7); - md->setDefinition(def); - - MemberName *mn; - // add member definition to the list of globals - if ((mn=namespaceNameDict[name])) - { - mn->inSort(md); - } - else - { - mn = new MemberName(name); - mn->inSort(md); - namespaceNameDict.insert(name,mn); - namespaceNameList.inSort(mn); - } - } -#endif else if (name.length()>0) // global variable { Debug::print(Debug::Variables,0, @@ -873,15 +786,15 @@ void buildVarList(Entry *root) md->setDocumentation(root->doc); md->setBriefDescription(root->brief); md->addSectionsToDefinition(root->anchors); - QString def; + QCString def; // see if the function is inside a namespace NamespaceDef *nd = 0; - if (root->parent->section == Entry::NAMESPACE_SEC ) + if (scope.length()>0) { - nd = namespaceDict[root->parent->name]; + nd = namespaceDict[scope]; } - if (nd) + if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') { nd->insertMember(md); md->setNamespace(nd); @@ -901,8 +814,8 @@ void buildVarList(Entry *root) } // determine the definition of the global variable - if (nd) // variable is inside a namespace, so put the scope - // before the name + if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') + // variable is inside a namespace, so put the scope before the name { if (root->type.length()>0) { @@ -961,20 +874,20 @@ void buildMemberList(Entry *root) { Debug::print(Debug::Functions,0, "FUNCTION_SEC:\n" - " `%s' `%s'::`%s' `%s' relates=`%s' file=`%s' #targs=%d\n", + " `%s' `%s'::`%s' `%s' relates=`%s' file=`%s' #targs=%d docs=`%s'\n", root->type.data(), root->parent->name.data(), root->name.data(), root->args.data(), root->relates.data(), root->fileName.data(), - root->tArgList ? (int)root->tArgList->count() : -1 + root->tArgList ? (int)root->tArgList->count() : -1, + root->doc.data() ); bool isFriend=root->type.find("friend ")!=-1; - //if (isFriend && root->relates.length()==0) - // root->relates=root->parent->name.copy(); - if (root->name.length()>0 /* && !isFriend */) + + if (root->name.length()>0) { ClassDef *cd=0; @@ -983,11 +896,12 @@ void buildMemberList(Entry *root) //printf("root->parent=`%s' cd=%p root->type.find(re,0)=%d\n", // root->parent->name.data(),getClass(root->parent->name), // root->type.find(re,0)); + QCString scope=stripAnnonymousScope(root->parent->name.copy()); int i; if (root->parent && root->parent->name.length()>0 && (root->parent->section & Entry::COMPOUND_MASK) && - (cd=getClass(root->parent->name)) && + (cd=getClass(scope)) && // do some fuzzy things to exclude function pointers (root->type.isNull() || root->type.find(re,0)==-1 || root->type.find(")(")!=-1 || root->type.find("operator")!=-1 @@ -1001,7 +915,7 @@ void buildMemberList(Entry *root) root->type=root->type.left(i+l); } - QString name=removeRedundantWhiteSpace(root->name); + QCString name=removeRedundantWhiteSpace(root->name); if (name.left(2)=="::") name=name.right(name.length()-2); MemberDef::MemberType mtype; @@ -1009,7 +923,16 @@ void buildMemberList(Entry *root) else if (root->sig) mtype=MemberDef::Signal; else if (root->slot) mtype=MemberDef::Slot; else mtype=MemberDef::Function; - // new member of function, signal or slot. + + //if (Config::includeSourceFlag && !root->body.isEmpty()) + //{ + // printf("Function: %s\n-----------------\n%s\n------------------\n", + // root->name.data(),root->body.data()); + //} + + // new member function, signal or slot. + //printf("new member: %s class template args=`%s'\n", + // root->args.data(),argListToString(cd->templateArguments()).data()); MemberDef *md=new MemberDef(root->type,name,root->args,root->exception, root->protection,root->virt,root->stat,root->relates.length()>0, mtype,root->tArgList,root->argList); @@ -1018,8 +941,10 @@ void buildMemberList(Entry *root) md->setDefLine(root->startLine); md->setDocumentation(root->doc); md->setBriefDescription(root->brief); + md->setBody(root->body); + //md->setScopeTemplateArguments(cd->templateArguments()); md->addSectionsToDefinition(root->anchors); - QString def; + QCString def; if (root->relates.length()>0 || isFriend) { if (root->type.length()>0) @@ -1047,7 +972,6 @@ void buildMemberList(Entry *root) } else { - QString scope=root->parent->name.copy(); if (root->type.length()>0) { if (root->argList) @@ -1110,7 +1034,9 @@ void buildMemberList(Entry *root) !(root->parent->section & Entry::COMPOUND_MASK) && root->name.find("::")==-1 && root->relates.length()==0 && - root->type.left(7)!="extern ") + root->type.left(7)!="extern " && + root->type.left(8)!="typedef " + ) // no member => unrelated function { /* check the uniqueness of the function name in the file. @@ -1153,7 +1079,7 @@ void buildMemberList(Entry *root) // root->type.data(),root->name.data(),root->args.data()); // new global function - QString name=removeRedundantWhiteSpace(root->name); + QCString name=removeRedundantWhiteSpace(root->name); MemberDef *md=new MemberDef(root->type,name,root->args,root->exception, root->protection,root->virt,root->stat,FALSE, MemberDef::Function,root->tArgList,root->argList); @@ -1162,8 +1088,9 @@ void buildMemberList(Entry *root) md->setDocumentation(root->doc); md->setBriefDescription(root->brief); md->setPrototype(root->proto); + md->setBody(root->body); md->addSectionsToDefinition(root->anchors); - QString def; + QCString def; if (root->type.length()>0) { if (root->argList) @@ -1205,7 +1132,8 @@ void buildMemberList(Entry *root) { nd = namespaceDict[root->parent->name]; } - if (nd) + + if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') { nd->insertMember(md); md->setNamespace(nd); @@ -1386,22 +1314,23 @@ void computeClassRelations(Entry *root) if (!cd->visited) { cd->visited=TRUE; // mark class as used (in case the are multiple classes - // with the same name!) + // with the same name!) if (root->extends->count()>0) // there are base classes { - QString scopePrefix; + QCString scopePrefix; Entry *p=root->parent; + bool found=FALSE; // For nested classes the base class could also be nested! // To find the correct scope, we try to prepend the scope to the base // name, starting with the largest, most inner scope. - while (p->section&Entry::COMPOUND_MASK) + while (p->section&Entry::COMPOUND_MASK && !found) { scopePrefix=p->name+"::"; QList<BaseInfo> *baseList=root->extends; BaseInfo *bi=baseList->first(); - while (bi) // for each base class + while (bi && !found) // for each base class { - QString cName=scopePrefix+bi->name; + QCString cName=scopePrefix+bi->name; //printf("Base class %s\n",cName.data()); ClassDef *baseClass=getClass(cName); if (baseClass) // base class is documented @@ -1411,6 +1340,7 @@ void computeClassRelations(Entry *root) cd->insertBaseClass(baseClass,bi->prot,bi->virt); // add this class as super class to the base class baseClass->insertSuperClass(cd,bi->prot,bi->virt); + found=TRUE; } //else // base class not documented //{ @@ -1421,71 +1351,75 @@ void computeClassRelations(Entry *root) } p=p->parent; } - // The base class could ofcouse also be a non-nested class - QList<BaseInfo> *baseList=root->extends; - BaseInfo *bi=baseList->first(); - while (bi) // for each base class + if (!found) { - ClassDef *baseClass=getClass(bi->name); - //printf("baseClass %s of %s found (%s and %s)\n", - // bi->name.data(), - // root->name.data(), - // (bi->prot==Private)?"private":((bi->prot==Protected)?"protected":"public"), - // (bi->virt==Normal)?"normal":"virtual" - // ); - int i; - QString templSpec,baseClassName=bi->name.copy(); - if (!baseClass && (i=bi->name.find('<'))!=-1) - // base class has template specifiers - { - // TODO: here we should try to find the correct template specialization - // but for now, we only look for the unspecializated base class. - baseClassName=bi->name.left(i); - baseClass=getClass(baseClassName); - templSpec=bi->name.right(bi->name.length()-i); - } - if (baseClass) // base class is documented - { - // add base class to this class - cd->insertBaseClass(baseClass,bi->prot,bi->virt,templSpec); - // add this class as super class to the base class - baseClass->insertSuperClass(cd,bi->prot,bi->virt,templSpec); - } - else // base class not documented + // The base class could ofcouse also be a non-nested class + QList<BaseInfo> *baseList=root->extends; + BaseInfo *bi=baseList->first(); + while (bi) // for each base class { - NamespaceDef *nd=cd->getNamespace(); - //printf("Found undocumented base class `%s' namespace scope=`%s'\n", - // bi->name.data(),nd ? nd->name().data() : "<none>"); - if (nd && (baseClass=getClass(nd->name()+"::"+baseClassName))) - // class is defined inside namespace + ClassDef *baseClass=getClass(bi->name); + //printf("baseClass %s of %s found (%s and %s)\n", + // bi->name.data(), + // root->name.data(), + // (bi->prot==Private)?"private":((bi->prot==Protected)?"protected":"public"), + // (bi->virt==Normal)?"normal":"virtual" + // ); + int i; + QCString templSpec,baseClassName=bi->name.copy(); + if (!baseClass && (i=bi->name.find('<'))!=-1) + // base class has template specifiers { - // add base class to this class - cd->insertBaseClass(baseClass,bi->prot,bi->virt,templSpec); - // add this class as super class to the base class - baseClass->insertSuperClass(cd,bi->prot,bi->virt,templSpec); + // TODO: here we should try to find the correct template specialization + // but for now, we only look for the unspecializated base class. + baseClassName=bi->name.left(i); + baseClass=getClass(baseClassName); + templSpec=bi->name.right(bi->name.length()-i); } - else // undocumented base class + if (baseClass) // base class is documented { - baseClass=new ClassDef(bi->name,ClassDef::Class); // add base class to this class cd->insertBaseClass(baseClass,bi->prot,bi->virt,templSpec); // add this class as super class to the base class baseClass->insertSuperClass(cd,bi->prot,bi->virt,templSpec); - // the undocumented base was found in this file - baseClass->insertUsedFile(root->fileName); - // add class to the list - classList.inSort(baseClass); - //printf("ClassDict.insert(%s)\n",resolveDefines(fullName).data()); - //classDict.insert(resolveDefines(bi->name),baseClass); - classDict.insert(bi->name,baseClass); } + else // base class not documented + { + NamespaceDef *nd=cd->getNamespace(); + //printf("Found undocumented base class `%s' namespace scope=`%s'\n", + // bi->name.data(),nd ? nd->name().data() : "<none>"); + if (nd && (baseClass=getClass(nd->name()+"::"+baseClassName))) + // class is defined inside namespace + { + // add base class to this class + cd->insertBaseClass(baseClass,bi->prot,bi->virt,templSpec); + // add this class as super class to the base class + baseClass->insertSuperClass(cd,bi->prot,bi->virt,templSpec); + } + else // undocumented base class + { + //printf(">>> Undocumented base class = %s\n",bi->name.data()); + baseClass=new ClassDef(baseClassName,ClassDef::Class); + // add base class to this class + cd->insertBaseClass(baseClass,bi->prot,bi->virt,templSpec); + // add this class as super class to the base class + baseClass->insertSuperClass(cd,bi->prot,bi->virt,templSpec); + // the undocumented base was found in this file + baseClass->insertUsedFile(root->fileName); + // add class to the list + classList.inSort(baseClass); + //printf("ClassDict.insert(%s)\n",resolveDefines(fullName).data()); + //classDict.insert(resolveDefines(bi->name),baseClass); + classDict.insert(bi->name,baseClass); + } + } + bi=baseList->next(); } - bi=baseList->next(); } } // else // class has no base classes // { -// QString resName=resolveDefines(root->name); +// QCString resName=resolveDefines(root->name); // int i; // // Check if this class is a template instance of another class. // // If this is the case, we act as if this class `inherits' from the @@ -1570,7 +1504,7 @@ void addMemberDocs(Entry *root,MemberDef *md, const char *funcDecl, { //printf("addMemberDocs: `%s'::`%s' `%s' funcDecl=`%s'\n", // root->parent->name.data(),md->name().data(),md->argsString(),funcDecl); - QString fDecl=funcDecl; + QCString fDecl=funcDecl; // strip extern specifier if (fDecl.left(7)=="extern ") fDecl=fDecl.right(fDecl.length()-7); md->setDefinition(fDecl); @@ -1580,10 +1514,13 @@ void addMemberDocs(Entry *root,MemberDef *md, const char *funcDecl, cd ? cd->name().data() : 0, nd ? nd->name().data() : 0 ) - ) mergeArguments(md->argumentList(),root->argList); + ) + { + mergeArguments(md->argumentList(),root->argList); + } if (over_load) // the \overload keyword was used { - QString doc=getOverloadDocs(); + QCString doc=getOverloadDocs(); if (!root->doc.isNull()) { doc+="<p>"; @@ -1596,7 +1533,7 @@ void addMemberDocs(Entry *root,MemberDef *md, const char *funcDecl, // documentation outside a compound overrides the documentation inside it if ( /* !md->isStatic() && !root->stat && do not replace doc of a static */ ( - !md->documentation() || /* no docs yet */ + md->documentation().isEmpty() || /* no docs yet */ (root->parent->name.isNull() && /* or overwrite prototype docs */ !root->proto && md->isPrototype() /* with member definition docs */ ) @@ -1610,13 +1547,18 @@ void addMemberDocs(Entry *root,MemberDef *md, const char *funcDecl, // outside it if ( /* !md->isStatic() && !root->stat && do not replace doc of static */ ( - !md->briefDescription() || /* no docs yet */ - !root->parent->name.isNull() /* member of a class */ + md->briefDescription().isEmpty() || /* no docs yet */ + !root->parent->name.isNull() /* member of a class */ ) && root->brief.length()>0 ) { md->setBriefDescription(root->brief); } + + if (md->bodyCode().isEmpty() && !root->body.isEmpty()) /* no body yet */ + { + md->setBody(root->body); + } } md->setDefFile(root->fileName); md->setDefLine(root->startLine); @@ -1630,13 +1572,13 @@ void addMemberDocs(Entry *root,MemberDef *md, const char *funcDecl, // function declaration `decl' to the corresponding member definition. bool findUnrelatedFunction(Entry *root, - const QString &namespaceName, + const QCString &namespaceName, const char *name, const char *, const char *decl) { MemberName *mn=0; - QString n=name; + QCString n=name; if (n.find("::")!=-1) return FALSE; // skip undefined class members //printf("findUnrelatedFunction(%s)\n",name); if (n.length()>0 && (mn=functionNameDict[n])) // function name defined @@ -1646,7 +1588,7 @@ bool findUnrelatedFunction(Entry *root, while (md) { NamespaceDef *nd=md->getNamespace(); - QString nsName = nd ? nd->name().data() : ""; + QCString nsName = nd ? nd->name().data() : ""; if (namespaceName.length()==0 || nsName==namespaceName) { @@ -1698,6 +1640,89 @@ bool findUnrelatedFunction(Entry *root, return TRUE; } +void substituteTemplateArgNames(ArgumentList *src, + const QCString &s, + ArgumentList *tempArgs, + ArgumentList *dst) +{ + ArgumentListIterator ali(*src); + Argument *a=0; + for (ali.toFirst();(a=ali.current());++ali) // for each member argument + { + QCString type=a->type.copy(); + bool isReplaced=FALSE; + QRegExp re(idMask); + int i,p=0,l,c=0; + while ((i=re.match(s,p,&l))!=-1) // for each template name found at the + // member definition + { + Argument *ta = tempArgs->at(c); + if (ta) // get matching template argument of the class + { + QCString dstName=s.mid(i,l); + QCString srcName=ta->type.copy(); + int bi; + if ((bi=srcName.findRev(' '))!=-1) // search for separator + { + // strip the type specifier (usuall class or typename) + srcName=srcName.right(srcName.length()-bi-1); + } + + //if (srcName.left(6)=="class ") srcName=srcName.right(srcName.length()-6); + //if (srcName.left(9)=="typename ") srcName=srcName.right(srcName.length()-9); + //printf("Template Name = `%s' -> `%s'\n",srcName.data(),dstName.data()); + if (srcName!=dstName) /* we need to substitute */ + { + int ti,tp=0; + QCString result; + int sl=srcName.length(); + while ((ti=type.find(srcName,tp))!=-1) + { + result+=type.mid(tp,ti-tp); + if ( + (ti==0 || !isId(type.at(ti-1))) && + (ti+sl==(int)type.length() || !isId(type.at(ti+sl))) + ) /* idenitifier -> replace */ + { + result+=dstName; + } + else /* substring of an identifier */ + { + result+=srcName; + } + tp=ti+sl; + } + result+=type.right(type.length()-tp); + type=result; + isReplaced = TRUE; + } + } + p=i+l; + c++; + } + Argument *na = new Argument(*a); + if (isReplaced) + { + //printf("Template Arg: `%s' -> `%s'\n",na->type.data(),type.data()); + na->type=type; + } + else + { + //printf("Template Arg `%s' not changed\n",a->type.data()); + } + dst->append(na); + } + //printf("substituteTemplateArgNames(src=`%s',tempNameStr=`%s',tempArgs=`%s',dest=`%s')\n", + // argListToString(src).data(), + // s.data(), + // argListToString(tempArgs).data(), + // argListToString(dst).data() + // ); + dst->constSpecifier = src->constSpecifier; + dst->volatileSpecifier = src->volatileSpecifier; + dst->pureSpecifier = src->pureSpecifier; + +} //---------------------------------------------------------------------- // This function tries to find a member (in a documented class/file/namespace) @@ -1710,23 +1735,28 @@ bool findUnrelatedFunction(Entry *root, // The boolean overloaded is used to specify whether or not a standard // overload documentation line should be generated. -void findMember(Entry *root,QString funcDecl,QString related,bool overloaded, +void findMember(Entry *root,QCString funcDecl,QCString related,bool overloaded, bool isFunc) { Debug::print(Debug::FindMembers,0, - "findMember(root=%p,funcDecl=`%s',related=`%s',overload=%d,isFunc=%d)\n", - root,funcDecl.data(),related.data(),overloaded,isFunc + "findMember(root=%p,funcDecl=`%s',related=`%s',overload=%d,isFunc=%d\n====\ndoc=%s\n====\n)\n", + root,funcDecl.data(),related.data(),overloaded,isFunc,root->doc.data() ); + if (Config::includeSourceFlag && !root->body.isEmpty()) + { + //printf("Function: %s\n-----------------\n%s\n------------------\n", + //root->name.data(),root->body.data()); + } - QString scopeName; - QString className; - QString namespaceName; - QString classTempList; - QString funcType; - QString funcName; - QString funcArgs; - QString funcTempList; - QString exceptions; + QCString scopeName; + QCString className; + QCString namespaceName; + QCString classTempList; + QCString funcType; + QCString funcName; + QCString funcArgs; + QCString funcTempList; + QCString exceptions; bool isRelated=FALSE; bool isFriend=FALSE; @@ -1764,7 +1794,8 @@ void findMember(Entry *root,QString funcDecl,QString related,bool overloaded, // if a related class name is specified and the class name could // not be derived from the function declaration, then use the // related field. - //printf("scopeName=`%s' className=`%s'\n",scopeName.data(),className.data()); + //printf("scopeName=`%s' classTempList=`%s' className=`%s'\n", + // scopeName.data(),classTempList.data(),className.data()); if (/*scopeName.isEmpty() &&*/ !related.isEmpty() && !isRelated) { isRelated=TRUE; @@ -1805,6 +1836,41 @@ void findMember(Entry *root,QString funcDecl,QString related,bool overloaded, } } + // see if (part of) the scope name is a namespace name + extractNamespaceName(scopeName,className,namespaceName); + + QCString tempScopeName=scopeName.copy(); + int ti; + int spi = namespaceName.isEmpty() ? 0 : namespaceName.length()+2; + if ((ti=tempScopeName.find("::",spi))!=-1 && !classTempList.isEmpty()) + { + // insert template parameters after the first scope name + tempScopeName=tempScopeName.left(ti)+classTempList+ + tempScopeName.right(tempScopeName.length()-ti); + } + else + { + tempScopeName+=classTempList; + } + + + if (root->tArgList==0 && !classTempList.isEmpty()) + { + // no template specifiers found during parsing (because \fn was used), + // but there are template names in the scope, so we build the template + // specifiers from that. + root->tArgList = new ArgumentList; + QRegExp re(idMask); + int i,p=0,l; + while ((i=re.match(classTempList,p,&l))!=-1) // for each template name found + { + Argument *a = new Argument; + a->type = "class "+classTempList.mid(i,l); + root->tArgList->append(a); + p=i+l; + } + } + //printf("scopeName=`%s' className=`%s'\n",scopeName.data(),className.data()); // rebuild the function declaration (needed to get the scope right). if (scopeName.length()>0 && !isRelated && !isFriend) @@ -1813,22 +1879,22 @@ void findMember(Entry *root,QString funcDecl,QString related,bool overloaded, { if (isFunc) // a function -> we use argList for the arguments { - funcDecl=funcType+" "+scopeName+classTempList+"::"+funcName+funcTempList; + funcDecl=funcType+" "+tempScopeName+"::"+funcName+funcTempList; } else { - funcDecl=funcType+" "+scopeName+classTempList+"::"+funcName+funcArgs; + funcDecl=funcType+" "+tempScopeName+"::"+funcName+funcArgs; } } else { if (isFunc) // a function => we use argList for the arguments { - funcDecl=scopeName+classTempList+"::"+funcName+funcTempList; + funcDecl=tempScopeName+"::"+funcName+funcTempList; } else // variable => add `argument' list { - funcDecl=scopeName+classTempList+"::"+funcName+funcArgs; + funcDecl=tempScopeName+"::"+funcName+funcArgs; } } } @@ -1858,12 +1924,10 @@ void findMember(Entry *root,QString funcDecl,QString related,bool overloaded, } } - QString fullFuncDecl=funcDecl.copy(); + QCString fullFuncDecl=funcDecl.copy(); if (isFunc) fullFuncDecl+=argListToString(root->argList); //printf("scopeName=`%s' className=`%s'\n",scopeName.data(),className.data()); - // see if (part of) the scope name is a namespace name - extractNamespaceName(scopeName,className,namespaceName); //printf("scopeName=`%s' className=`%s'\n",scopeName.data(),className.data()); // destructor => do backward class name substitution if needed @@ -1902,11 +1966,11 @@ void findMember(Entry *root,QString funcDecl,QString related,bool overloaded, if (className.length()>0) // class name is valid { int count=0; - MemberDef *md=mn->first(); + MemberDef *md=mn->first(); // for each member with that name while (md) { ClassDef *cd=md->memberClass(); - //printf("Member %s member className=%s this className=%s\n",md->name().data(),cd->name().data(),className.data()); + //printf("Member %s (member scopeName=%s) (this scopeName=%s) classTempList=%s\n",md->name().data(),cd->name().data(),scopeName.data(),classTempList.data()); ClassDef *tcd=0; if (classTempList.length()>0) // try to find the correct specialization { @@ -1917,15 +1981,60 @@ void findMember(Entry *root,QString funcDecl,QString related,bool overloaded, { tcd=getClass(scopeName); } - //printf("tcd=%p\n",tcd); - if (cd && tcd==cd) + if (cd && tcd==cd) // member's classes match { - //printf("Class %s\n",cd->name().data()); + int ci; + ArgumentList *classTemplArgs = cd->templateArguments(); + if ((ci=cd->name().find("::"))!=-1) // nested class + { + ClassDef *parentClass = getClass(cd->name().left(ci)); + if (parentClass) + classTemplArgs = parentClass->templateArguments(); + } + //printf("cd->name=%s classTemplArgs=%s\n",cd->name().data(), + // argListToString(classTemplArgs).data()); + ArgumentList *argList = 0; + bool substDone=FALSE; + if (!classTempList.isEmpty() && + classTemplArgs && + md->argumentList() + ) + { + /* the function definition has template arguments + * and the class also has template arguments, so + * we must substitute the template names if they are + * different before doing the match + */ + argList = new ArgumentList; + argList->setAutoDelete(TRUE); + substituteTemplateArgNames( + md->argumentList(), /* source argument list */ + classTempList, /* template names source */ + classTemplArgs, /* template names dest */ + argList /* dest argument list */ + ); + substDone=TRUE; + } + else /* no template arguments, compare argument lists directly */ + { + argList = md->argumentList(); + } bool matching= md->isVariable() || md->isTypedef() || // needed for function pointers (md->argumentList()==0 && root->argList->count()==0) || - matchArguments(md->argumentList(), root->argList, - className,namespaceName); + matchArguments(argList, root->argList,className,namespaceName); + + if (substDone) // found a new argument list + { + //printf("root->tArgList=`%s'\n",argListToString(root->tArgList).data()); + if (matching) // replace member's argument list + { + md->setScopeTemplateArguments(root->tArgList); + md->setArgumentList(argList); + } + else // no match -> delete argument list + delete argList; + } if (matching) { addMemberDocs(root,md,funcDecl,overloaded); @@ -1975,7 +2084,7 @@ void findMember(Entry *root,QString funcDecl,QString related,bool overloaded, ASSERT(md); ClassDef *cd=md->memberClass(); ASSERT(cd); - QString className=cd->name().copy(); + QCString className=cd->name().copy(); md=mn->next(); bool unique=TRUE; while (md) @@ -1997,7 +2106,7 @@ void findMember(Entry *root,QString funcDecl,QString related,bool overloaded, mtype,root->tArgList,root->argList); md->setMemberClass(cd); md->setDefinition(funcDecl); - QString doc=getOverloadDocs(); + QCString doc=getOverloadDocs(); doc+="<p>"; doc+=root->doc; md->setDocumentation(doc); @@ -2007,6 +2116,7 @@ void findMember(Entry *root,QString funcDecl,QString related,bool overloaded, md->setDefLine(root->startLine); md->setPrototype(root->proto); md->addSectionsToDefinition(root->anchors); + md->setBody(root->body); mn->inSort(md); cd->insertMember(md); cd->insertUsedFile(root->fileName); @@ -2071,6 +2181,7 @@ void findMember(Entry *root,QString funcDecl,QString related,bool overloaded, md->setDefFile(root->fileName); md->setDefLine(root->startLine); md->setPrototype(root->proto); + md->setBody(root->body); md->addSectionsToDefinition(root->anchors); mn->inSort(md); cd->insertMember(md); @@ -2118,8 +2229,8 @@ void findMemberDocumentation(Entry *root) int i,l; QRegExp re("([a-zA-Z0-9: ]*\\*+[ \\*]*"); Debug::print(Debug::FindMembers,0, - "root->type=`%s' root->name=`%s' root->args=`%s'\n", - root->type.data(),root->name.data(),root->args.data() + "root->type=`%s' root->name=`%s' root->args=`%s' section=%x\n", + root->type.data(),root->name.data(),root->args.data(),root->section ); bool isFunc=TRUE; if ((i=re.match(root->type,0,&l))!=-1) // func variable/typedef to func ptr @@ -2151,8 +2262,12 @@ void findMemberDocumentation(Entry *root) //printf("Overloaded member %s found\n",root->name.data()); findMember(root,root->name,root->relates,TRUE,isFunc); } - else if (root->section==Entry::FUNCTION_SEC && - (root->doc.length()>0 || root->brief.length()>0 || extractAllFlag)) + else if + (root->section==Entry::FUNCTION_SEC && + (!root->doc.isEmpty() || !root->brief.isEmpty() || + !root->body.isEmpty() /*|| Config::extractAllFlag*/ + ) + ) { //printf("Documentation for member `%s' found args=`%s' excp=`%s'\n", // root->name.data(),root->args.data(),root->exception.data()); @@ -2179,6 +2294,10 @@ void findMemberDocumentation(Entry *root) //if (root->relates.length()>0) printf(" Relates %s\n",root->relates.data()); findMember(root,root->name,root->relates,FALSE,FALSE); } + else + { + // skip section + } EntryListIterator eli(*root->sublist); Entry *e; for (;(e=eli.current());++eli) @@ -2195,31 +2314,31 @@ void findEnums(Entry *root) if (root->section==Entry::ENUM_SEC) // non anonymous enumeration { - MemberDef *md=0; - ClassDef *cd=0; - FileDef *fd=0; - NamespaceDef *nd=0; + MemberDef *md=0; + ClassDef *cd=0; + FileDef *fd=0; + NamespaceDef *nd=0; MemberNameDict *mnd=0; MemberNameList *mnl=0; bool isGlobal; //printf("Found enum with name `%s'\n",root->name.data()); int i; - QString name; + QCString name; if ((i=root->name.findRev("::"))!=-1) // scope is specified { - QString scope=root->name.left(i); // extract scope + QCString scope=root->name.left(i); // extract scope name=root->name.right(root->name.length()-i-2); // extract name - cd=getClass(scope); - if (!cd) nd=namespaceDict[scope]; + if ((cd=getClass(scope))==0) nd=namespaceDict[scope]; } else // no scope, check the scope in which the docs where found { - if (( root->parent->section & Entry::COMPOUND_MASK ) + if (( root->parent->section & Entry::SCOPE_MASK ) && root->parent->name.length()>0 ) // found enum docs inside a compound { - cd=getClass(root->parent->name); + QCString scope=root->parent->name; + if ((cd=getClass(scope))==0) nd=namespaceDict[scope]; } name=root->name.copy(); } @@ -2231,7 +2350,7 @@ void findEnums(Entry *root) mnl=&memberNameList; isGlobal=FALSE; } - else if (nd) // found enum inside namespace + else if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') // found enum inside namespace { mnd=&functionNameDict; mnl=&functionNameList; @@ -2254,7 +2373,7 @@ void findEnums(Entry *root) md->setDefFile(root->fileName); md->setDefLine(root->startLine); md->addSectionsToDefinition(root->anchors); - if (nd) + if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') { md->setDefinition(nd->name()+"::"+name); nd->insertMember(md); @@ -2299,12 +2418,12 @@ void findEnums(Entry *root) // get list of members with the same name as the field { MemberDef *fmd=fmn->first(); - while (fmd) // search for the class with the right name + while (fmd) // search for the scope with the right name { - if (nd) + if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') { NamespaceDef *fnd=fmd->getNamespace(); - if (fnd==nd) + if (fnd==nd) // enum value is inside a namespace { md->insertEnumField(fmd); fmd->setEnumScope(md); @@ -2313,7 +2432,7 @@ void findEnums(Entry *root) else if (isGlobal) { FileDef *ffd=fmd->getFileDef(); - if (ffd==fd) + if (ffd==fd) // enum value has file scope { md->insertEnumField(fmd); fmd->setEnumScope(md); @@ -2322,7 +2441,7 @@ void findEnums(Entry *root) else { ClassDef *fcd=fmd->memberClass(); - if (fcd==cd) + if (fcd==cd) // enum value is inside a class { md->insertEnumField(fmd); // add field def to list fmd->setEnumScope(md); // cross ref with enum name @@ -2358,10 +2477,10 @@ void findEnumDocumentation(Entry *root) //printf("Found docs for enum with name `%s'\n",root->name.data()); int i; ClassDef *cd=0; - QString name; + QCString name; if ((i=root->name.findRev("::"))!=-1) // scope is specified { - QString scope=root->name.left(i); // extract scope + QCString scope=root->name.left(i); // extract scope name=root->name.right(root->name.length()-i-2); // extract name cd=getClass(scope); //printf("Scope=`%s' Name=`%s'\n",scope.data(),name.data()); @@ -2382,7 +2501,7 @@ void findEnumDocumentation(Entry *root) if (cd) { //printf("Enum: scope=`%s' name=`%s'\n",cd->name(),name.data()); - QString className=cd->name().copy(); + QCString className=cd->name().copy(); MemberName *mn=memberNameDict[name]; if (mn) { @@ -2519,29 +2638,30 @@ void computeMemberRelations() while (mn) // for each member name { MemberNameIterator mdi(*mn); - for ( ; mdi.current() ; ++mdi) // for each function with a specific name + for ( ; mdi.current() ; ++mdi) // for each member with a specific arg list { MemberDef *md=mdi.current(); MemberNameIterator bmdi(*mn); - for ( ; bmdi.current() ; ++bmdi) // for each other function with that name + for ( ; bmdi.current() ; ++bmdi) // for each other member with that signature { MemberDef *bmd=bmdi.current(); - if (md!=bmd && bmd->memberClass() && md->memberClass() && - isBaseClass(bmd->memberClass(),md->memberClass())) + ClassDef *bmcd = bmd->memberClass(); + ClassDef *mcd = md->memberClass(); + //printf("Check relation between `%s'::`%s' and `%s'::`%s'\n", + // mcd->name().data(),md->name().data(), + // bmcd->name().data(),bmd->name().data() + // ); + if (md!=bmd && bmcd && mcd && isBaseClass(bmcd,mcd)) { - //printf("Checking Base: %s\nWith normal : %s\n",bmd->definition(),md->definition()); - if (/*matchArguments(bmd->argsString(),md->argsString())*/ - matchArguments(bmd->argumentList(),md->argumentList()) - ) + //printf(" Base argList=`%s'\n Super argList=`%s'\n", + // argListToString(bmd->argumentList()).data(), + // argListToString(md->argumentList()).data() + // ); + if ( matchArguments(bmd->argumentList(),md->argumentList()) ) { - //printf("Base: %s\nNorm: %s\n",bmd->definition(),md->definition()); - ClassDef *bmcd = bmd->memberClass(); - ClassDef *mcd = md->memberClass(); + //printf(" match found!\n"); if (mcd && bmcd && - (bmcd->protection()!=Private || extractPrivateFlag) && - (bmcd->hasDocumentation() || !hideClassFlag) && - (mcd->protection()!=Private || extractPrivateFlag) && - (mcd->hasDocumentation() || !hideClassFlag) + mcd->isVisibleExt() && bmcd->isVisibleExt() ) { md->setReimplements(bmd); @@ -2564,7 +2684,7 @@ void mergeMembers(ClassDef *cd,BaseClassList *bcl) //if (mcd->flag==TRUE) //{ // err("Error: Cyclic inhertance dependency found for class %s\n",mcd->name()); - // return; + // return; //} //mcd->flag=TRUE; @@ -2618,6 +2738,7 @@ void mergeMembers(ClassDef *cd,BaseClassList *bcl) found = /*matchArguments(srcMd->argsString(),dstMd->argsString());*/ matchArguments(srcMd->argumentList(),dstMd->argumentList()); + ambigue=!found; } else // member is in a non base class => multiple inheritance // using the same base class. @@ -2627,7 +2748,7 @@ void mergeMembers(ClassDef *cd,BaseClassList *bcl) // dstMd->name().data(), // dstMi->scopePath.left(dstMi->scopePath.find("::")+2).data()); - QString scope=dstMi->scopePath.left(dstMi->scopePath.find("::")+2); + QCString scope=dstMi->scopePath.left(dstMi->scopePath.find("::")+2); if (scope!=dstMi->ambiguityResolutionScope.left(scope.length())) dstMi->ambiguityResolutionScope.prepend(scope); ambigue=TRUE; @@ -2648,7 +2769,7 @@ void mergeMembers(ClassDef *cd,BaseClassList *bcl) // dstMd->name().data(), // dstMi->scopePath.left(dstMi->scopePath.find("::")+2).data()); - QString scope=dstMi->scopePath.left(dstMi->scopePath.find("::")+2); + QCString scope=dstMi->scopePath.left(dstMi->scopePath.find("::")+2); if (scope!=dstMi->ambiguityResolutionScope.left(scope.length())) dstMi->ambiguityResolutionScope.prepend(scope); ambigue=TRUE; @@ -2660,7 +2781,6 @@ void mergeMembers(ClassDef *cd,BaseClassList *bcl) Specifier virt=srcMi->virt; if (srcMi->virt==Normal && bcd->virt!=Normal) virt=bcd->virt; MemberInfo *newMi = new MemberInfo(srcMd,bcd->prot,virt); - //if (srcMi->memberDef->memberClass()!=bClass) newMi->scopePath=bClass->name()+"::"+srcMi->scopePath; if (ambigue) { @@ -2669,7 +2789,7 @@ void mergeMembers(ClassDef *cd,BaseClassList *bcl) // srcMd->name().data(), // bClass->name().data()); - QString scope=bClass->name().copy(); scope+="::"; + QCString scope=bClass->name().copy(); scope+="::"; if (scope!=srcMi->ambiguityResolutionScope.left(scope.length())) newMi->ambiguityResolutionScope= scope+srcMi->ambiguityResolutionScope; @@ -2764,7 +2884,8 @@ void generateFileDocs() void generateClassDocs() { // write the installdox script if necessary - if (generateHtml && (tagFileList.count()>0 || searchEngineFlag)) + if (Config::generateHtml && + (Config::tagFileList.count()>0 || Config::searchEngineFlag)) writeInstallScript(); msg("Generating index page...\n"); @@ -2797,8 +2918,8 @@ void generateClassDocs() if (!cd->isReference() && //!cd->name().isEmpty() && //cd->name().at(0)!='@' && - //(cd->protection()!=Private || extractPrivateFlag) && - //(cd->hasDocumentation() || !hideClassFlag) + //(cd->protection()!=Private || Config::extractPrivateFlag) && + //(cd->hasDocumentation() || !Config::hideClassFlag) cd->isVisible() ) // skip external references and anonymous compounds @@ -2807,7 +2928,7 @@ void generateClassDocs() cd->writeDocumentation(*outputList); cd->writeMemberList(*outputList); - if (verbatimHeaderFlag) cd->writeIncludeFile(*outputList); + if (Config::verbatimHeaderFlag) cd->writeIncludeFile(*outputList); } } } @@ -2912,31 +3033,33 @@ void buildPageList(Entry *root) } else { - QString baseName=root->name.copy(); + QCString baseName=root->name.copy(); if (baseName.right(4)==".tex") baseName=baseName.left(baseName.length()-4); else if (baseName.right(5)==".html") baseName=baseName.left(baseName.length()-5); pi=new PageInfo(baseName, root->doc, root->args.stripWhiteSpace()); - setFileNameForSections(root->anchors,root->name); + QCString pageName; + if (Config::caseSensitiveNames) + pageName=pi->name.copy(); + else + pageName=pi->name.lower(); + setFileNameForSections(root->anchors,pageName); + pageList.append(pi); pageDict.insert(baseName,pi); if (pi->title.length()>0) { - QString pageName; - if (caseSensitiveNames) - pageName=pi->name.copy(); - else - pageName=pi->name.lower(); //outputList->writeTitle(pi->name,pi->title); // a page name is a label as well! SectionInfo *si=new SectionInfo( pi->name,pi->title,SectionInfo::Section); si->fileName=pageName+".html"; + //printf(" SectionInfo: sec=%p sec->fileName=%s\n",si,si->fileName.data()); //printf("Adding section info %s\n",pi->name.data()); - sectionDict.insert(pi->name,si); + sectionDict.insert(pageName,si); } } } @@ -2979,8 +3102,8 @@ void generatePageDocs() { msg("Generating docs for page %s...\n",pi->name.data()); outputList->disable(OutputGenerator::Man); - QString pageName; - if (caseSensitiveNames) + QCString pageName; + if (Config::caseSensitiveNames) pageName=pi->name.copy(); else pageName=pi->name.lower(); @@ -3047,7 +3170,7 @@ void generateExampleDocs() while (pi) { msg("Generating docs for example %s...\n",pi->name.data()); - QString n=convertSlashes(pi->name,TRUE)+"-example"; + QCString n=convertSlashes(pi->name,TRUE)+"-example"; startFile(*outputList,n,"Example Documentation"); //outputList->writeTitle(pi->name,pi->name); parseExample(*outputList,pi->doc+"\n\\include "+pi->name,pi->name); @@ -3081,37 +3204,64 @@ void generateNamespaceDocs() NamespaceDef *nd; for (;(nd=nli.current());++nli) { - msg("Generating docs for namespace %s\n",nd->name().data()); - nd->writeDocumentation(*outputList); + if ((nd->getReference() || nd->hasDocumentation()) && + !nd->name().isEmpty() && nd->name().at(0)!='@') + { + msg("Generating docs for namespace %s\n",nd->name().data()); + nd->writeDocumentation(*outputList); + } } } +#if defined(_WIN32) +static QCString fixSlashes(QCString &s) +{ + QCString result; + uint i; + for (i=0;i<s.length();i++) + { + switch(s.at(i)) + { + case '/': + case '\\': + result+="\\\\"; + break; + default: + result+=s.at(i); + } + } + return result; +} +#endif + + //---------------------------------------------------------------------------- // generate files for the search engine void generateSearchIndex() { - if (searchEngineFlag && generateHtml) + if (Config::searchEngineFlag && Config::generateHtml) { // create search index - QString fileName; - writeSearchButton(htmlOutputDir); + QCString fileName; + writeSearchButton(Config::htmlOutputDir); +#if !defined(_WIN32) // create cgi script - fileName = htmlOutputDir+"/"+cgiName; + fileName = Config::htmlOutputDir+"/"+Config::cgiName; QFile f(fileName); if (f.open(IO_WriteOnly)) { QTextStream t(&f); t << "#!/bin/sh" << endl - << "DOXYSEARCH=" << binAbsPath << "/doxysearch" << endl - << "DOXYPATH=" << docAbsPath << " "; + << "DOXYSEARCH=" << Config::binAbsPath << "/doxysearch" << endl + << "DOXYPATH=" << Config::docAbsPath << " "; - char *s=extDocPathList.first(); + char *s=Config::extDocPathList.first(); while (s) { t << s << " "; - s=extDocPathList.next(); + s=Config::extDocPathList.next(); } t << endl @@ -3121,28 +3271,65 @@ void generateSearchIndex() << "else" << endl << " echo \"Content-Type: text/html\"" << endl << " echo \"\"" << endl - << " echo \"<H1>Error: $DOXYSEARCH not found. Check cgi script!\"" << endl + << " echo \"<h2>Error: $DOXYSEARCH not found. Check cgi script!</h2>\"" << endl << "fi" << endl; f.close(); struct stat stat_struct; stat(fileName,&stat_struct); -#if !defined(_WIN32) chmod(fileName,stat_struct.st_mode|S_IXUSR|S_IXGRP|S_IXOTH); -#endif } else { err("Error: Cannot open file %s for writing\n",fileName.data()); } +#else /* Windows platform */ + // create cgi program + fileName = Config::cgiName.copy(); + if (fileName.right(4)==".cgi") + fileName=fileName.left(fileName.length()-4); + fileName+=".c"; + fileName.prepend(Config::htmlOutputDir+"/"); + QFile f(fileName); + if (f.open(IO_WriteOnly)) + { + QTextStream t(&f); + t << "#include <stdio.h>" << endl; + t << "#include <stdlib.h>" << endl; + t << "#include <process.h>" << endl; + t << endl; + t << "const char *DOXYSEARCH = \"" << + fixSlashes(Config::binAbsPath) << "\\\\doxysearch.exe\";" << endl; + t << "const char *DOXYPATH = \"" << + fixSlashes(Config::docAbsPath) << "\";" << endl; + t << endl; + t << "int main(void)" << endl; + t << "{" << endl; + t << " char buf[1024];" << endl; + t << " sprintf(buf,\"%s %s\",DOXYSEARCH,DOXYPATH);" << endl; + t << " if (system(buf))" << endl; + t << " {" << endl; + t << " printf(\"Content-Type: text/html\\n\\n\");" << endl; + t << " printf(\"<h2>Error: failed to execute %s</h2>\\n\",DOXYSEARCH);" << endl; + t << " exit(1);" << endl; + t << " }" << endl; + t << " return 0;" << endl; + t << "}" << endl; + f.close(); + } + else + { + err("Error: Cannot open file %s for writing\n",fileName.data()); + } +#endif /* !defined(_WIN32) */ // create config file - fileName = htmlOutputDir+"/search.cfg"; + fileName = Config::htmlOutputDir+"/search.cfg"; f.setName(fileName); if (f.open(IO_WriteOnly)) { QTextStream t(&f); - t << docURL << endl << cgiURL << "/" << cgiName << endl; + t << Config::docURL << endl << Config::cgiURL << "/" << Config::cgiName << endl; f.close(); } else @@ -3194,7 +3381,7 @@ void generateConfigFile(const char *configFile,bool shortList) //---------------------------------------------------------------------------- // read and parse a tag file -bool readLineFromFile(QFile &f,QString &s) +bool readLineFromFile(QFile &f,QCString &s) { char c=0; s.resize(0); @@ -3226,7 +3413,12 @@ bool patternMatch(QFileInfo *fi,QStrList *patList) char *pattern=patList->first(); while (pattern && !found) { - found = found || QDir::match(pattern,fi->fileName()); +#if defined(_WIN32) // windows + QRegExp re(pattern,FALSE,TRUE); // case insensitive match +#else // unix + QRegExp re(pattern,TRUE,TRUE); // case sensitive match +#endif + found = found || re.match(fi->fileName())!=-1; pattern=patList->next(); } } @@ -3245,7 +3437,7 @@ void copyAndFilterFile(const char *fileName,BufStr &dest) QFileInfo fi(fileName); if (!fi.exists()) return; - if (inputFilter.isEmpty()) + if (Config::inputFilter.isEmpty()) { QFile f(fileName); if (!f.open(IO_ReadOnly)) @@ -3266,11 +3458,11 @@ void copyAndFilterFile(const char *fileName,BufStr &dest) { int c; // char *p=dest; - QString cmd=inputFilter+" "+fileName; + QCString cmd=Config::inputFilter+" "+fileName; FILE *f=popen(cmd,"r"); if (!f) { - err("Error: could not execute filter %s\n",inputFilter.data()); + err("Error: could not execute filter %s\n",Config::inputFilter.data()); return; } while ((c=fgetc(f))!=EOF) dest.addChar(c),size++; @@ -3295,17 +3487,17 @@ void copyAndFilterFile(const char *fileName,BufStr &dest) void readFiles(BufStr &output) { - QString *s=inputFiles.first(); + QCString *s=inputFiles.first(); // char *p=output.data(); while (s) { - QString fileName=*s; + QCString fileName=*s; //int fileSize=fi->fileInfo()->size(); int fileNameSize=fileName.length(); //int streamLength=fileSize+fileNameSize+4; - //QString fileText(streamLength); + //QCString fileText(streamLength); // add begin filename marker // *p++=0x06; @@ -3320,7 +3512,7 @@ void readFiles(BufStr &output) output.addChar(0x06); // *p++='\n'; // to make ^ work while scanning the first line of a file! output.addChar('\n'); - if (preprocessingFlag) + if (Config::preprocessingFlag) { msg("Preprocessing %s...\n",s->data()); preprocessFile(fileName,output); @@ -3376,7 +3568,7 @@ int readDir(QFileInfo *fi, patternMatch(cfi,patList) && !patternMatch(cfi,exclPatList)) { totalSize+=cfi->size()+cfi->absFilePath().length()+4; - QString name=cfi->fileName(); + QCString name=convertToQCString(cfi->fileName()); if (fnDict) { FileDef *fd=new FileDef(cfi->dirPath()+"/",name); @@ -3393,15 +3585,15 @@ int readDir(QFileInfo *fi, fnDict->insert(name,fn); } } - QString *rs=0; + QCString *rs=0; if (resultList || resultDict) { - rs=new QString(cfi->absFilePath()); + rs=new QCString(cfi->absFilePath()); } if (resultList) resultList->append(rs); if (resultDict) resultDict->insert(cfi->absFilePath(),rs); } - else if (recursiveFlag && cfi->isDir() && cfi->fileName()!="." && + else if (Config::recursiveFlag && cfi->isDir() && cfi->fileName()!="." && cfi->fileName()!="..") { cfi->setFile(cfi->absFilePath()); @@ -3417,9 +3609,9 @@ int readDir(QFileInfo *fi, //---------------------------------------------------------------------------- // read the file with name `name' into a string. -QString readExampleFile(const char *name) +QCString readExampleFile(const char *name) { - QString example; + QCString example; QFileInfo fi(name); if (fi.exists()) { @@ -3477,7 +3669,7 @@ int readFileOrDirectory(const char *s, { totalSize+=fi.size()+fi.absFilePath().length()+4; //readFile(&fi,fiList,input); //fiList->inSort(new FileInfo(fi)); - QString name=fi.fileName(); + QCString name=convertToQCString(fi.fileName()); if (fnDict) { FileDef *fd=new FileDef(fi.dirPath(TRUE)+"/",name); @@ -3494,10 +3686,10 @@ int readFileOrDirectory(const char *s, fnDict->insert(name,fn); } } - QString *rs=0; + QCString *rs=0; if (resultList || resultDict) { - rs=new QString(fi.absFilePath()); + rs=new QCString(fi.absFilePath()); } if (resultList) resultList->append(rs); if (resultDict) resultDict->insert(fi.absFilePath(),rs); @@ -3514,11 +3706,11 @@ int readFileOrDirectory(const char *s, void readFormulaRepository() { - QFile f(htmlOutputDir+"/formula.repository"); + QFile f(Config::htmlOutputDir+"/formula.repository"); if (f.open(IO_ReadOnly)) // open repository { QTextStream t(&f); - QString line; + QCString line; while (!t.eof()) { line=t.readLine(); @@ -3530,8 +3722,8 @@ void readFormulaRepository() } else { - QString formName = line.left(se); - QString formText = line.right(line.length()-se-1); + QCString formName = line.left(se); + QCString formText = line.right(line.length()-se-1); Formula *f=new Formula(formText); formulaList.append(f); formulaDict.insert(formText,f); @@ -3627,7 +3819,7 @@ int main(int argc,char **argv) } QFileInfo configFileInfo1("Doxyfile"),configFileInfo2("doxyfile"); - QString config; + QCString config; if (optind>=argc) { if (configFileInfo1.exists()) @@ -3646,23 +3838,24 @@ int main(int argc,char **argv) config=fileToString(argv[1]); parseConfig(config); + checkConfig(); /************************************************************************** * Initialize output generators * **************************************************************************/ outputList = new OutputList(TRUE); - if (generateHtml) + if (Config::generateHtml) { outputList->add(new HtmlGenerator); HtmlGenerator::init(); } - if (generateLatex) + if (Config::generateLatex) { outputList->add(new LatexGenerator); LatexGenerator::init(); } - if (generateMan) + if (Config::generateMan) { outputList->add(new ManGenerator); ManGenerator::init(); @@ -3674,42 +3867,43 @@ int main(int argc,char **argv) // gather names of all files in the include path msg("Searching for include files...\n"); - s=includePath.first(); + s=Config::includePath.first(); while (s) { - readFileOrDirectory(s,0,&includeNameDict,0,&filePatternList, - &excludePatternList,0,0); - s=includePath.next(); + readFileOrDirectory(s,0,&includeNameDict,0,&Config::filePatternList, + &Config::excludePatternList,0,0); + s=Config::includePath.next(); } msg("Searching for example files...\n"); - s=examplePath.first(); + s=Config::examplePath.first(); while (s) { - readFileOrDirectory(s,0,&exampleNameDict,0,&filePatternList, - &excludePatternList,0,0); - s=examplePath.next(); + readFileOrDirectory(s,0,&exampleNameDict,0,&Config::filePatternList, + &Config::excludePatternList,0,0); + s=Config::examplePath.next(); } msg("Searching for files to exclude\n"); - s=excludeSources.first(); + s=Config::excludeSources.first(); while (s) { - readFileOrDirectory(s,0,0,0,&filePatternList, + readFileOrDirectory(s,0,0,0,&Config::filePatternList, 0,0,&excludeNameDict); - s=excludeSources.next(); + s=Config::excludeSources.next(); } msg("Reading input files...\n"); int inputSize=0; - s=inputSources.first(); + s=Config::inputSources.first(); while (s) { inputSize+=readFileOrDirectory(s,&inputNameList, &inputNameDict,&excludeNameDict, - &filePatternList,&excludePatternList, + &Config::filePatternList, + &Config::excludePatternList, &inputFiles,0); - s=inputSources.next(); + s=Config::inputSources.next(); } //msg("Input size %d bytes\n",inputSize); @@ -3732,19 +3926,21 @@ int main(int argc,char **argv) msg("Reading tag files\n"); - s=tagFileList.first(); + s=Config::tagFileList.first(); while (s) { readTagFile(s); - s=tagFileList.next(); + s=Config::tagFileList.next(); } - QFile *tag =new QFile(genTagFile); - if (genTagFile.length()>0) + QFile *tag =new QFile(Config::genTagFile); + if (Config::genTagFile.length()>0) { if (!tag->open(IO_WriteOnly)) { - err("Error: cannot open tag file %s for writing\n",genTagFile.data()); + err("Error: cannot open tag file %s for writing\n", + Config::genTagFile.data() + ); exit(1); } tagFile.setDevice(tag); @@ -3756,7 +3952,7 @@ int main(int argc,char **argv) // Notice: the order of the function calls below is very important! - if (generateHtml) + if (Config::generateHtml) { msg("Reading formula repository...\n"); readFormulaRepository(); @@ -3801,7 +3997,6 @@ int main(int argc,char **argv) msg("Searching for friends...\n"); findFriends(); - msg("Searching for documented variables...\n"); buildVarList(root); @@ -3910,31 +4105,31 @@ int main(int argc,char **argv) outputList->writeStyleInfo(0); // write first part outputList->disableAllBut(OutputGenerator::Latex); parseText(*outputList, - theTranslator->trGeneratedAt(dateToString(TRUE),projectName) + theTranslator->trGeneratedAt(dateToString(TRUE),Config::projectName) ); outputList->writeStyleInfo(1); // write second part parseText(*outputList,theTranslator->trWrittenBy()); outputList->writeStyleInfo(2); // write third part parseText(*outputList, - theTranslator->trGeneratedAt(dateToString(TRUE),projectName) + theTranslator->trGeneratedAt(dateToString(TRUE),Config::projectName) ); outputList->writeStyleInfo(3); // write fourth part parseText(*outputList,theTranslator->trWrittenBy()); outputList->writeStyleInfo(4); // write last part outputList->enableAll(); - if (formulaList.count()>0 && generateHtml) + if (formulaList.count()>0 && Config::generateHtml) { msg("Generating bitmaps for formulas in HTML...\n"); - formulaList.generateBitmaps(htmlOutputDir); + formulaList.generateBitmaps(Config::htmlOutputDir); } - if (searchEngineFlag || tagFileList.count()>0) + if (Config::searchEngineFlag || Config::tagFileList.count()>0) { msg("\nNow copy the file\n\n %s\n\nto the directory where the CGI binaries are " - "located and don't forget to run\n\n",(htmlOutputDir+"/"+cgiName).data()); + "located and don't forget to run\n\n",(Config::htmlOutputDir+"/"+Config::cgiName).data()); msg(" %s/installdox\n\nto replace any dummy links.\n\n", - htmlOutputDir.data()); + Config::htmlOutputDir.data()); } delete tag; diff --git a/src/doxygen.h b/src/doxygen.h index 005ac7e..17c8cd8 100644 --- a/src/doxygen.h +++ b/src/doxygen.h @@ -18,6 +18,7 @@ #ifndef DOXYGEN_H #define DOXYGEN_H +#include "qtbc.h" #include "groupdef.h" #include "filedef.h" #include "classdef.h" @@ -34,9 +35,9 @@ struct PageInfo { PageInfo(const char *n,const char *d,const char *t) { name=n; doc=d; title=t; } - QString name; - QString doc; - QString title; + QCString name; + QCString doc; + QCString title; }; class PageList : public QList<PageInfo> @@ -47,10 +48,10 @@ class PageList : public QList<PageInfo> } }; -class BufStr : public QString +class BufStr : public QCString { public: - BufStr(int size) : QString(size), offset(0), spareRoom(10240) {} + BufStr(int size) : QCString(size), offset(0), spareRoom(10240) {} void addChar(char c) { if (offset>=size()) resize(size()+spareRoom); @@ -73,11 +74,11 @@ class BufStr : public QString const int spareRoom; // 10Kb extra room to avoid frequent resizing }; -typedef QList<QString> StringList; +typedef QList<QCString> StringList; typedef QDict<MemberDef> MemberDict; typedef QDict<ClassDef> ClassDict; typedef QDict<FileDef> FileDict; -typedef QDict<QString> StringDict; +typedef QDict<QCString> StringDict; typedef QDict<PageInfo> PageDict; typedef QDict<GroupDef> GroupDict; diff --git a/src/doxygen.pro b/src/doxygen.pro index 21e2ea5..e6dd3c0 100644 --- a/src/doxygen.pro +++ b/src/doxygen.pro @@ -14,7 +14,7 @@ # TMake project file for doxygen TEMPLATE = doxygen.t -CONFIG = console qt warn_on release #debug +CONFIG = console qt warn_on release #debug HEADERS = doxygen.h scanner.h classdef.h classlist.h memberdef.h \ membername.h index.h memberlist.h definition.h \ entry.h logos.h instdox.h message.h code.h \ diff --git a/src/doxysearch.cpp b/src/doxysearch.cpp index cd59d02..027b185 100644 --- a/src/doxysearch.cpp +++ b/src/doxysearch.cpp @@ -259,7 +259,15 @@ void printSearchPage(bool open=FALSE) int readInt(FILE *f) { - return (fgetc(f)<<24)+(fgetc(f)<<16)+(fgetc(f)<<8)+fgetc(f); + unsigned char c_24 = fgetc(f); + unsigned char c_16 = fgetc(f); + unsigned char c_08 = fgetc(f); + unsigned char c_00 = fgetc(f); + return ((unsigned int)c_24<<24)+ + ((unsigned int)c_16<<16)+ + ((unsigned int)c_08<<8)+ + c_00; + //return (fgetc(f)<<24)+(fgetc(f)<<16)+(fgetc(f)<<8)+fgetc(f); } //---------------------------------------------------------------------------- @@ -755,10 +763,10 @@ void fileToBuf(const char *name, char **buf) { FILE *f; struct stat file_stats; - if ((f=fopen(name,"r"))==NULL) return; + if ((f=fopen(name,"rb"))==NULL) return; if (stat(name,&file_stats)==-1) { - message("Error: could not fstat header file %s\n",name); + message("Error: could not fstat file %s\n",name); exit(1); } unsigned int len=file_stats.st_size; @@ -769,7 +777,7 @@ void fileToBuf(const char *name, char **buf) } if (fread(*buf,1,len,f)!=len) { - message("Error: could not read header file %s\n",name); + message("Error: could not read file %s\n",name); exit(1); } (*buf)[len]='\0'; @@ -808,12 +816,20 @@ void getConfig(const char *s) char headerFile[MAXSTRLEN]; strcpy(headerFile,s); +#if defined(_WIN32) + strcat(headerFile,"\\header.html"); +#else strcat(headerFile,"/header.html"); +#endif fileToBuf(headerFile,&headerBuf); char footerFile[MAXSTRLEN]; strcpy(footerFile,s); +#if defined(_WIN32) + strcat(footerFile,"\\footer.html"); +#else strcat(footerFile,"/footer.html"); +#endif fileToBuf(footerFile,&footerBuf); } @@ -908,16 +924,24 @@ int main(int argc,char **argv) { char configFile[MAXSTRLEN]; strcpy(configFile,argv[argIndex]); +#if defined(_WIN32) + strcat(configFile,"\\search.cfg"); +#else strcat(configFile,"/search.cfg"); +#endif char indexFile[MAXSTRLEN]; strcpy(indexFile,argv[argIndex]); +#if defined(_WIN32) + strcat(indexFile,"\\search.idx"); +#else strcat(indexFile,"/search.idx"); +#endif FileInfo *fi=fileList.add(); FILE *g; - if ((fi->f=fopen(indexFile,"r"))==NULL) + if ((fi->f=fopen(indexFile,"rb"))==NULL) { message("Error: could not open index file %s\n",indexFile); exit(1); diff --git a/src/doxytag.l b/src/doxytag.l index 0c70dc6..4e2debd 100644 --- a/src/doxytag.l +++ b/src/doxytag.l @@ -23,7 +23,7 @@ #include <assert.h> #include <ctype.h> -#include <qstring.h> +#include "qtbc.h" #include <qstrlist.h> #include <qfileinf.h> #include <qfile.h> @@ -38,16 +38,16 @@ struct MemberDef { - QString name; - QString anchor; - QString args; + QCString name; + QCString anchor; + QCString args; }; struct ClassDef { - QString name; + QCString name; QStrList bases; - QString fileName; + QCString fileName; bool isFile; QList<MemberDef> memberList; }; @@ -61,19 +61,19 @@ static bool genTag; static bool genIndex; static QStrList bases; -static QString inputString; +static QCString inputString; static int inputPosition; -static QString yyFileName; +static QCString yyFileName; static int yyLineNr; -static QString classFile; -static QString memberRef; -static QString memberName; -static QString memberArgs; -static QString className; +static QCString classFile; +static QCString memberRef; +static QCString memberName; +static QCString memberArgs; +static QCString className; //static bool newClass; -static QString docBaseLink; -static QString docAnchor; -static QString docRefName; +static QCString docBaseLink; +static QCString docAnchor; +static QCString docRefName; static bool nameBug; static SearchIndex searchIndex; @@ -152,9 +152,9 @@ static void addReference() } } -QString unhtmlify(const char *str) +QCString unhtmlify(const char *str) { - QString result; + QCString result; const char *p=str; char c; while ((c=*p)!='\0') @@ -236,7 +236,7 @@ QString unhtmlify(const char *str) } <SkipPreformated>[^\<]+ <CheckConstructor>[a-z_A-Z0-9~:]+ { - QString s=yytext; + QCString s=yytext; if (s.find("::")!=-1) { docRefName=yytext; @@ -401,7 +401,7 @@ QString unhtmlify(const char *str) */ -void parse(QString &s) +void parse(QCString &s) { bases.clear(); nameBug = FALSE; @@ -425,7 +425,7 @@ void parseFile(QFileInfo &fi) className.resize(0); memberName.resize(0); //printf("Parsing file %s...\n",fi.fileName().data()); - QString input(fi.size()+1); + QCString input(fi.size()+1); docBaseLink=fi.fileName(); docRefName=fi.fileName().copy(); searchIndex.addReference(docRefName,docBaseLink); @@ -503,8 +503,8 @@ const char *getArg(int argc,char **argv,int &optind,const char c) int main(int argc,char **argv) { - QString tagName; - QString indexName; + QCString tagName; + QCString indexName; int optind=1; const char *arg; @@ -554,7 +554,7 @@ int main(int argc,char **argv) } if (genIndex) { - printf("Writing search index\n"); + //printf("Writing search index\n"); if (!searchIndex.saveIndex(indexName)) { fprintf(stderr,"Error: Could not write search index\n"); @@ -562,7 +562,7 @@ int main(int argc,char **argv) QFileInfo fi(indexName); if (fi.exists()) { - QString dir=fi.dir().absPath(); + QCString dir=convertToQCString(fi.dir().absPath()); fi.setFile(dir+"/search.gif"); if (!fi.exists()) writeSearchButton(dir); fi.setFile(dir+"/doxygen.gif"); diff --git a/src/entry.cpp b/src/entry.cpp index 51724ce..4e2ca93 100644 --- a/src/entry.cpp +++ b/src/entry.cpp @@ -16,31 +16,32 @@ #include "entry.h" -static int newCount=0; +int Entry::num=0; Entry::Entry() { - num=newCount++; + num++; //printf("New Entry %d\n",num); parent=0; sublist = new QList<Entry>; sublist->setAutoDelete(TRUE); extends = new QList<BaseInfo>; extends->setAutoDelete(TRUE); - groups = new QList<QString>; + groups = new QList<QCString>; groups->setAutoDelete(TRUE); - anchors = new QList<QString>; + anchors = new QList<QCString>; anchors->setAutoDelete(TRUE); argList = new ArgumentList; argList->setAutoDelete(TRUE); //printf("Entry::Entry() tArgList=0\n"); tArgList = 0; + mGrpId = -1; reset(); } Entry::Entry(const Entry &e) { - num=newCount++; + num++; //printf("Copy New Entry %d\n",num); section = e.section; protection = e.protection; @@ -62,13 +63,14 @@ Entry::Entry(const Entry &e) inside = e.inside.copy(); fileName = e.fileName.copy(); startLine = e.startLine; + mGrpId = e.mGrpId; sublist = new QList<Entry>; sublist->setAutoDelete(TRUE); extends = new QList<BaseInfo>; extends->setAutoDelete(TRUE); - groups = new QList<QString>; + groups = new QList<QCString>; groups->setAutoDelete(TRUE); - anchors = new QList<QString>; + anchors = new QList<QCString>; anchors->setAutoDelete(TRUE); argList = new ArgumentList; argList->setAutoDelete(TRUE); @@ -92,17 +94,17 @@ Entry::Entry(const Entry &e) } // deep copy group list - QListIterator<QString> sli(*e.groups); - QString *s; + QListIterator<QCString> sli(*e.groups); + QCString *s; for (;(s=sli.current());++sli) { - groups->append(new QString(*s)); + groups->append(new QCString(*s)); } - QListIterator<QString> sli2(*e.anchors); + QListIterator<QCString> sli2(*e.anchors); for (;(s=sli2.current());++sli2) { - anchors->append(new QString(*s)); + anchors->append(new QCString(*s)); } // deep copy argument list @@ -140,8 +142,8 @@ Entry::~Entry() delete groups; delete anchors; delete argList; - //printf("Entry::~Entry() tArgList=%p\n",tArgList); delete tArgList; + num--; } void Entry::addSubEntry(Entry *current) @@ -171,6 +173,7 @@ void Entry::reset() args.resize(0); exception.resize(0); program.resize(0); + body.resize(0); includeFile.resize(0); includeName.resize(0); doc.resize(0); @@ -178,6 +181,7 @@ void Entry::reset() brief.resize(0); inside.resize(0); fileName.resize(0); + mGrpId = -1; section = EMPTY_SEC; sig = FALSE; virt = Normal; @@ -202,6 +206,7 @@ int Entry::getSize() size+=args.length()+1; size+=exception.length()+1; size+=program.length()+1; + size+=body.length()+1; size+=includeFile.length()+1; size+=includeName.length()+1; size+=doc.length()+1; @@ -216,7 +221,7 @@ int Entry::getSize() size+=bi->name.length()+1+sizeof(bi->prot)+sizeof(bi->virt); bi=extends->next(); } - QString *s=groups->first(); + QCString *s=groups->first(); while (s) { size+=sizeof(QLNode); diff --git a/src/entry.h b/src/entry.h index a302955..94cf52b 100644 --- a/src/entry.h +++ b/src/entry.h @@ -17,7 +17,7 @@ #ifndef ENTRY_H #define ENTRY_H -#include <qstring.h> +#include "qtbc.h" #include <qlist.h> enum Protection { Public, Protected, Private } ; @@ -26,7 +26,7 @@ enum Specifier { Normal, Virtual, Pure } ; struct BaseInfo { BaseInfo(const char *n,Protection p,Specifier v) : name(n),prot(p),virt(v) {} - QString name; // the name of the base class + QCString name; // the name of the base class Protection prot; // inheritance type Specifier virt; // virtualness }; @@ -51,9 +51,9 @@ struct Argument return *this; } - QString type; // argument type - QString name; // argument name (if any) - QString defval; // argument default value (if any) + QCString type; // argument type + QCString name; // argument name (if any) + QCString defval; // argument default value (if any) }; class ArgumentList : public QList<Argument> @@ -115,35 +115,37 @@ class Entry void addSubEntry (Entry* e) ; void reset(); - int section; // entry type; + int section; // entry type (see Sections); Protection protection; // class protection bool sig; // a Qt signal ? bool slot; // a Qt slot ? bool stat; // static ? bool proto; // prototype ? - Specifier virt; // virtualness of the entry - Entry *parent; // parent node in the tree - QString type; // member type - QString name; // member name - QString args; // member argument string + Specifier virt; // virtualness of the entry + Entry *parent; // parent node in the tree + QCString type; // member type + QCString name; // member name + QCString args; // member argument string ArgumentList *argList; // member arguments as a list ArgumentList *tArgList; // template argument list - ArgumentList *tNameList; // template name list - QString program; // the program text - QString includeFile; // include file (2 arg of \class, must be unique) - QString includeName; // include name (3 arg of \class) - QString doc; // documentation block (partly parsed) - QString relates; // related class (doc block) - QString brief; // brief description (doc block) - QString inside; // name of the class in which documents are found - QString exception; // throw specification + QCString program; // the program text + QCString body; // the function body + QCString includeFile; // include file (2 arg of \class, must be unique) + QCString includeName; // include name (3 arg of \class) + QCString doc; // documentation block (partly parsed) + QCString relates; // related class (doc block) + QCString brief; // brief description (doc block) + QCString inside; // name of the class in which documents are found + QCString exception; // throw specification + int mGrpId; // member group id + QCString mGrpHeader; // member group header QList<Entry> *sublist; // entries that are children of this one QList<BaseInfo> *extends; // list of base classes - QList<QString> *groups; // list of groups this entry belongs to - QList<QString> *anchors; // list of anchors defined in this entry - QString fileName; // file this entry was extracted from + QList<QCString> *groups; // list of groups this entry belongs to + QList<QCString> *anchors; // list of anchors defined in this entry + QCString fileName; // file this entry was extracted from int startLine; // start line of entry in the source - int num; + static int num; // counts the total number of entries private: Entry &operator=(const Entry &); } ; diff --git a/src/example.h b/src/example.h index eef33ce..b43733f 100644 --- a/src/example.h +++ b/src/example.h @@ -17,16 +17,16 @@ #ifndef EXAMPLE_H #define EXAMPLE_H -#include <qstring.h> +#include "qtbc.h" class ClassDef; class MemberName; struct Example { - QString anchor; - QString name; - QString file; + QCString anchor; + QCString name; + QCString file; }; class ExampleList : public QList<Example> diff --git a/src/filedef.cpp b/src/filedef.cpp index 7921bf7..5f62357 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -14,6 +14,7 @@ * */ +#include "qtbc.h" #include "memberlist.h" #include "classlist.h" #include "define.h" @@ -66,14 +67,14 @@ void FileDef::writeDocumentation(OutputList &ol) { //funcList->countDecMembers(); - QString pageTitle=name()+" File Reference"; + QCString pageTitle=name()+" File Reference"; startFile(ol,diskname,pageTitle); startTitle(ol); parseText(ol,theTranslator->trFileReference(name())); endTitle(ol,name()); //ol.newParagraph(); - if (genTagFile.length()>0) tagFile << "&" << name() << ":\n"; + if (Config::genTagFile.length()>0) tagFile << "&" << name() << ":\n"; //brief=brief.stripWhiteSpace(); //int bl=brief.length(); @@ -97,17 +98,53 @@ void FileDef::writeDocumentation(OutputList &ol) ol.writeSynopsis(); ol.startMemberSections(); + + if (namespaceList->count()>0) + { + NamespaceDef *nd=namespaceList->first(); + bool found=FALSE; + while (nd) + { + if (nd->isVisibleExt()) + { + if (!found) + { + ol.startMemberHeader(); + parseText(ol,theTranslator->trNamespaces()); + ol.endMemberHeader(); + ol.startMemberList(); + found=TRUE; + } + ol.startMemberItem(); + ol.writeString("namespace "); + ol.insertMemberAlign(); + if (nd->hasDocumentation()) + { + ol.writeObjectLink(nd->getReference(), + nd->getOutputFileBase(), + 0, + nd->name() + ); + } + else + { + ol.startBold(); + ol.docify(nd->name()); + ol.endBold(); + } + ol.endMemberItem(); + } + nd=namespaceList->next(); + } + if (found) ol.endMemberList(); + } if (classList->count()>0) { ClassDef *cd=classList->first(); bool found=FALSE; while (cd) { - if (//cd->name()[0]!='@' && - //(cd->protection()!=Private || extractPrivateFlag) && - //(cd->hasDocumentation() || !hideClassFlag)) - cd->isVisibleExt() - ) + if ( cd->isVisibleExt() ) { if (!found) { @@ -247,7 +284,7 @@ void FileDef::writeDocumentation(OutputList &ol) ol.startGroupHeader(); parseText(ol,theTranslator->trAuthor()); ol.endGroupHeader(); - parseText(ol,theTranslator->trGeneratedAutomatically(projectName)); + parseText(ol,theTranslator->trGeneratedAutomatically(Config::projectName)); ol.enableAll(); endFile(ol); } diff --git a/src/filedef.h b/src/filedef.h index ca95e20..b5c9585 100644 --- a/src/filedef.h +++ b/src/filedef.h @@ -17,8 +17,8 @@ #ifndef FILEDEF_H #define FILEDEF_H -#include <qlist.h> #include "index.h" +#include <qlist.h> #include "config.h" #include "definition.h" @@ -53,9 +53,9 @@ class FileDef : public Definition ~FileDef(); /*! Returns the unique file name (this may include part of the path). */ - QString name() const + QCString name() const { - if (fullPathNameFlag) + if (Config::fullPathNameFlag) return filename; else return Definition::name(); @@ -63,10 +63,10 @@ class FileDef : public Definition /*! Returns nameString with all slashes replaced by underscores. */ //const char *diskName() const { return diskname; } - QString getOutputFileBase() const { return diskname; } + QCString getOutputFileBase() const { return diskname; } /*! Returns the absolute path including the file name. */ - QString absFilePath() const { return filepath; } + QCString absFilePath() const { return filepath; } /*! Returns the name of the verbatim copy of this file (if any). */ const char *includeName() const { return incName; } @@ -87,7 +87,7 @@ class FileDef : public Definition //void setDocumentation(const char *d) { doc=d; } /*! Returns the absolute path of this file. */ - QString getPath() const { return path; } + QCString getPath() const { return path; } /*! Returns true iff any documentation for this file is found. */ //bool hasDocumentation() @@ -117,15 +117,15 @@ class FileDef : public Definition FileList *includeList; NamespaceList *namespaceList; DefineList *defineList; - //QString n; - //QString doc; - //QString brief; - QString reference; - QString path; - QString filepath; - QString diskname; - QString filename; - QString incName; + //QCString n; + //QCString doc; + //QCString brief; + QCString reference; + QCString path; + QCString filepath; + QCString diskname; + QCString filename; + QCString incName; //FileType ftype; }; diff --git a/src/filename.cpp b/src/filename.cpp index 60367dc..a345969 100644 --- a/src/filename.cpp +++ b/src/filename.cpp @@ -26,9 +26,9 @@ FileName::~FileName() { } -//static QString convertSlashes(const char *s) +//static QCString convertSlashes(const char *s) //{ -// QString result=s; +// QCString result=s; // int i,l=result.length(); // for (i=0;i<l;i++) if (result.at(i)=='/') result.at(i)='_'; // return result; @@ -36,7 +36,7 @@ FileName::~FileName() void FileName::generateDiskNames() { - QString commonPrefix; + QCString commonPrefix; FileDef *fd=first(); int count=0; while (fd) { if (!fd->isReference()) count++; fd=next(); } @@ -66,8 +66,8 @@ void FileName::generateDiskNames() //printf("i=%d fd->path=`%s' fd->name=`%s'\n",i,fd->path.data(),fd->name().data()); if (i==(int)fd->path.length()) { - warning("Warning: Input file found multiple times!\n" - " The generated documentation for this file may not be correct!\n"); + warning("Warning: Input file %s found multiple times!\n" + " The generated documentation for this file may not be correct!\n",fd->absFilePath().data()); found=TRUE; } else if (fd->path[i]!=c) diff --git a/src/filename.h b/src/filename.h index 2932d18..cb39ce5 100644 --- a/src/filename.h +++ b/src/filename.h @@ -17,6 +17,7 @@ #ifndef FILENAME_H #define FILENAME_H +#include "qtbc.h" #include <qdict.h> #include "filedef.h" @@ -30,7 +31,7 @@ class FileName : public QList<FileDef> int compareItems(GCI item1,GCI item2); private: - QString name; + QCString name; }; class FileNameIterator : public QListIterator<FileDef> diff --git a/src/formula.cpp b/src/formula.cpp index 53e8b38..0a961ca 100644 --- a/src/formula.cpp +++ b/src/formula.cpp @@ -17,6 +17,7 @@ #include <stdlib.h> #include <unistd.h> +#include "qtbc.h" #include <qfile.h> #include <qtstream.h> #include <qfileinf.h> @@ -49,12 +50,12 @@ void FormulaList::generateBitmaps(const char *path) QDir d(path); // store the original directory if (!d.exists()) { err("Error: Output dir %s does not exist!\n",path); exit(1); } - QString oldDir = QDir::currentDirPath().copy(); + QCString oldDir = convertToQCString(QDir::currentDirPath()); // goto the html output directory (i.e. path) QDir::setCurrent(d.absPath()); QDir thisDir; // generate a latex file containing one formula per page. - QString texName="_formulas.tex"; + QCString texName="_formulas.tex"; QList<int> pagesToGenerate; pagesToGenerate.setAutoDelete(TRUE); FormulaListIterator fli(*this); @@ -70,7 +71,7 @@ void FormulaList::generateBitmaps(const char *path) int page=0; for (fli.toFirst();(formula=fli.current());++fli) { - QString resultName; + QCString resultName; resultName.sprintf("form-%d.gif",formula->getId()); // only formulas for which no image exists are generated QFileInfo fi(resultName); @@ -99,7 +100,7 @@ void FormulaList::generateBitmaps(const char *path) int pageNum=*pagePtr; msg("Generating image form-%d.gif for formula\n",pageNum); char dviCmd[256]; - QString formBase; + QCString formBase; formBase.sprintf("_form%d",pageNum); // run dvips to convert the page with number pageIndex to an // encapsulated postscript. @@ -110,7 +111,7 @@ void FormulaList::generateBitmaps(const char *path) QFileInfo fi(formBase+".eps"); if (fi.exists()) { - QString eps = fileToString(formBase+".eps"); + QCString eps = fileToString(formBase+".eps"); int i=eps.find("%%BoundingBox:"); if (i!=-1) { @@ -162,7 +163,7 @@ void FormulaList::generateBitmaps(const char *path) if (f.open(IO_ReadOnly)) { QTextStream t(&f); - QString s; + QCString s; if (!t.eof()) s=t.readLine(); if (s.length()<2 || s.left(2)!="P6") @@ -233,7 +234,7 @@ void FormulaList::generateBitmaps(const char *path) } } // save the result as a gif - QString resultName; + QCString resultName; resultName.sprintf("form-%d.gif",pageNum); // the option parameter 1 is used here as a temporary hack // to select the right color palette! diff --git a/src/formula.h b/src/formula.h index 977ccfe..9edd583 100644 --- a/src/formula.h +++ b/src/formula.h @@ -17,7 +17,7 @@ #ifndef FORMULA_H #define FORMULA_H -#include <qstring.h> +#include "qtbc.h" #include <qlist.h> #include <qdict.h> @@ -27,11 +27,11 @@ class Formula Formula(const char *text); ~Formula(); int getId(); - QString getFormulaText() const { return form; } + QCString getFormulaText() const { return form; } private: int number; - QString form; + QCString form; }; class FormulaList : public QList<Formula> diff --git a/src/groupdef.cpp b/src/groupdef.cpp index 924199e..e1e28ab 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -15,6 +15,7 @@ */ #include <ctype.h> +#include "qtbc.h" #include "groupdef.h" #include "classdef.h" #include "filedef.h" @@ -118,7 +119,7 @@ void GroupDef::writeDocumentation(OutputList &ol) ClassDef *cd=classList->first(); while (cd) { - QString type; + QCString type; switch (cd->compoundType()) { case ClassDef::Class: type="class"; break; diff --git a/src/groupdef.h b/src/groupdef.h index a8bc562..ab54ea6 100644 --- a/src/groupdef.h +++ b/src/groupdef.h @@ -17,7 +17,7 @@ #ifndef GROUPDEF_H #define GROUPDEF_H -#include <qstring.h> +#include "qtbc.h" #include <qlist.h> #include "definition.h" @@ -36,7 +36,7 @@ class GroupDef : public Definition GroupDef(const char *name,const char *title); ~GroupDef(); //const char *groupFile() const { return fileName; } - QString getOutputFileBase() const { return fileName; } + QCString getOutputFileBase() const { return fileName; } const char *groupTitle() const { return title; } void addFile(const FileDef *def); void addClass(const ClassDef *def); @@ -45,8 +45,8 @@ class GroupDef : public Definition int countMembers() const; private: - QString title; // title of the group - QString fileName; // base name of the generated file + QCString title; // title of the group + QCString fileName; // base name of the generated file FileList *fileList; // list of all files in the group ClassList *classList; // list of all classes in the group NamespaceList *namespaceList; // list of all namespace in the group diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index 8c5b50a..1a44646 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -14,8 +14,10 @@ * */ -#include <qdir.h> #include <stdlib.h> + +#include "qtbc.h" +#include <qdir.h> #include "message.h" #include "htmlgen.h" #include "config.h" @@ -26,9 +28,9 @@ HtmlGenerator::HtmlGenerator() : OutputGenerator() { - if (headerFile.length()>0) header=fileToString(headerFile); - if (footerFile.length()>0) footer=fileToString(footerFile); - dir=htmlOutputDir; + if (Config::headerFile.length()>0) header=fileToString(Config::headerFile); + if (Config::footerFile.length()>0) footer=fileToString(Config::footerFile); + dir=Config::htmlOutputDir; } HtmlGenerator::~HtmlGenerator() @@ -42,18 +44,18 @@ void HtmlGenerator::append(const OutputGenerator *g) void HtmlGenerator::init() { - QDir d(htmlOutputDir); - if (!d.exists() && !d.mkdir(htmlOutputDir)) + QDir d(Config::htmlOutputDir); + if (!d.exists() && !d.mkdir(Config::htmlOutputDir)) { - err("Could not create output directory %s\n",htmlOutputDir.data()); + err("Could not create output directory %s\n",Config::htmlOutputDir.data()); exit(1); } - writeLogo(htmlOutputDir); + writeLogo(Config::htmlOutputDir); } void HtmlGenerator::startFile(const char *name,const char *title,bool external) { - QString fileName=name; + QCString fileName=name; lastTitle=title; if (fileName.right(5)!=".html") fileName+=".html"; startPlainFile(fileName); @@ -156,7 +158,9 @@ void HtmlGenerator::writeStyleInfo(int part) if (part==0) { startPlainFile("doxygen.css"); - t << "H1 { border-width: thin; border: solid; text-align: center }" << endl + t + //<< "H1 { border-width: thin; border: solid; text-align: center }" << endl + << "H1 { text-align: center }" << endl << "A.el { text-decoration: none; font-weight: bold }" << endl << "DL.el { margin-left: -1cm }" << endl << "DIV.fragment { width: 100%; border: none; background-color: #eeeeee }" << endl @@ -274,7 +278,7 @@ void HtmlGenerator::writeSection(const char *lab,const char *title,bool sub) void HtmlGenerator::writeSectionRef(const char *name,const char *lab, const char *title) { - QString refName=name; + QCString refName=name; if (refName.right(5)!=".html") refName+=".html"; t << "<a href=\"" << refName << "#" << lab << "\">"; docify(title); @@ -284,7 +288,7 @@ void HtmlGenerator::writeSectionRef(const char *name,const char *lab, void HtmlGenerator::writeSectionRefItem(const char *name,const char *lab, const char *title) { - QString refName=name; + QCString refName=name; if (refName.right(5)!=".html") refName+=".html"; t << "<a href=\"" << refName << "#" << lab << "\">"; docify(title); @@ -356,7 +360,7 @@ void HtmlGenerator::endClassDiagram(ClassDiagram &d, void HtmlGenerator::startColorFont(uchar red,uchar green,uchar blue) { - QString colorString; + QCString colorString; colorString.sprintf("%02x%02x%02x",red,green,blue); t << "<font color=\"#" << colorString << "\">"; } @@ -370,12 +374,12 @@ void HtmlGenerator::writeFormula(const char *n,const char *text) { if (text && text[0]=='\\') t << "<p><center>" << endl; t << "<img align=\"top\" src=\"" << n << "\">" << endl; - if (text && text[0]=='\\') t << "</center></p>" << endl; + if (text && text[0]=='\\') t << "</center><p>" << endl; } void HtmlGenerator::startMemberList() { - if (htmlAlignMemberFlag) + if (Config::htmlAlignMemberFlag) { //t << endl << "<p><table border=0 cellspacing=2 cellpadding=0>" << endl; } @@ -387,7 +391,7 @@ void HtmlGenerator::startMemberList() void HtmlGenerator::endMemberList() { - if (htmlAlignMemberFlag) + if (Config::htmlAlignMemberFlag) { //t << "</table>" << endl; } @@ -399,7 +403,7 @@ void HtmlGenerator::endMemberList() void HtmlGenerator::startMemberItem() { - if (htmlAlignMemberFlag) + if (Config::htmlAlignMemberFlag) { t << "<tr><td align=right valign=top>"; } @@ -411,15 +415,15 @@ void HtmlGenerator::startMemberItem() void HtmlGenerator::insertMemberAlign() { - if (htmlAlignMemberFlag) + if (Config::htmlAlignMemberFlag) { - t << "</td><td valign=top>"; + t << " </td><td valign=top>"; } } void HtmlGenerator::endMemberItem() { - if (htmlAlignMemberFlag) + if (Config::htmlAlignMemberFlag) { t << "</td></tr>"; } @@ -428,7 +432,7 @@ void HtmlGenerator::endMemberItem() void HtmlGenerator::startMemberDescription() { - if (htmlAlignMemberFlag) + if (Config::htmlAlignMemberFlag) { t << "<tr><td></td><td><font size=-1><em>"; } @@ -440,7 +444,7 @@ void HtmlGenerator::startMemberDescription() void HtmlGenerator::endMemberDescription() { - if (htmlAlignMemberFlag) + if (Config::htmlAlignMemberFlag) { t << "</em></font><br><br></td></tr>" << endl; } @@ -452,7 +456,7 @@ void HtmlGenerator::endMemberDescription() void HtmlGenerator::startMemberSections() { - if (htmlAlignMemberFlag) + if (Config::htmlAlignMemberFlag) { t << "<table border=0 cellpadding=0 cellspacing=1>" << endl; } @@ -460,7 +464,7 @@ void HtmlGenerator::startMemberSections() void HtmlGenerator::endMemberSections() { - if (htmlAlignMemberFlag) + if (Config::htmlAlignMemberFlag) { t << "</table>" << endl; } @@ -468,7 +472,7 @@ void HtmlGenerator::endMemberSections() void HtmlGenerator::startMemberHeader() { - if (htmlAlignMemberFlag) + if (Config::htmlAlignMemberFlag) { t << "<tr><td colspan=2><br><h2>"; } @@ -480,7 +484,7 @@ void HtmlGenerator::startMemberHeader() void HtmlGenerator::endMemberHeader() { - if (htmlAlignMemberFlag) + if (Config::htmlAlignMemberFlag) { t << "</h2></td></tr>" << endl; } @@ -490,3 +494,13 @@ void HtmlGenerator::endMemberHeader() } } +void HtmlGenerator::startMemberSubtitle() +{ + if (Config::htmlAlignMemberFlag) t << "<tr><td colspan=2>"; +} + +void HtmlGenerator::endMemberSubtitle() +{ + if (Config::htmlAlignMemberFlag) t << "<br><br></td></tr>" << endl; +} + diff --git a/src/htmlgen.h b/src/htmlgen.h index 556a334..5eb4484 100644 --- a/src/htmlgen.h +++ b/src/htmlgen.h @@ -17,6 +17,7 @@ #ifndef HTMLGEN_H #define HTMLGEN_H +#include "qtbc.h" #include "outputgen.h" class QFile; @@ -85,6 +86,8 @@ class HtmlGenerator : public OutputGenerator void endMemberSections(); void startMemberHeader(); void endMemberHeader(); + void startMemberSubtitle(); + void endMemberSubtitle(); void startMemberList(); void endMemberList(); void startMemberItem(); @@ -169,9 +172,9 @@ class HtmlGenerator : public OutputGenerator //static void docifyStatic(QTextStream &t,const char *str); private: - QString header; - QString footer; - QString lastTitle; + QCString header; + QCString footer; + QCString lastTitle; HtmlGenerator &operator=(const HtmlGenerator &g); HtmlGenerator(const HtmlGenerator &g); diff --git a/src/image.cpp b/src/image.cpp index 853d4ea..78f92c1 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -15,10 +15,10 @@ * */ +#include "qtbc.h" #include "image.h" #include "gifenc.h" #include <qglobal.h> -#include <qstring.h> const int charSetWidth=80; const int charHeight=12; @@ -140,111 +140,6 @@ unsigned char fontRaw[charSetWidth*charHeight] = { 0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0xac, 0x00, 0x00 }; - -#if 0 -const int charSetWidth=68; -const int charHeight=12; -const int numChars=80; - -unsigned short charPos[numChars] = - { 0, 7, 14, 21, 28, 35, 42, 49, - 56, 63, 70, 73, 76, 83, 90, 97, - 104,116,125,133,142,151,159,167, - 176,185,188,195,203,210,221,230, - 240,248,258,266,274,281,289,298, - 309,318,327,336,339,343,346,352, - 359,362,369,376,383,390,397,401, - 407,414,417,420,426,429,438,445, - 452,459,465,470,476,479,486,493, - 502,508,515,521,525,528,532,539 - }; - -unsigned char charWidth[numChars] = - { - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 3, 3, 7, 7, 7, 7, - 12, 9, 8, 9, 9, 8, 8, 9, - 9, 3, 7, 8, 7,11, 9,10, - 8,10, 8, 8, 7, 8, 9,11, - 9, 9, 9, 3, 4, 3, 6, 7, - 3, 7, 7, 7, 7, 7, 4, 6, - 7, 3, 3, 6, 3, 9, 7, 7, - 7, 6, 5, 6, 3, 7, 7, 9, - 6, 7, 6, 4, 3, 4, 7, 5 - }; - -unsigned char fontRaw[charSetWidth*charHeight] = { - 0x38, 0x20, 0xe1, 0xc0, 0x8f, 0x8e, 0x3e, 0x38, 0x70, 0x00, 0x00, 0x00, - 0x1c, 0x0f, 0x80, 0x83, 0xe0, 0xf1, 0xf0, 0xfc, 0xfc, 0x3c, 0x41, 0x20, - 0x48, 0x48, 0x10, 0x12, 0x08, 0x78, 0x7c, 0x1e, 0x1f, 0x0f, 0x3f, 0xa1, - 0x20, 0x91, 0x12, 0x09, 0x04, 0xfe, 0x71, 0x80, 0x00, 0x80, 0x20, 0x00, - 0x08, 0x01, 0x80, 0x81, 0x24, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0xc0, 0x00, 0x44, 0xe1, 0x12, 0x21, - 0x88, 0x11, 0x02, 0x44, 0x88, 0x00, 0x00, 0x00, 0x22, 0x30, 0x41, 0x42, - 0x11, 0x09, 0x08, 0x80, 0x80, 0x42, 0x41, 0x20, 0x48, 0x88, 0x18, 0x33, - 0x08, 0x84, 0x42, 0x21, 0x10, 0x90, 0x84, 0x21, 0x20, 0x91, 0x11, 0x11, - 0x04, 0x02, 0x50, 0x88, 0x01, 0x00, 0x20, 0x00, 0x08, 0x02, 0x00, 0x80, - 0x04, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x22, 0x20, 0x00, 0x44, 0x20, 0x10, 0x22, 0x88, 0x10, 0x04, 0x44, - 0x88, 0x00, 0x00, 0x00, 0x22, 0x26, 0xa1, 0x42, 0x12, 0x01, 0x04, 0x80, - 0x80, 0x80, 0x41, 0x20, 0x49, 0x08, 0x18, 0x32, 0x89, 0x02, 0x42, 0x40, - 0x90, 0x90, 0x04, 0x21, 0x11, 0x11, 0x11, 0x10, 0x88, 0x04, 0x48, 0x94, - 0x01, 0x8e, 0x2c, 0x38, 0x68, 0xe7, 0x34, 0xb1, 0x24, 0x92, 0x91, 0x61, - 0xc5, 0x86, 0x94, 0xce, 0x89, 0x14, 0x46, 0x14, 0x4f, 0x22, 0x20, 0x00, - 0x44, 0x20, 0x20, 0xc2, 0x8f, 0x16, 0x04, 0x38, 0x89, 0x20, 0xc0, 0x18, - 0x04, 0x49, 0x22, 0x22, 0x12, 0x01, 0x04, 0x80, 0x80, 0x80, 0x41, 0x20, - 0x4a, 0x08, 0x14, 0x52, 0x89, 0x02, 0x42, 0x40, 0x90, 0x8c, 0x04, 0x21, - 0x11, 0x09, 0x20, 0xa0, 0x88, 0x08, 0x48, 0xa2, 0x00, 0x11, 0x32, 0x44, - 0x99, 0x12, 0x4c, 0xc9, 0x25, 0x13, 0x69, 0x92, 0x26, 0x49, 0x99, 0x24, - 0x89, 0x14, 0x45, 0x24, 0x41, 0x22, 0x20, 0x00, 0x44, 0x20, 0x40, 0x24, - 0x80, 0x99, 0x08, 0x44, 0x78, 0x03, 0x0f, 0x86, 0x04, 0x51, 0x22, 0x23, - 0xe2, 0x01, 0x04, 0xfc, 0xf8, 0x8e, 0x7f, 0x20, 0x4e, 0x08, 0x14, 0x52, - 0x49, 0x02, 0x7c, 0x40, 0x9f, 0x03, 0x04, 0x21, 0x11, 0x0a, 0xa0, 0x40, - 0x50, 0x10, 0x44, 0x80, 0x00, 0x01, 0x22, 0x40, 0x89, 0x12, 0x44, 0x89, - 0x26, 0x12, 0x49, 0x12, 0x24, 0x48, 0x91, 0x04, 0x89, 0x12, 0x48, 0xc4, - 0x42, 0x22, 0x26, 0x40, 0x44, 0x20, 0x80, 0x28, 0x80, 0x91, 0x08, 0x44, - 0x08, 0x0c, 0x00, 0x01, 0x88, 0x51, 0x23, 0xe2, 0x12, 0x01, 0x04, 0x80, - 0x80, 0x82, 0x41, 0x20, 0x49, 0x08, 0x12, 0x92, 0x29, 0x02, 0x40, 0x44, - 0x91, 0x00, 0x84, 0x21, 0x0a, 0x0a, 0xa0, 0xa0, 0x20, 0x20, 0x44, 0x80, - 0x00, 0x0f, 0x22, 0x40, 0x89, 0xf2, 0x44, 0x89, 0x26, 0x12, 0x49, 0x12, - 0x24, 0x48, 0x90, 0xc4, 0x88, 0xa2, 0x48, 0xc4, 0x84, 0x42, 0x19, 0x80, - 0x44, 0x21, 0x02, 0x2f, 0xc8, 0x91, 0x08, 0x44, 0x08, 0x03, 0x0f, 0x86, - 0x08, 0x53, 0x44, 0x12, 0x12, 0x01, 0x04, 0x80, 0x80, 0x82, 0x41, 0x24, - 0x48, 0x88, 0x12, 0x92, 0x29, 0x02, 0x40, 0x42, 0x90, 0x90, 0x84, 0x21, - 0x0a, 0x04, 0x41, 0x10, 0x20, 0x40, 0x44, 0x80, 0x00, 0x11, 0x22, 0x40, - 0x89, 0x02, 0x44, 0x89, 0x25, 0x12, 0x49, 0x12, 0x24, 0x48, 0x90, 0x24, - 0x88, 0xa2, 0xa9, 0x22, 0x84, 0x22, 0x20, 0x00, 0x44, 0x21, 0x02, 0x20, - 0x88, 0x91, 0x10, 0x44, 0x88, 0x00, 0xc0, 0x18, 0x00, 0x4d, 0x84, 0x12, - 0x11, 0x09, 0x08, 0x80, 0x80, 0x46, 0x41, 0x24, 0x48, 0x48, 0x11, 0x12, - 0x18, 0x84, 0x40, 0x21, 0x10, 0x90, 0x84, 0x21, 0x04, 0x04, 0x41, 0x10, - 0x20, 0x80, 0x42, 0x80, 0x00, 0x11, 0x32, 0x44, 0x99, 0x12, 0x4c, 0x89, - 0x24, 0x92, 0x49, 0x12, 0x26, 0x49, 0x91, 0x24, 0x98, 0x41, 0x12, 0x12, - 0x88, 0x22, 0x20, 0x00, 0x38, 0x21, 0xf1, 0xc0, 0x87, 0x0e, 0x10, 0x38, - 0x71, 0x20, 0x00, 0x00, 0x08, 0x20, 0x04, 0x13, 0xe0, 0xf1, 0xf0, 0xfc, - 0x80, 0x3a, 0x41, 0x23, 0x88, 0x2f, 0x91, 0x12, 0x08, 0x78, 0x40, 0x1e, - 0x90, 0x8f, 0x04, 0x1e, 0x04, 0x04, 0x42, 0x08, 0x20, 0xfe, 0x42, 0x80, - 0x00, 0x0e, 0xac, 0x38, 0x68, 0xe2, 0x34, 0x89, 0x24, 0x52, 0x49, 0x11, - 0xc5, 0x86, 0x90, 0xc6, 0x68, 0x41, 0x12, 0x11, 0x0f, 0x22, 0x20, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, - 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x04, 0x00, 0x80, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x00, 0x22, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x40, 0x80, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x00, - 0x20, 0x00, 0x00, 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x22, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0x80, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x40, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x1a, 0xc0, 0x00 -}; -#endif - static Color palette[] = { { 0xff, 0xff, 0xff }, diff --git a/src/index.cpp b/src/index.cpp index dcd457f..d8bd56c 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -34,7 +34,7 @@ //---------------------------------------------------------------------------- // strips w from s iff s starts with w -bool stripWord(QString &s,QString w) +bool stripWord(QCString &s,QCString w) { bool success=FALSE; if (s.left(w.length())==w) @@ -47,12 +47,12 @@ bool stripWord(QString &s,QString w) //---------------------------------------------------------------------------- // some quasi intelligent brief description abbreviator :^) -QString abbreviate(const char *s,const char *name) +QCString abbreviate(const char *s,const char *name) { - QString result=s; - QString start1=(QString)"The "+name+" class "; - QString start2=(QString)"The "+name+" widget "; - QString start3=(QString)"The "+name+" file "; + QCString result=s; + QCString start1=(QCString)"The "+name+" class "; + QCString start2=(QCString)"The "+name+" widget "; + QCString start3=(QCString)"The "+name+" file "; result=result.simplifyWhiteSpace(); // strip trailing . if (result.length()>0 && result.at(result.length()-1)=='.') @@ -236,7 +236,7 @@ void writeHierarchicalIndex(OutputList &ol) ol.disable(OutputGenerator::Man); startFile(ol,"hierarchy","Hierarchical Index"); startTitle(ol); - parseText(ol,projectName+" "+theTranslator->trClassHierarchy()); + parseText(ol,Config::projectName+" "+theTranslator->trClassHierarchy()); endTitle(ol,0); parseText(ol,theTranslator->trClassHierarchyDescription()); ol.newParagraph(); @@ -272,10 +272,10 @@ void writeFileIndex(OutputList &ol) ol.disable(OutputGenerator::Man); startFile(ol,"files","File Index"); startTitle(ol); - parseText(ol,projectName+" "+theTranslator->trFileList()); + parseText(ol,Config::projectName+" "+theTranslator->trFileList()); endTitle(ol,0); ol.newParagraph(); - parseText(ol,theTranslator->trFileListDescription(extractAllFlag)); + parseText(ol,theTranslator->trFileListDescription(Config::extractAllFlag)); ol.newParagraph(); ol.startIndexList(); @@ -289,13 +289,13 @@ void writeFileIndex(OutputList &ol) { //ol.writeIndexItem(fd->getReference(),fd->diskName(), // fd->name()); - QString path; - if (fullPathNameFlag) + QCString path; + if (Config::fullPathNameFlag) { path=fd->getPath().copy(); // strip part of the path - if (path.left(stripFromPath.length())==stripFromPath) - path=path.right(path.length()-stripFromPath.length()); + if (path.left(Config::stripFromPath.length())==Config::stripFromPath) + path=path.right(path.length()-Config::stripFromPath.length()); } ol.writeStartAnnoItem("file", @@ -337,7 +337,7 @@ int countNamespaces() NamespaceDef *nd; for (;(nd=nli.current());++nli) { - if (!nd->getReference() && nd->hasDocumentation()) count++; + if (nd->isVisible()) count++; } return count; } @@ -350,17 +350,17 @@ void writeNamespaceIndex(OutputList &ol) ol.disable(OutputGenerator::Man); startFile(ol,"namespaces","Namespace Index"); startTitle(ol); - parseText(ol,projectName+" "+theTranslator->trNamespaceList()); + parseText(ol,Config::projectName+" "+theTranslator->trNamespaceList()); endTitle(ol,0); ol.newParagraph(); - parseText(ol,theTranslator->trNamespaceListDescription(extractAllFlag)); + parseText(ol,theTranslator->trNamespaceListDescription(Config::extractAllFlag)); ol.newParagraph(); ol.startIndexList(); NamespaceDef *nd=namespaceList.first(); while (nd) { - if (!nd->getReference() && nd->hasDocumentation()) + if (nd->isVisible()) { ol.writeStartAnnoItem("namespace",nd->getOutputFileBase(),0,nd->name()); ol.docify(" ("); @@ -419,12 +419,12 @@ void writeAnnotatedClassList(OutputList &ol) { if (!cd->isReference() && //!cd->name().isEmpty() && cd->name()[0]!='@' && - //(cd->protection()!=Private || extractPrivateFlag) && + //(cd->protection()!=Private || Config::extractPrivateFlag) && //(cd->hasDocumentation() || !hideClassFlag) cd->isVisible() ) { - QString type; + QCString type; switch (cd->compoundType()) { case ClassDef::Class: type="class"; break; @@ -465,7 +465,7 @@ void writeAnnotatedIndex(OutputList &ol) ol.disable(OutputGenerator::Man); startFile(ol,"annotated","Annotated Index"); startTitle(ol); - parseText(ol,projectName+" "+theTranslator->trCompoundList()); + parseText(ol,Config::projectName+" "+theTranslator->trCompoundList()); endTitle(ol,0); parseText(ol,theTranslator->trCompoundListDescription()); writeAnnotatedClassList(ol); @@ -487,7 +487,7 @@ void writeMemberList(OutputList &ol) while (md && !found) { ClassDef *cd; - if ((md->isFriend() || md->protection()!=Private || extractPrivateFlag) && + if ((md->isFriend() || md->protection()!=Private || Config::extractPrivateFlag) && !md->isReference() && md->hasDocumentation() && md->name()[0]!='@' && (cd=md->memberClass()) && cd->isVisible() @@ -506,12 +506,12 @@ void writeMemberList(OutputList &ol) ol.writeString("\n"); int count=0; - md=mn->first(); - QString prevName; + md=mn->last(); + QCString prevName; while (md) { ClassDef *cd=md->memberClass(); - if (cd && (md->isFriend() || md->protection()!=Private || extractPrivateFlag) && + if (cd && (md->isFriend() || md->protection()!=Private || Config::extractPrivateFlag) && !md->isReference() && md->hasDocumentation() && prevName!=cd->name() && cd->isVisible() @@ -526,7 +526,7 @@ void writeMemberList(OutputList &ol) count++; prevName=cd->name(); } - md=mn->next(); + md=mn->prev(); } } mn=memberNameList.next(); @@ -548,11 +548,11 @@ int countClassMembers() ClassDef *cd; while (md && !found) { - if ((md->isFriend() || md->protection()!=Private || extractPrivateFlag) && + if ((md->isFriend() || md->protection()!=Private || Config::extractPrivateFlag) && !md->isReference() && !md->isRelated() && md->hasDocumentation() && md->name()[0]!='@' && (cd=md->memberClass()) && cd->isVisible()) otherMd=md; - if ((md->isFriend() || md->protection()!=Private || extractPrivateFlag) && + if ((md->isFriend() || md->protection()!=Private || Config::extractPrivateFlag) && !md->isReference() && md->isRelated() && md->hasDocumentation() && md->name()[0]!='@' && (cd=md->memberClass()) && cd->isVisible()) found=TRUE; @@ -574,9 +574,9 @@ void writeMemberIndex(OutputList &ol) ol.disable(OutputGenerator::Latex); startFile(ol,"functions","Compound Member Index"); startTitle(ol); - parseText(ol,projectName+" "+theTranslator->trCompoundMembers()); + parseText(ol,Config::projectName+" "+theTranslator->trCompoundMembers()); endTitle(ol,0); - parseText(ol,theTranslator->trCompoundMembersDescription(extractAllFlag)); + parseText(ol,theTranslator->trCompoundMembersDescription(Config::extractAllFlag)); writeMemberList(ol); endFile(ol); ol.enable(OutputGenerator::Latex); @@ -615,8 +615,8 @@ void writeFileMemberList(OutputList &ol) ol.writeString("\n"); int count=0; - md=mn->first(); - QString prevName; + md=mn->last(); + QCString prevName; while (md) { FileDef *fd=md->getFileDef() ? md->getFileDef() : md->getFileDec(); @@ -633,7 +633,7 @@ void writeFileMemberList(OutputList &ol) ol.docify(": "); else ol.docify(", "); - QString baseName=fd->name().copy(); + QCString baseName=fd->name().copy(); //int s; //if ((s=baseName.findRev("/"))!=-1) // baseName=baseName.right(baseName.length()-s-1); @@ -642,7 +642,7 @@ void writeFileMemberList(OutputList &ol) count++; prevName=fd->name(); } - md=mn->next(); + md=mn->prev(); } } mn=functionNameList.next(); @@ -663,11 +663,9 @@ void writeNamespaceMemberList(OutputList &ol) while (md && !found) { NamespaceDef *nd=md->getNamespace(); - if (nd && nd->hasDocumentation() && - !md->isReference() && - md->hasDocumentation() && - !md->name().isEmpty() && - md->name()[0]!='@') found=TRUE; + if (nd && nd->isVisible() && + !md->isReference() && md->hasDocumentation() && + !md->name().isEmpty() && md->name().at(0)!='@') found=TRUE; else md=mn->next(); } @@ -679,16 +677,16 @@ void writeNamespaceMemberList(OutputList &ol) ol.writeString("\n"); int count=0; - md=mn->first(); - QString prevName; + md=mn->last(); + QCString prevName; while (md) { NamespaceDef *nd=md->getNamespace(); - if (nd && nd->hasDocumentation() && - !md->isReference() && - md->hasDocumentation() && - !md->name().isEmpty() && md->name()[0]!='@' - ) + if (nd && nd->isVisible() && + !md->isReference() && md->hasDocumentation() && + !md->name().isEmpty() && md->name().at(0)!='@' && + prevName!=nd->name() + ) { if (count==0) ol.docify(": "); @@ -697,8 +695,9 @@ void writeNamespaceMemberList(OutputList &ol) ol.writeObjectLink(nd->getReference(),nd->getOutputFileBase(), md->anchor(),nd->name()); count++; + prevName=nd->name(); } - md=mn->next(); + md=mn->prev(); } } mn=functionNameList.next(); @@ -718,10 +717,11 @@ int countNamespaceMembers() bool found=FALSE; while (md && !found) { - if (md->getNamespace() && + NamespaceDef *nd=md->getNamespace(); + if (nd && nd->isVisible() && !md->isReference() && md->hasDocumentation() && - !md->name().isEmpty() && md->name()[0]!='@' - ) + !md->name().isEmpty() && md->name().at(0)!='@' + ) found=TRUE; else md=mn->next(); @@ -771,9 +771,9 @@ void writeFileMemberIndex(OutputList &ol) ol.disable(OutputGenerator::Latex); startFile(ol,"globals","File Member Index"); startTitle(ol); - parseText(ol,projectName+" "+theTranslator->trFileMembers()); + parseText(ol,Config::projectName+" "+theTranslator->trFileMembers()); endTitle(ol,0); - parseText(ol,theTranslator->trFileMembersDescription(extractAllFlag)); + parseText(ol,theTranslator->trFileMembersDescription(Config::extractAllFlag)); writeFileMemberList(ol); endFile(ol); ol.enable(OutputGenerator::Latex); @@ -789,9 +789,9 @@ void writeNamespaceMemberIndex(OutputList &ol) ol.disable(OutputGenerator::Latex); startFile(ol,"namespacemembers","Namespace Member Index"); startTitle(ol); - parseText(ol,projectName+" "+theTranslator->trNamespaceMembers()); + parseText(ol,Config::projectName+" "+theTranslator->trNamespaceMembers()); endTitle(ol,0); - parseText(ol,theTranslator->trNamespaceMemberDescription(extractAllFlag)); + parseText(ol,theTranslator->trNamespaceMemberDescription(Config::extractAllFlag)); writeNamespaceMemberList(ol); endFile(ol); ol.enable(OutputGenerator::Latex); @@ -809,13 +809,13 @@ void writeHeaderFileList(OutputList &ol) while (fd) { ol.writeListItem(); - QString path; - if (fullPathNameFlag) + QCString path; + if (Config::fullPathNameFlag) { path=fd->getPath().copy(); // strip part of the path - if (path.left(stripFromPath.length())==stripFromPath) - path=path.right(path.length()-stripFromPath.length()); + if (path.left(Config::stripFromPath.length())==Config::stripFromPath) + path=path.right(path.length()-Config::stripFromPath.length()); } if (!path.isEmpty()) ol.docify(path); ol.writeObjectLink(0,fd->includeName(),0,fd->name()); @@ -835,7 +835,7 @@ void writeHeaderIndex(OutputList &ol) ol.disable(OutputGenerator::Latex); startFile(ol,"headers","Header File Index"); startTitle(ol); - parseText(ol,projectName+" "+theTranslator->trHeaderFiles()); + parseText(ol,Config::projectName+" "+theTranslator->trHeaderFiles()); endTitle(ol,0); parseText(ol,theTranslator->trHeaderFilesDescription()); writeHeaderFileList(ol); @@ -852,7 +852,7 @@ void writeExampleIndex(OutputList &ol) ol.disable(OutputGenerator::Man); startFile(ol,"examples","Example Index"); startTitle(ol); - parseText(ol,projectName+" "+theTranslator->trExamples()); + parseText(ol,Config::projectName+" "+theTranslator->trExamples()); endTitle(ol,0); parseText(ol,theTranslator->trExamplesDescription()); ol.startIndexList(); @@ -860,7 +860,7 @@ void writeExampleIndex(OutputList &ol) while (pi) { ol.writeListItem(); - QString n=convertSlashes(pi->name,TRUE)+"-example"; + QCString n=convertSlashes(pi->name,TRUE)+"-example"; if (!pi->title.isEmpty()) { ol.writeObjectLink(0,n,0,pi->title); @@ -885,16 +885,16 @@ void writePageIndex(OutputList &ol) ol.disable(OutputGenerator::Man); startFile(ol,"pages","Page Index"); startTitle(ol); - ol.docify(projectName+" "+theTranslator->trRelatedPages()); + ol.docify(Config::projectName+" "+theTranslator->trRelatedPages()); endTitle(ol,0); parseText(ol,theTranslator->trRelatedPagesDescription()); ol.startIndexList(); PageInfo *pi=pageList.first(); while (pi) { - QString pageName,pageTitle; + QCString pageName,pageTitle; - if (caseSensitiveNames) + if (Config::caseSensitiveNames) pageName=pi->name.copy(); else pageName=pi->name.lower(); @@ -960,7 +960,7 @@ void writeGroupIndex(OutputList &ol) ol.disable(OutputGenerator::Man); startFile(ol,"modules","Module Index"); startTitle(ol); - parseText(ol,projectName+" "+theTranslator->trModules()); + parseText(ol,Config::projectName+" "+theTranslator->trModules()); endTitle(ol,0); parseText(ol,theTranslator->trModulesDescription()); writeGroupList(ol); @@ -975,27 +975,27 @@ void writeIndex(OutputList &ol) bool texEnabled = ol.isEnabled(OutputGenerator::Latex); bool htmEnabled = ol.isEnabled(OutputGenerator::Html); - QString projPrefix; - if (!projectName.isEmpty()) + QCString projPrefix; + if (!Config::projectName.isEmpty()) { - projPrefix=projectName+" "; + projPrefix=Config::projectName+" "; } // write HTML index ol.disable(OutputGenerator::Man); ol.disable(OutputGenerator::Latex); ol.startFile("index","Main Index",FALSE); - if (!noIndexFlag) writeQuickLinks(ol,TRUE); + if (!Config::noIndexFlag) writeQuickLinks(ol,TRUE); ol.startTitleHead(); parseText(ol,projPrefix+theTranslator->trDocumentation()); ol.endTitleHead(0); ol.newParagraph(); - if (!projectNumber.isEmpty()) + if (!Config::projectNumber.isEmpty()) { ol.startProjectNumber(); - parseDoc(ol,0,0,projectNumber); + parseDoc(ol,0,0,Config::projectNumber); ol.endProjectNumber(); } - if (noIndexFlag) writeQuickLinks(ol,FALSE); + if (Config::noIndexFlag) writeQuickLinks(ol,FALSE); endFile(ol); ol.disable(OutputGenerator::Html); @@ -1004,10 +1004,10 @@ void writeIndex(OutputList &ol) ol.startFile("refman",0,FALSE); ol.startIndexSection(isTitlePageStart); parseText(ol,projPrefix+theTranslator->trReferenceManual()); - if (!projectNumber.isEmpty()) + if (!Config::projectNumber.isEmpty()) { ol.startProjectNumber(); - parseDoc(ol,0,0,projectNumber); + parseDoc(ol,0,0,Config::projectNumber); ol.endProjectNumber(); } ol.endIndexSection(isTitlePageStart); diff --git a/src/index.h b/src/index.h index 0091f6a..a472a7a 100644 --- a/src/index.h +++ b/src/index.h @@ -17,8 +17,9 @@ #ifndef INDEX_H #define INDEX_H +#include "qtbc.h" #include <qfile.h> -#include <qtstream.h> +//#include <qtstream.h> enum IndexSections { diff --git a/src/instdox.cpp b/src/instdox.cpp index ad22c89..4faa2e6 100644 --- a/src/instdox.cpp +++ b/src/instdox.cpp @@ -16,7 +16,8 @@ #include <sys/types.h> #include <sys/stat.h> -#include <qstring.h> + +#include "qtbc.h" #include <qfile.h> #include <qfileinf.h> #include <qtstream.h> @@ -28,19 +29,19 @@ void writeInstallScript() { - QString fileName=htmlOutputDir+"/installdox"; + QCString fileName=Config::htmlOutputDir+"/installdox"; QFile f(fileName); if (f.open(IO_WriteOnly)) { QTextStream t(&f); - t << "#!" << perlPath << endl << endl << "%subst = ( "; + t << "#!" << Config::perlPath << endl << endl << "%subst = ( "; - char *s=tagFileList.first(); + char *s=Config::tagFileList.first(); while (s) { QFileInfo fi(s); t << "\"" << fi.fileName() << "\", \"\""; - s=tagFileList.next(); + s=Config::tagFileList.next(); if (s) t << ", "; } diff --git a/src/language.cpp b/src/language.cpp index f5e2dde..cee63a8 100644 --- a/src/language.cpp +++ b/src/language.cpp @@ -20,7 +20,9 @@ #include "translator_cz.h" #include "translator_fr.h" #include "translator_it.h" -#include <qstring.h> +#include "translator_de.h" +#include "translator_jp.h" +#include "translator_es.h" #define L_EQUAL(a) !stricmp(langName,a) @@ -52,6 +54,18 @@ bool setTranslator(const char *langName) { theTranslator=new TranslatorItalian; } + else if (L_EQUAL("german")) + { + theTranslator=new TranslatorGerman; + } + else if (L_EQUAL("japanese")) + { + theTranslator=new TranslatorJapanese; + } + else if (L_EQUAL("spanish")) + { + theTranslator=new TranslatorSpanish; + } else // use the default language (i.e. english) { theTranslator=new Translator; diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 2f2f62b..2f49efa 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -15,6 +15,8 @@ */ #include <stdlib.h> + +#include "qtbc.h" #include <qdir.h> #include "latexgen.h" #include "config.h" @@ -24,9 +26,9 @@ #include "diagram.h" #include "language.h" -//static QString escapeLabelName(const QString &s) +//static QCString escapeLabelName(const QCString &s) //{ -// QString result; +// QCString result; // uint i; // for (i=0;i<s.length();i++) // { @@ -45,7 +47,7 @@ LatexGenerator::LatexGenerator() : OutputGenerator() { - dir=latexOutputDir; + dir=Config::latexOutputDir; col=0; } @@ -68,7 +70,7 @@ void LatexGenerator::append(const OutputGenerator *g) void LatexGenerator::init() { - QString dir=latexOutputDir; + QCString dir=Config::latexOutputDir; QDir d(dir); if (!d.exists() && !d.mkdir(dir)) { @@ -76,7 +78,7 @@ void LatexGenerator::init() exit(1); } - QString fileName=dir+"/Makefile"; + QCString fileName=dir+"/Makefile"; QFile file(fileName); if (!file.open(IO_WriteOnly)) { @@ -104,7 +106,7 @@ void LatexGenerator::init() void LatexGenerator::startFile(const char *name,const char *,bool) { - QString fileName=name; + QCString fileName=name; if (fileName.right(4)!=".tex" && fileName.right(4)!=".sty") fileName+=".tex"; startPlainFile(fileName); } @@ -126,16 +128,16 @@ void LatexGenerator::startProjectNumber() void LatexGenerator::startIndexSection(IndexSections is) { - QString paperName; + QCString paperName; switch (is) { case isTitlePageStart: { - if (paperType=="a4wide") paperName="a4"; else paperName=paperType; + if (Config::paperType=="a4wide") paperName="a4"; else paperName=Config::paperType; t << "\\documentclass[" << paperName << "paper]{"; - if (compactLatexFlag) t << "article"; else t << "book"; + if (Config::compactLatexFlag) t << "article"; else t << "book"; t << "}\n"; - if (paperType=="a4wide") t << "\\usepackage{a4wide}\n"; + if (Config::paperType=="a4wide") t << "\\usepackage{a4wide}\n"; t << "\\usepackage{makeidx}\n" "\\usepackage{fancyheadings}\n" "\\usepackage{epsf}\n" @@ -145,11 +147,11 @@ void LatexGenerator::startIndexSection(IndexSections is) { t << "\\usepackage{" << theTranslator->latexBabelPackage() << "}\n"; } - const char *s=extraPackageList.first(); + const char *s=Config::extraPackageList.first(); while (s) { t << "\\usepackage{" << s << "}\n"; - s=extraPackageList.next(); + s=Config::extraPackageList.next(); } t << "\\makeindex\n" "\\setcounter{tocdepth}{1}\n" @@ -169,23 +171,23 @@ void LatexGenerator::startIndexSection(IndexSections is) t << "}\n\\author{"; break; case isModuleIndex: - if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; + if (Config::compactLatexFlag) t << "\\section"; else t << "\\chapter"; t << "{"; //Module Index}\n" break; case isNamespaceIndex: - if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; + if (Config::compactLatexFlag) t << "\\section"; else t << "\\chapter"; t << "{"; //Namespace Index}\" break; case isClassHierarchyIndex: - if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; + if (Config::compactLatexFlag) t << "\\section"; else t << "\\chapter"; t << "{"; //Hierarchical Index}\n" break; case isCompoundIndex: - if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; + if (Config::compactLatexFlag) t << "\\section"; else t << "\\chapter"; t << "{"; //Annotated Compound Index}\n" break; case isFileIndex: - if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; + if (Config::compactLatexFlag) t << "\\section"; else t << "\\chapter"; t << "{"; //Annotated File Index}\n" break; case isModuleDocumentation: @@ -196,7 +198,7 @@ void LatexGenerator::startIndexSection(IndexSections is) { if (gd->hasDocumentation() || gd->countMembers()>0) { - if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; + if (Config::compactLatexFlag) t << "\\section"; else t << "\\chapter"; t << "{"; //Module Documentation}\n"; found=TRUE; } @@ -212,7 +214,7 @@ void LatexGenerator::startIndexSection(IndexSections is) { if (nd->hasDocumentation()) { - if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; + if (Config::compactLatexFlag) t << "\\section"; else t << "\\chapter"; t << "{"; // Namespace Documentation}\n": found=TRUE; } @@ -228,7 +230,7 @@ void LatexGenerator::startIndexSection(IndexSections is) { if (!cd->isReference() && cd->isVisible()) { - if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; + if (Config::compactLatexFlag) t << "\\section"; else t << "\\chapter"; t << "{"; //Compound Documentation}\n"; found=TRUE; } @@ -249,7 +251,7 @@ void LatexGenerator::startIndexSection(IndexSections is) { if (isFirst) { - if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; + if (Config::compactLatexFlag) t << "\\section"; else t << "\\chapter"; t << "{"; //File Documentation}\n"; isFirst=FALSE; break; @@ -263,13 +265,13 @@ void LatexGenerator::startIndexSection(IndexSections is) break; case isExampleDocumentation: { - if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; + if (Config::compactLatexFlag) t << "\\section"; else t << "\\chapter"; t << "{"; //Example Documentation}\n"; } break; case isPageDocumentation: { - if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; + if (Config::compactLatexFlag) t << "\\section"; else t << "\\chapter"; t << "{"; //Page Documentation}\n"; } break; @@ -289,9 +291,9 @@ void LatexGenerator::endIndexSection(IndexSections is) "\\date{" << dateToString(TRUE) << "}\n" "\\maketitle\n" "\\pagenumbering{roman}\n"; - if (!compactLatexFlag) t << "\\clearemptydoublepage\n"; + if (!Config::compactLatexFlag) t << "\\clearemptydoublepage\n"; t << "\\tableofcontents\n"; - if (!compactLatexFlag) t << "\\clearemptydoublepage\n"; + if (!Config::compactLatexFlag) t << "\\clearemptydoublepage\n"; t << "\\pagenumbering{arabic}\n"; break; case isModuleIndex: @@ -326,7 +328,7 @@ void LatexGenerator::endIndexSection(IndexSections is) { if (gd->hasDocumentation() || gd->countMembers()>0) { - if (compactLatexFlag) t << "\\input"; else t << "\\include"; + if (Config::compactLatexFlag) t << "\\input"; else t << "\\include"; t << "{" << gd->getOutputFileBase() << "}\n"; } gd=groupList.next(); @@ -350,7 +352,7 @@ void LatexGenerator::endIndexSection(IndexSections is) { if (nd->hasDocumentation() || nd->countMembers()>0) { - if (compactLatexFlag) t << "\\input"; else t << "\\include"; + if (Config::compactLatexFlag) t << "\\input"; else t << "\\include"; t << "{" << nd->getOutputFileBase() << "}\n"; } nd=namespaceList.next(); @@ -382,7 +384,7 @@ void LatexGenerator::endIndexSection(IndexSections is) // ) if (!cd->isReference() && cd->isVisible()) { - if (compactLatexFlag) t << "\\input"; else t << "\\include"; + if (Config::compactLatexFlag) t << "\\input"; else t << "\\include"; t << "{" << cd->getOutputFileBase() << "}\n"; } cd=classList.next(); @@ -407,7 +409,7 @@ void LatexGenerator::endIndexSection(IndexSections is) } else { - if (compactLatexFlag) t << "\\input" ; else t << "\\include"; + if (Config::compactLatexFlag) t << "\\input" ; else t << "\\include"; t << "{" << fd->getOutputFileBase() << "}\n"; } } @@ -428,7 +430,7 @@ void LatexGenerator::endIndexSection(IndexSections is) } while (pi) { - if (compactLatexFlag) t << "\\input" ; else t << "\\include"; + if (Config::compactLatexFlag) t << "\\input" ; else t << "\\include"; t << "{" << convertSlashes(pi->name,TRUE) << "-example}\n"; pi=exampleList.next(); } @@ -440,8 +442,8 @@ void LatexGenerator::endIndexSection(IndexSections is) PageInfo *pi=pageList.first(); if (pi) { - QString pageName; - if (caseSensitiveNames) + QCString pageName; + if (Config::caseSensitiveNames) pageName=pi->name.copy(); else pageName=pi->name.lower(); @@ -450,9 +452,9 @@ void LatexGenerator::endIndexSection(IndexSections is) } while (pi) { - if (compactLatexFlag) t << "\\input" ; else t << "\\include"; - QString pageName; - if (caseSensitiveNames) + if (Config::compactLatexFlag) t << "\\input" ; else t << "\\include"; + QCString pageName; + if (Config::caseSensitiveNames) pageName=pi->name.copy(); else pageName=pi->name.lower(); @@ -473,7 +475,7 @@ void LatexGenerator::writeStyleInfo(int part) { case 0: { - QString pname=projectName.stripWhiteSpace(); + QCString pname=Config::projectName.stripWhiteSpace(); startPlainFile("doxygen.sty"); t << "\\NeedsTeXFormat{LaTeX2e}\n"; t << "\\ProvidesPackage{doxygen}\n"; @@ -484,7 +486,7 @@ void LatexGenerator::writeStyleInfo(int part) t << "\\addtolength{\\headwidth}{\\marginparwidth}\n"; t << "\\newcommand{\\clearemptydoublepage}{\\newpage{\\pagestyle{empty}"; t << "\\cleardoublepage}}\n"; - if (!compactLatexFlag) + if (!Config::compactLatexFlag) t << "\\renewcommand{\\chaptermark}[1]{\\markboth{#1}{}}\n"; t << "\\renewcommand{\\sectionmark}[1]{\\markright{\\thesection\\ #1}}\n"; t << "\\lhead[\\fancyplain{}{\\bfseries\\thepage}]\n"; @@ -501,7 +503,7 @@ void LatexGenerator::writeStyleInfo(int part) case 2: { t << " Dimitri van Heesch \\copyright 1997-1999}]{}\n"; - //QString dtString=dateToString(FALSE); + //QCString dtString=dateToString(FALSE); t << "\\lfoot[]{\\fancyplain{}{\\bfseries\\scriptsize "; } break; @@ -646,7 +648,7 @@ void LatexGenerator::writeObjectLink(const char *, const char *, void LatexGenerator::writePageRef(const char *clname, const char *anchor) { - t << " {\\rm (p. \\pageref{"; + t << " {\\rm (p.~\\pageref{"; if (clname) t << clname; if (anchor) t << "_" << anchor; t << "})}"; @@ -662,12 +664,12 @@ void LatexGenerator::writeCodeLink(const char *,const char *, void LatexGenerator::startTitle() { - if (compactLatexFlag) t << "\\subsection{"; else t << "\\section{"; + if (Config::compactLatexFlag) t << "\\subsection{"; else t << "\\section{"; } void LatexGenerator::startGroupHeader() { - if (compactLatexFlag) t << "\\subsubsection*{"; else t << "\\subsection*{"; + if (Config::compactLatexFlag) t << "\\subsubsection*{"; else t << "\\subsection*{"; } void LatexGenerator::endGroupHeader() @@ -700,7 +702,7 @@ void LatexGenerator::startMemberDoc(const char *clname, } t << "}" << endl; // - if (compactLatexFlag) t << "\\subsubsection{"; else t << "\\subsection{"; + if (Config::compactLatexFlag) t << "\\subsubsection{"; else t << "\\subsection{"; t << "\\setlength{\\rightskip}{0pt plus 5cm}"; } @@ -762,7 +764,7 @@ void LatexGenerator::writeSectionRefAnchor(const char *,const char *lab, startBold(); docify(title); endBold(); - t << " (p. \\pageref{" << lab << "})" << endl; + t << " (p.~\\pageref{" << lab << "})" << endl; } //void LatexGenerator::docify(const char *str) @@ -808,78 +810,101 @@ void LatexGenerator::docify(const char *str) else { t << "$\\backslash$"; } break; - // the Latin-1 characters - case 161: t << "!`"; break; - case 181: t << "$\\mu$"; break; - case 191: t << "?`"; break; - case 192: t << "\\`{A}"; break; - case 193: t << "\\'{A}"; break; - case 194: t << "\\^{A}"; break; - case 195: t << "\\~{A}"; break; - case 196: t << "\\\"{A}"; break; - case 197: t << "\\AA "; break; - case 198: t << "\\AE "; break; - case 199: t << "\\c{C}"; break; - case 200: t << "\\`{E}"; break; - case 201: t << "\\'{E}"; break; - case 202: t << "\\^{E}"; break; - case 203: t << "\\\"{E}"; break; - case 204: t << "\\`{I}"; break; - case 205: t << "\\'{I}"; break; - case 206: t << "\\^{I}"; break; - case 207: t << "\\\"{I}"; break; - case 208: t << "D "; break; // anyone know the real code? - case 209: t << "\\~{N}"; break; - case 210: t << "\\`{O}"; break; - case 211: t << "\\'{O}"; break; - case 212: t << "\\^{O}"; break; - case 213: t << "\\~{O}"; break; - case 214: t << "\\\"{O}"; break; - case 215: t << "$\\times$"; break; - case 216: t << "\\O"; break; - case 217: t << "\\`{U}"; break; - case 218: t << "\\'{U}"; break; - case 219: t << "\\^{U}"; break; - case 220: t << "\\\"{U}"; break; - case 221: t << "\\'{Y}"; break; - case 223: t << "\"s "; break; // assumes german package - case 224: t << "\\`{a}"; break; - case 225: t << "\\'{a}"; break; - case 226: t << "\\^{a}"; break; - case 227: t << "\\~{a}"; break; - case 228: t << "\\\"{a}"; break; - case 229: t << "\\aa "; break; - case 230: t << "\\ae "; break; - case 231: t << "\\c{c}"; break; - case 232: t << "\\`{e}"; break; - case 233: t << "\\'{e}"; break; - case 234: t << "\\^{e}"; break; - case 235: t << "\\\"{e}"; break; - case 236: t << "\\`{\\i}"; break; - case 237: t << "\\'{\\i}"; break; - case 238: t << "\\^{\\i}"; break; - case 239: t << "\\\"{\\i}"; break; - case 241: t << "\\~{n}"; break; - case 242: t << "\\`{o}"; break; - case 243: t << "\\'{o}"; break; - case 244: t << "\\^{o}"; break; - case 245: t << "\\~{o}"; break; - case 246: t << "\\\"{o}"; break; - case 248: t << "\\o "; break; - case 249: t << "\\`{u}"; break; - case 250: t << "\\'{u}"; break; - case 251: t << "\\^{u}"; break; - case 252: t << "\\\"{u}"; break; - case 253: t << "\\'{y}"; break; - case 255: t << "\\\"{y}"; break; default: - if ((isupper(c) && islower(pc)) - // || - // (pc!=':' && c==':') || - // (pc==':' && c!=':') - ) t << "\\-"; - t << (char)c; + if (theTranslator->latexBabelPackage()=="a4j") + { // language is japanese + if (c>=128) // wide character + { + t << (char)c; + if (*p) + { + c = *p++; + t << (char)c; + } + else // ascii char => see if we can insert hypenation hint + { + if (isupper(c) && islower(pc)) t << "\\-"; + t << (char)c; + } + } + } + else // language is other than japanese + { + switch(c) + { + // the Latin-1 characters + case 161: t << "!`"; break; + case 181: t << "$\\mu$"; break; + case 191: t << "?`"; break; + case 192: t << "\\`{A}"; break; + case 193: t << "\\'{A}"; break; + case 194: t << "\\^{A}"; break; + case 195: t << "\\~{A}"; break; + case 196: t << "\\\"{A}"; break; + case 197: t << "\\AA "; break; + case 198: t << "\\AE "; break; + case 199: t << "\\c{C}"; break; + case 200: t << "\\`{E}"; break; + case 201: t << "\\'{E}"; break; + case 202: t << "\\^{E}"; break; + case 203: t << "\\\"{E}"; break; + case 204: t << "\\`{I}"; break; + case 205: t << "\\'{I}"; break; + case 206: t << "\\^{I}"; break; + case 207: t << "\\\"{I}"; break; + case 208: t << "D "; break; // anyone know the real code? + case 209: t << "\\~{N}"; break; + case 210: t << "\\`{O}"; break; + case 211: t << "\\'{O}"; break; + case 212: t << "\\^{O}"; break; + case 213: t << "\\~{O}"; break; + case 214: t << "\\\"{O}"; break; + case 215: t << "$\\times$"; break; + case 216: t << "\\O"; break; + case 217: t << "\\`{U}"; break; + case 218: t << "\\'{U}"; break; + case 219: t << "\\^{U}"; break; + case 220: t << "\\\"{U}"; break; + case 221: t << "\\'{Y}"; break; + case 223: t << "\"s "; break; // assumes german package + case 224: t << "\\`{a}"; break; + case 225: t << "\\'{a}"; break; + case 226: t << "\\^{a}"; break; + case 227: t << "\\~{a}"; break; + case 228: t << "\\\"{a}"; break; + case 229: t << "\\aa "; break; + case 230: t << "\\ae "; break; + case 231: t << "\\c{c}"; break; + case 232: t << "\\`{e}"; break; + case 233: t << "\\'{e}"; break; + case 234: t << "\\^{e}"; break; + case 235: t << "\\\"{e}"; break; + case 236: t << "\\`{\\i}"; break; + case 237: t << "\\'{\\i}"; break; + case 238: t << "\\^{\\i}"; break; + case 239: t << "\\\"{\\i}"; break; + case 241: t << "\\~{n}"; break; + case 242: t << "\\`{o}"; break; + case 243: t << "\\'{o}"; break; + case 244: t << "\\^{o}"; break; + case 245: t << "\\~{o}"; break; + case 246: t << "\\\"{o}"; break; + case 248: t << "\\o "; break; + case 249: t << "\\`{u}"; break; + case 250: t << "\\'{u}"; break; + case 251: t << "\\^{u}"; break; + case 252: t << "\\\"{u}"; break; + case 253: t << "\\'{y}"; break; + case 255: t << "\\\"{y}"; break; + default: // normal ascii char + { + // see if we can insert an hyphenation hint + if (isupper(c) && islower(pc)) t << "\\-"; + t << (char)c; + } + } + } } pc = c; } @@ -916,7 +941,7 @@ void LatexGenerator::writeChar(char c) void LatexGenerator::startClassDiagram() { - if (compactLatexFlag) t << "\\subsubsection*"; else t << "\\subsection*"; + if (Config::compactLatexFlag) t << "\\subsubsection*"; else t << "\\subsection*"; t << "{"; } diff --git a/src/latexgen.h b/src/latexgen.h index 5cabe66..cfd8230 100644 --- a/src/latexgen.h +++ b/src/latexgen.h @@ -83,6 +83,8 @@ class LatexGenerator : public OutputGenerator void endMemberSections() {} void startMemberHeader() { startGroupHeader(); } void endMemberHeader() { endGroupHeader(); } + void startMemberSubtitle() {} + void endMemberSubtitle() {} void startMemberList() { t << "\\begin{CompactItemize}" << endl; } void endMemberList() { t << "\\end{CompactItemize}" << endl; } void startMemberItem() { t << "\\item " << endl; } diff --git a/src/logos.cpp b/src/logos.cpp index 090309a..ac6e782 100644 --- a/src/logos.cpp +++ b/src/logos.cpp @@ -14,10 +14,11 @@ * */ -#include <qstring.h> -#include <qfile.h> #include <stdio.h> +#include "qtbc.h" +#include <qfile.h> + unsigned char logo_data[] = { 0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x76, 0x00, 0x35, 0x00, 0xf7, 0x00, 0x00, 0x31, 0x7b, 0x6b, 0x31, 0x7b, 0x73, 0x31, 0x84, 0x7b, 0x31, 0x84, @@ -492,7 +493,7 @@ unsigned int search_len = 2010; void writeLogo(const char *dir) { - QString fileName=(QString)dir+"/doxygen.gif"; + QCString fileName=(QCString)dir+"/doxygen.gif"; QFile f(fileName); if (f.open(IO_WriteOnly)) f.writeBlock((char *)logo_data,logo_len); @@ -505,7 +506,7 @@ void writeLogo(const char *dir) void writeSearchButton(const char *dir) { - QString fileName=(QString)dir+"/search.gif"; + QCString fileName=(QCString)dir+"/search.gif"; QFile f(fileName); if (f.open(IO_WriteOnly)) f.writeBlock((char *)search_data,search_len); diff --git a/src/mangen.cpp b/src/mangen.cpp index d1bc4c6..056bc90 100644 --- a/src/mangen.cpp +++ b/src/mangen.cpp @@ -14,8 +14,10 @@ * */ -#include <qdir.h> #include <stdlib.h> + +#include "qtbc.h" +#include <qdir.h> #include "message.h" #include "mangen.h" #include "config.h" @@ -24,7 +26,7 @@ ManGenerator::ManGenerator() : OutputGenerator() { - dir=manOutputDir+"/man3"; + dir=Config::manOutputDir+"/man3"; firstCol=TRUE; paragraph=FALSE; col=0; @@ -37,7 +39,7 @@ ManGenerator::~ManGenerator() void ManGenerator::append(const OutputGenerator *g) { - QString r=g->getContents(); + QCString r=g->getContents(); if (upperCase) t << r.upper(); else @@ -52,23 +54,23 @@ void ManGenerator::append(const OutputGenerator *g) void ManGenerator::init() { - QDir d(manOutputDir); - if (!d.exists() && !d.mkdir(manOutputDir)) + QDir d(Config::manOutputDir); + if (!d.exists() && !d.mkdir(Config::manOutputDir)) { - err("Could not create output directory %s\n",manOutputDir.data()); + err("Could not create output directory %s\n",Config::manOutputDir.data()); exit(1); } - d.setPath(manOutputDir+"/man3"); - if (!d.exists() && !d.mkdir(manOutputDir+"/man3")) + d.setPath(Config::manOutputDir+"/man3"); + if (!d.exists() && !d.mkdir(Config::manOutputDir+"/man3")) { - err("Could not create output directory %s/man3\n",manOutputDir.data()); + err("Could not create output directory %s/man3\n",Config::manOutputDir.data()); exit(1); } } void ManGenerator::startFile(const char *name,const char *,bool) { - QString fileName=name; + QCString fileName=name; if (fileName.left(6)=="class_") { fileName=fileName.right(fileName.length()-6); @@ -78,7 +80,8 @@ void ManGenerator::startFile(const char *name,const char *,bool) { fileName=fileName.left(i); } - if (fileName.right(2)!=manExtension) fileName+=manExtension; + if (convertToQCString(fileName.right(2))!=Config::manExtension) + fileName+=Config::manExtension; startPlainFile(fileName); firstCol=TRUE; } @@ -95,10 +98,10 @@ void ManGenerator::writeDoxyAnchor(const char *, const char *,const char *) void ManGenerator::endTitleHead(const char *name) { t << ".TH " << name << " 3 \"" << dateToString(FALSE) << "\" \""; - if (projectName.isEmpty()) + if (Config::projectName.isEmpty()) t << "Doxygen"; else - t << projectName; + t << Config::projectName; t << "\" \\\" -*- nroff -*-" << endl; t << ".ad l" << endl; t << ".nh" << endl; diff --git a/src/mangen.h b/src/mangen.h index bcc9034..03a6a39 100644 --- a/src/mangen.h +++ b/src/mangen.h @@ -82,6 +82,8 @@ class ManGenerator : public OutputGenerator void startMemberHeader(); void endMemberHeader(); void insertMemberAlign() {} + void startMemberSubtitle() {} + void endMemberSubtitle() {} void writeListItem(); void startMemberList() { t << "\n.in +1c"; firstCol=FALSE; } void endMemberList() { t << "\n.in -1c"; firstCol=FALSE; } diff --git a/src/memberdef.cpp b/src/memberdef.cpp index bd440c3..1321692 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -58,6 +58,7 @@ MemberDef::MemberDef(const char *t,const char *na,const char *a,const char *e, enumFields=0; enumScope=0; enumDeclList=0; + scopeTAL=0; type=substituteClassNames(t); args=substituteClassNames(a); if (type.isNull()) decl=name()+args; else decl=type+" "+name()+args; @@ -107,7 +108,6 @@ MemberDef::MemberDef(const char *t,const char *na,const char *a,const char *e, { argList=0; } - } MemberDef::~MemberDef() @@ -180,7 +180,7 @@ void MemberDef::writeExample(OutputList &ol) } #endif -QString MemberDef::getOutputFileBase() const +QCString MemberDef::getOutputFileBase() const { if (classDef) { @@ -202,3 +202,50 @@ QString MemberDef::getOutputFileBase() const " container!\n",name().data()); return "dummy"; } + +void MemberDef::setScopeTemplateArguments(ArgumentList *tal) +{ + // copy function arguments (if any) + if (tal) + { + scopeTAL = new ArgumentList; + scopeTAL->setAutoDelete(TRUE); + ArgumentListIterator tali(*tal); + Argument *a; + for (;(a=tali.current());++tali) + { + scopeTAL->append(new Argument(*a)); + } + scopeTAL->constSpecifier = tal->constSpecifier; + scopeTAL->volatileSpecifier = tal->volatileSpecifier; + scopeTAL->pureSpecifier = tal->pureSpecifier; + } +} + +QCString MemberDef::getScopeTemplateNameString() +{ + QCString result; + if (!scopeTAL || scopeTAL->count()==0) return result; + result="<"; + Argument *a=scopeTAL->first(); + while (a) + { + if (a->name.length()>0) // add template argument name + { + result+=a->name; + } + else // extract name from type + { + int i=a->type.length()-1; + while (i>=0 && isId(a->type.at(i))) i--; + if (i>0) + { + result+=a->type.right(a->type.length()-i-1); + } + } + a=scopeTAL->next(); + if (a) result+=", "; + } + result+=">"; + return result; +} diff --git a/src/memberdef.h b/src/memberdef.h index 67a9aa9..4c1893f 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -17,7 +17,7 @@ #ifndef MEMBERDEF_H #define MEMBERDEF_H -#include <qstring.h> +#include "qtbc.h" #include <qlist.h> #include <qdict.h> @@ -55,13 +55,14 @@ class MemberDef : public Definition const ArgumentList *al); ~MemberDef(); - QString getOutputFileBase() const; + QCString getOutputFileBase() const; const char *declaration() const { return decl; } const char *definition() const { return def; } const char *typeString() const { return type; } const char *argsString() const { return args; } const char *excpString() const { return exception; } const char *anchor() const { return ref; } + QCString bodyCode() const { return body; } ClassDef *memberClass() { return classDef; } Protection protection() const { return prot; } Specifier virtualness() const { return virt; } @@ -74,17 +75,25 @@ class MemberDef : public Definition void setFileDec(FileDef *fd) { fileDec=fd; } void setAnchor(const char *a) { ref=a; } void setProtection(Protection p) { prot=p; } + void setBody(const QCString &b) { body=b; } FileDef *getFileDef() { return fileDef; } FileDef *getFileDec() { return fileDec; } void setMemberClass(ClassDef *cd) { classDef=cd; } bool isRelated() const { return related; } bool isStatic() const { return stat; } + bool hasDocumentation() // overrides hasDocumentation in definition.h + { return !documentation().isNull() || + !briefDescription().isNull() || + !body.isEmpty() || + Config::extractAllFlag; + } + bool detailsAreVisible() const - { return !documentation().isEmpty() || + { return !documentation().isEmpty() || !body.isEmpty() || (mtype==Enumeration && docEnumValues) || (mtype==EnumValue && !briefDescription().isEmpty()) || (!briefDescription().isEmpty() && - !briefMemDescFlag && repeatBriefFlag); + !Config::briefMemDescFlag && Config::repeatBriefFlag); } // relation to other members @@ -138,7 +147,14 @@ class MemberDef : public Definition // argument related members ArgumentList *argumentList() const { return argList; } + void setArgumentList(ArgumentList *al) + { if (argList) delete argList; + argList = al; + } ArgumentList *templateArguments() const { return tArgList; } + void setScopeTemplateArguments(ArgumentList *t); + ArgumentList *scopeTemplateArguments() const { return scopeTAL; } + QCString getScopeTemplateNameString(); // namespace related members NamespaceDef *getNamespace() { return nspace; } @@ -158,20 +174,21 @@ class MemberDef : public Definition MemberList *enumFields; // enumeration fields OutputList *enumDeclList; // stored piece of documentation for enumeration. NamespaceDef *nspace; // the namespace this member is in. - QString type; // return type - QString args; // function arguments/variable array specifiers - QString exception; // exceptions that can be thrown - QString decl; // member declaration in class - QString declFile; // file where the declaration was found + QCString type; // return type + QCString args; // function arguments/variable array specifiers + QCString exception; // exceptions that can be thrown + QCString body; // function body code + QCString decl; // member declaration in class + QCString declFile; // file where the declaration was found int declLine; // line where the declaration was found - QString def; // member definition in code (fully qualified name) - QString defFile; // file where the definition was found + QCString def; // member definition in code (fully qualified name) + QCString defFile; // file where the definition was found int defLine; // line where the definition was found - QString ref; // HTML anchor name + QCString ref; // HTML anchor name Specifier virt; // normal/virtual/pure virtual Protection prot; // protection type [Public/Protected/Private] bool related; // is this a member that is only related to a class - QString external; // anchor of a member if extracted from a tag file + QCString external; // anchor of a member if extracted from a tag file bool stat; // is it a static function? MemberType mtype; // returns the kind of member bool eUsed; // is the enumerate already placed in a list @@ -179,6 +196,7 @@ class MemberDef : public Definition bool docEnumValues; // is an enum with documented enum values. ArgumentList *argList; // argument list of this member ArgumentList *tArgList; // template argument list of function template + ArgumentList *scopeTAL; // template argument list of class template // disable copying of member defs MemberDef(const MemberDef &); diff --git a/src/memberlist.cpp b/src/memberlist.cpp index e9fa8b0..99ad00a 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -40,10 +40,10 @@ void MemberList::countDecMembers() MemberDef *md=first(); while (md) { - if ((!hideMemberFlag || md->hasDocumentation()) && - (!hideMemberFlag || !md->documentation().isEmpty() || - briefMemDescFlag || repeatBriefFlag - ) || extractAllFlag || + if ((!Config::hideMemberFlag || md->hasDocumentation()) && + (!Config::hideMemberFlag || !md->documentation().isEmpty() || + Config::briefMemDescFlag || Config::repeatBriefFlag + ) || Config::extractAllFlag || (md->isEnumerate() && md->hasDocumentedEnumValues() ) @@ -59,7 +59,7 @@ void MemberList::countDecMembers() case MemberDef::EnumValue: enumValCnt++; break; case MemberDef::Typedef: typeCnt++; break; case MemberDef::Prototype: protoCnt++; break; - case MemberDef::Define: if (extractAllFlag || md->argsString() || md->hasDocumentation() ) + case MemberDef::Define: if (Config::extractAllFlag || md->argsString() || md->hasDocumentation() ) defCnt++; break; case MemberDef::Friend: friendCnt++; break; @@ -73,18 +73,11 @@ void MemberList::countDecMembers() void MemberList::countDocMembers() { - varCnt=funcCnt=enumCnt=enumValCnt=typeCnt=protoCnt=defCnt=friendCnt; + varCnt=funcCnt=enumCnt=enumValCnt=typeCnt=protoCnt=defCnt=friendCnt=0; MemberDef *md=first(); while (md) { - //if (extractAllFlag || /*md->hasDocumentation()*/ - // !md->documentation().isEmpty() || - // (!md->briefDescription().isEmpty() && - // !briefMemDescFlag && - // repeatBriefFlag - // ) - // ) - if (extractAllFlag || md->detailsAreVisible()) + if (Config::extractAllFlag || md->detailsAreVisible()) { QRegExp r("@[0-9]+"); int dummy; diff --git a/src/membername.h b/src/membername.h index 4754fa7..c485dc8 100644 --- a/src/membername.h +++ b/src/membername.h @@ -29,7 +29,7 @@ class MemberName : public QList<MemberDef> int compareItems(GCI item1,GCI item2); private: - QString name; + QCString name; }; class MemberNameIterator : public QListIterator<MemberDef> @@ -62,8 +62,8 @@ struct MemberInfo MemberDef *memberDef; Protection prot; Specifier virt; - QString scopePath; - QString ambiguityResolutionScope; + QCString scopePath; + QCString ambiguityResolutionScope; }; class MemberNameInfo : public QList<MemberInfo> @@ -74,7 +74,7 @@ class MemberNameInfo : public QList<MemberInfo> const char *memberName() const { return name; } int compareItems(GCI item1,GCI item2); private: - QString name; + QCString name; }; class MemberNameInfoIterator : public QListIterator<MemberInfo> diff --git a/src/message.cpp b/src/message.cpp index 9f98107..c7b2a34 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -20,7 +20,7 @@ void msg(const char *fmt, ...) { - if (!quietFlag) + if (!Config::quietFlag) { va_list args; va_start(args, fmt); @@ -31,7 +31,7 @@ void msg(const char *fmt, ...) void warn(const char *fmt, ...) { - if (warningFlag) + if (Config::warningFlag) { va_list args; va_start(args, fmt); diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index bde86c6..2574563 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -14,6 +14,7 @@ * */ +#include "qtbc.h" #include "namespacedef.h" #include "outputlist.h" #include "util.h" @@ -60,14 +61,14 @@ void NamespaceDef::computeAnchors() void NamespaceDef::writeDocumentation(OutputList &ol) { - QString pageTitle=name()+" Namespace Reference"; + QCString pageTitle=name()+" Namespace Reference"; startFile(ol,fileName,pageTitle); startTitle(ol); //ol.docify(pageTitle); parseText(ol,theTranslator->trNamespaceReference(name())); endTitle(ol,name()); - if (genTagFile.length()>0) tagFile << "%" << name() << ":\n"; + if (Config::genTagFile.length()>0) tagFile << "%" << name() << ":\n"; OutputList briefOutput(&ol); if (briefDescription()) @@ -103,7 +104,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol) ol.startMemberList(); found=TRUE; } - QString clName=cd->name().copy(); + QCString clName=cd->name().copy(); if (clName.left(name().length()+2)==name()+"::") { clName = clName.right(clName.length()-name().length()-2); @@ -225,7 +226,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol) ol.startGroupHeader(); parseText(ol,theTranslator->trAuthor()); ol.endGroupHeader(); - parseText(ol,theTranslator->trGeneratedAutomatically(projectName)); + parseText(ol,theTranslator->trGeneratedAutomatically(Config::projectName)); ol.enableAll(); endFile(ol); } diff --git a/src/namespacedef.h b/src/namespacedef.h index f888f43..ca25700 100644 --- a/src/namespacedef.h +++ b/src/namespacedef.h @@ -17,7 +17,7 @@ #ifndef NAMESPACEDEF_H #define NAMESPACEDEF_H -#include <qstring.h> +#include "qtbc.h" #include <qstrlist.h> #include <qdict.h> #include "definition.h" @@ -33,8 +33,8 @@ class NamespaceDef : public Definition public: NamespaceDef(const char *name,const char *ref=0); ~NamespaceDef(); - //QString namespaceFile() const { return fileName; } - QString getOutputFileBase() const { return fileName; } + //QCString namespaceFile() const { return fileName; } + QCString getOutputFileBase() const { return fileName; } void insertUsedFile(const char *fname); void writeDocumentation(OutputList &ol); void insertClass(ClassDef *cd); @@ -42,10 +42,20 @@ class NamespaceDef : public Definition void computeAnchors(); int countMembers(); const char *getReference() { return reference; } + bool isVisible() + { + return !getReference() && hasDocumentation() && + !name().isEmpty() && name().at(0)!='@'; + } + bool isVisibleExt() + { + return (getReference() || hasDocumentation()) && + !name().isEmpty() && name().at(0)!='@'; + } private: - QString reference; - QString fileName; + QCString reference; + QCString fileName; QStrList files; ClassList *classList; MemberList *memList; diff --git a/src/outputgen.cpp b/src/outputgen.cpp index ca07302..3496aad 100644 --- a/src/outputgen.cpp +++ b/src/outputgen.cpp @@ -15,8 +15,9 @@ */ #include <stdlib.h> + +#include "qtbc.h" #include "outputgen.h" -#include <qstring.h> #include "message.h" OutputGenerator::OutputGenerator() @@ -38,7 +39,7 @@ OutputGenerator::~OutputGenerator() void OutputGenerator::startPlainFile(const char *name) { //printf("startPlainFile(%s)\n",name); - QString fileName=dir+"/"+name; + QCString fileName=dir+"/"+name; file = new QFile(fileName); if (!file) { @@ -66,9 +67,9 @@ void OutputGenerator::endPlainFile() t.setDevice(&b); } -QString OutputGenerator::getContents() const +QCString OutputGenerator::getContents() const { - QString s; + QCString s; s.resize(a.size()+1); memcpy(s.data(),a.data(),a.size()); s.at(a.size())='\0'; diff --git a/src/outputgen.h b/src/outputgen.h index 5b9f981..7411d5c 100644 --- a/src/outputgen.h +++ b/src/outputgen.h @@ -17,7 +17,7 @@ #ifndef OUTPUTGEN_H #define OUTPUTGEN_H -#include <qstring.h> +#include "qtbc.h" #include <qtstream.h> #include <qbuffer.h> #include <qfile.h> @@ -88,6 +88,8 @@ class OutputGenerator virtual void endMemberSections() = 0; virtual void startMemberHeader() = 0; virtual void endMemberHeader() = 0; + virtual void startMemberSubtitle() = 0; + virtual void endMemberSubtitle() = 0; virtual void startMemberList() = 0; virtual void endMemberList() = 0; virtual void startMemberItem() = 0; @@ -168,7 +170,7 @@ class OutputGenerator b.open(IO_WriteOnly); t.setDevice(&b); } void startPlainFile(const char *name); void endPlainFile(); - QString getContents() const; + QCString getContents() const; bool isEnabled() const { return active; } protected: QTextStream fs; @@ -176,7 +178,7 @@ class OutputGenerator QBuffer b; QTextStream t; QFile *file; - QString dir; + QCString dir; bool active; private: diff --git a/src/outputlist.h b/src/outputlist.h index 6f73271..8f66f63 100644 --- a/src/outputlist.h +++ b/src/outputlist.h @@ -17,8 +17,8 @@ #ifndef OUTPUTLIST_H #define OUTPUTLIST_H +#include "qtbc.h" #include <qlist.h> -#include <qstring.h> #include "index.h" // for IndexSections #include "outputgen.h" @@ -137,6 +137,10 @@ class OutputList { forall(&OutputGenerator::startMemberHeader); } void endMemberHeader() { forall(&OutputGenerator::endMemberHeader); } + void startMemberSubtitle() + { forall(&OutputGenerator::startMemberSubtitle); } + void endMemberSubtitle() + { forall(&OutputGenerator::endMemberSubtitle); } void startMemberList() { forall(&OutputGenerator::startMemberList); } void endMemberList() @@ -17,23 +17,10 @@ #ifndef PRE_H #define PRE_H +#include "qtbc.h" #include <stdio.h> -#include <qstring.h> #include <qfile.h> -#if 0 -class Define -{ - public: - Define(const char *n) { name=n; } - ~Define(); - - private: - QString name; - QStrList args; -}; -#endif - void initPreprocessor(); void addSearchDir(const char *dir); void preprocessFile(const char *fileName,BufStr &output); @@ -25,8 +25,8 @@ #include <assert.h> #include <ctype.h> +#include "qtbc.h" #include <qarray.h> -#include <qstring.h> #include <qstack.h> #include <qfile.h> #include <qstrlist.h> @@ -55,7 +55,7 @@ struct FileState int lineNr; FILE *filePtr; YY_BUFFER_STATE bufState; - QString fileName; + QCString fileName; }; /* ----------------------------------------------------------------- @@ -64,30 +64,30 @@ struct FileState */ static int yyLineNr = 1; -static QString yyFileName; +static QCString yyFileName; static int ifcount = 0; static QStrList *pathList = 0; static QStack<FileState> includeStack; static QDict<int> *argDict; -static int defArgs = 0; -static QString defName; -static QString defText; -static QString defArgsStr; +static int defArgs = -1; +static QCString defName; +static QCString defText; +static QCString defArgsStr; static bool defVarArgs; static int level; static int lastCContext; static int lastCPPContext; static QArray<int> levelGuard; -static QString guardExpr; +static QCString guardExpr; static BufStr *outputBuf; -//static DefineCache *fileDefineCache; static int roundCount; -//static const Define *expandDefine; static bool quoteArg; static DefineDict *fileDefineDict; static DefineDict *expandedDict; static int findDefArgContext; +static QCString lastGuardName; + static void incrLevel() { @@ -142,14 +142,14 @@ static FILE *findFile(const char *fileName) char *s=pathList->first(); while (s) { - QString absName=(QString)s+"/"+fileName; + QCString absName=(QCString)s+"/"+fileName; QFileInfo fi(absName); if (fi.exists()) { FILE *f; - if (!inputFilter.isEmpty()) + if (!Config::inputFilter.isEmpty()) { - QString cmd = inputFilter+" "+absName; + QCString cmd = Config::inputFilter+" "+absName; f=popen(cmd,"r"); if (!f) warn("Warning: could not execute filter %s\n",cmd.data()); } @@ -171,14 +171,14 @@ static FILE *findFile(const char *fileName) } -static int getNextChar(const QString &expr,QString *rest,uint &pos); -static int getCurrentChar(const QString &expr,QString *rest,uint pos); -static void unputChar(const QString &expr,QString *rest,uint &pos,char c); -static void expandExpression(QString &expr,QString *rest,int pos); +static int getNextChar(const QCString &expr,QCString *rest,uint &pos); +static int getCurrentChar(const QCString &expr,QCString *rest,uint pos); +static void unputChar(const QCString &expr,QCString *rest,uint &pos,char c); +static void expandExpression(QCString &expr,QCString *rest,int pos); -static QString stringize(const QString &s) +static QCString stringize(const QCString &s) { - QString result; + QCString result; uint i=0; bool inString=FALSE; bool inChar=FALSE; @@ -254,7 +254,7 @@ static QString stringize(const QString &s) * marker (@-) then this is removed (before the concatenated macro name * may be expanded again. */ -static void processConcatOperators(QString &expr) +static void processConcatOperators(QCString &expr) { QRegExp r("[ \\t\\n]*##[ \\t\\n]*"); int l,n,i=0; @@ -286,7 +286,7 @@ static void processConcatOperators(QString &expr) * The replacement string will be returned in \a result and the * length of the (unexpanded) argument list is stored in \a len. */ -static bool replaceFunctionMacro(const QString &expr,QString *rest,int pos,int &len,const Define *def,QString &result) +static bool replaceFunctionMacro(const QCString &expr,QCString *rest,int pos,int &len,const Define *def,QCString &result) { //printf("replaceFunctionMacro(expr=%s,rest=%s,pos=%d,def=%s) level=%d\n",expr.data(),rest ? rest->data() : 0,pos,def->name.data(),level); //bool replaced=FALSE; @@ -312,101 +312,113 @@ static bool replaceFunctionMacro(const QString &expr,QString *rest,int pos,int & //while (j<expr.length() && expr.at(j)!='(') j++; //j++; // skip opening paren - QDict<QString> argTable; // list of arguments + QDict<QCString> argTable; // list of arguments argTable.setAutoDelete(TRUE); - QString arg; + QCString arg; int argCount=0; bool done=FALSE; + // FASE 1: read the macro arguments - while ((argCount<def->nargs || def->varArgs) && - ((cc=getNextChar(expr,rest,j))!=EOF) && !done - ) + if (def->nargs==0) + { + while ((cc=getNextChar(expr,rest,j))!=EOF) + { + char c = (char)cc; + if (c==')') break; + } + } + else { - char c=(char)cc; - if (c=='(') // argument is a function => search for matching ) + while ((argCount<def->nargs || def->varArgs) && + ((cc=getNextChar(expr,rest,j))!=EOF) && !done + ) { - int level=1; - arg+=c; - char term='\0'; - while ((cc=getNextChar(expr,rest,j))!=EOF) + char c=(char)cc; + if (c=='(') // argument is a function => search for matching ) { - char c=(char)cc; - if (c=='\'' || c=='\"') // skip ('s and )'s inside strings + int level=1; + arg+=c; + char term='\0'; + while ((cc=getNextChar(expr,rest,j))!=EOF) { - if (term!='\0') - { - if (c==term && expr.at(j-2)!='\\') term='\0'; - } - else - { - term=c; + char c=(char)cc; + if (c=='\'' || c=='\"') // skip ('s and )'s inside strings + { + if (term!='\0') + { + if (c==term && expr.at(j-2)!='\\') term='\0'; + } + else + { + term=c; + } + } + if (term=='\0' && c==')') + { + level--; + arg+=c; + if (level==0) break; } + else if (term=='\0' && c=='(') + { + level++; + arg+=c; + } + else + arg+=c; } - if (term=='\0' && c==')') + } + else if (c==')' || c==',') // last or next argument found + { + if (c==',' && argCount==def->nargs-1 && def->varArgs) { - level--; - arg+=c; - if (level==0) break; + arg=arg.stripWhiteSpace(); + arg+=','; } - else if (term=='\0' && c=='(') + else { - level++; - arg+=c; + QCString argKey; + argKey.sprintf("@%d",argCount++); // key name + arg=arg.stripWhiteSpace(); + // add argument to the lookup table + argTable.insert(argKey, new QCString(arg)); + arg.resize(0); + if (c==')') // end of the argument list + { + done=TRUE; + } } - else - arg+=c; - } - } - else if (c==')' || c==',') // last or next argument found - { - if (c==',' && argCount==def->nargs-1 && def->varArgs) - { - arg=arg.stripWhiteSpace(); - arg+=','; - } - else + } + else if (c=='\"') // append literal strings { - QString argKey; - argKey.sprintf("@%d",argCount++); // key name - arg=arg.stripWhiteSpace(); - // add argument to the lookup table - argTable.insert(argKey, new QString(arg)); - arg.resize(0); - if (c==')') // end of the argument list + arg+=c; + char pc=c; + bool found=FALSE; + while (!found && (cc=getNextChar(expr,rest,j))!=EOF) { - done=TRUE; + found = pc!='\\' && cc=='"'; + c=(char)cc; + pc=c; + arg+=c; } } - } - else if (c=='\"') // append literal strings - { - arg+=c; - char pc=c; - bool found=FALSE; - while (!found && (cc=getNextChar(expr,rest,j))!=EOF) + else if (c=='\'') // append literal characters { - found = pc!='\\' && cc=='"'; - c=(char)cc; - pc=c; arg+=c; - } - } - else if (c=='\'') // append literal characters - { - arg+=c; - char pc=c; - bool found=FALSE; - while (!found && (cc=getNextChar(expr,rest,j))!=EOF) + char pc=c; + bool found=FALSE; + while (!found && (cc=getNextChar(expr,rest,j))!=EOF) + { + found = pc!='\\' && cc=='\''; + c=(char)cc; + pc=c; + arg+=c; + } + } + else // append other characters { - found = pc!='\\' && cc=='\''; - c=(char)cc; - pc=c; arg+=c; } - } - else // append other characters - { - arg+=c; } } @@ -416,8 +428,8 @@ static bool replaceFunctionMacro(const QString &expr,QString *rest,int pos,int & { uint k=0; // substitution of all formal arguments - QString resExpr; - const QString d=def->definition.stripWhiteSpace(); + QCString resExpr; + const QCString d=def->definition.stripWhiteSpace(); bool inString=FALSE; while (k<d.length()) { @@ -435,8 +447,8 @@ static bool replaceFunctionMacro(const QString &expr,QString *rest,int pos,int & } else // argument marker => read the argument number { - QString key="@"; - QString *subst=0; + QCString key="@"; + QCString *subst=0; bool hash=FALSE; int l=k-1; // search for ## backward @@ -457,7 +469,7 @@ static bool replaceFunctionMacro(const QString &expr,QString *rest,int pos,int & //printf("request key %s result %s\n",key.data(),args[key]->data()); if (key.length()>1 && (subst=argTable[key])) { - QString substArg=*subst; + QCString substArg=*subst; // only if no ## operator is before or after the argument // marker we do macro expansion. if (!hash) expandExpression(substArg,0,0); @@ -506,7 +518,7 @@ static bool replaceFunctionMacro(const QString &expr,QString *rest,int pos,int & * The position of the identifier is returned (or -1 if nothing is found) * and \a l is its length. Any quoted strings are skipping during the search. */ -static int getNextId(const QString &expr,int p,int *l) +static int getNextId(const QCString &expr,int p,int *l) { int n; while (p<(int)expr.length()) @@ -541,11 +553,11 @@ static int getNextId(const QString &expr,int p,int *l) * If \a expandAll is \c TRUE then all macros in the expression are * expanded, otherwise only the first is expanded. */ -static void expandExpression(QString &expr,QString *rest,int pos) +static void expandExpression(QCString &expr,QCString *rest,int pos) { //printf("expandExpression(%s,%s)\n",expr.data(),rest ? rest->data() : 0); - QString macroName; - QString expMacro; + QCString macroName; + QCString expMacro; int i=pos,l,p,len; while ((p=getNextId(expr,i,&l))!=-1) // search for an macro name { @@ -558,7 +570,7 @@ static void expandExpression(QString &expr,QString *rest,int pos) { Define *def=isDefined(macroName); //printf("name is not an expanded macro def=%s\n",def ? def->name.data() : 0); - if (def && def->nargs==0) // simple macro + if (def && def->nargs==-1) // simple macro { // substitute the definition of the macro expMacro=def->definition.stripWhiteSpace(); @@ -566,7 +578,7 @@ static void expandExpression(QString &expr,QString *rest,int pos) len=l; //printf("simple macro expansion=`%s'->`%s'\n",macroName.data(),expMacro.data()); } - else if (def && def->nargs>0) // function macro + else if (def && def->nargs>=0) // function macro { replaced=replaceFunctionMacro(expr,rest,p+l,len,def,expMacro); len+=l; @@ -575,8 +587,8 @@ static void expandExpression(QString &expr,QString *rest,int pos) if (replaced) // expand the macro and rescan the expression { //printf("replacing `%s'->`%s'\n",expr.mid(p,len).data(),expMacro.data()); - QString resultExpr=expMacro; - QString restExpr=expr.right(expr.length()-len-p); + QCString resultExpr=expMacro; + QCString restExpr=expr.right(expr.length()-len-p); processConcatOperators(resultExpr); expandedDict->insert(macroName,def); expandExpression(resultExpr,&restExpr,0); @@ -612,13 +624,13 @@ static void expandExpression(QString &expr,QString *rest,int pos) * \par assumption: * \a s only contains pairs of @@'s. */ -QString removeIdsAndMarkers(const char *s) +QCString removeIdsAndMarkers(const char *s) { //printf("removeIdsAndMarkers(%s)\n",s); const char *p=s; char c; bool inNum=FALSE; - QString result; + QCString result; if (p) { while ((c=*p)) @@ -659,11 +671,11 @@ QString removeIdsAndMarkers(const char *s) * \par assumption: * \a s only contains pairs of @@'s */ -QString removeMarkers(const char *s) +QCString removeMarkers(const char *s) { const char *p=s; char c; - QString result; + QCString result; if (p) { while ((c=*p)) @@ -690,9 +702,9 @@ QString removeMarkers(const char *s) * If needed the function may read additional characters from the input. */ -bool computeExpression(const QString &expr) +bool computeExpression(const QCString &expr) { - QString e=expr; + QCString e=expr; expandExpression(e,0,0); e = removeIdsAndMarkers(e); if (e.length()==0) return FALSE; @@ -704,9 +716,9 @@ bool computeExpression(const QString &expr) * If needed the function may read additional characters from the input */ -QString expandMacro(const QString &name) +QCString expandMacro(const QCString &name) { - QString n=name; + QCString n=name; expandExpression(n,0,0); n=removeMarkers(n); //printf("expandMacro `%s'->`%s'\n",name.data(),n.data()); @@ -761,9 +773,9 @@ static void outputArray(const char *a,int len) if (includeStack.isEmpty()) outputBuf->addArray(a,len); } -static void readIncludeFile(const QString &inc) +static void readIncludeFile(const QCString &inc) { - if (!searchIncludeFlag) return; // do not read include files + if (!Config::searchIncludeFlag) return; // do not read include files uint i=0; // find the start of the include file name while (i<inc.length() && @@ -775,10 +787,10 @@ static void readIncludeFile(const QString &inc) inc.at(i)!='"' && inc.at(i)!='>') i++; if (s<inc.length() && i>s) // valid include file name found { - QString incFileName=inc.mid(s,i-s).stripWhiteSpace(); + QCString incFileName=inc.mid(s,i-s).stripWhiteSpace(); FILE *f; - QString oldFileName=yyFileName.copy(); + QCString oldFileName=yyFileName.copy(); if ((f=findFile(incFileName))) // see if the include file can be found { #if SHOW_INCLUDES @@ -815,6 +827,8 @@ ID [a-z_A-Z][a-z_A-Z0-9]* B [ \t] BN [ \t\r\n] +%option noyywrap + %x Start %x Command %x SkipCommand @@ -822,7 +836,7 @@ BN [ \t\r\n] %x CopyLine %x Include %x IncludeID -%x DefineName +%x DefName %x DefineArg %x DefineText %x SkipCPPBlock @@ -871,16 +885,27 @@ BN [ \t\r\n] } */ <CopyLine>{ID}/{BN}*"(" { + Define *def; + //printf("Search for define %s\n",yytext); if (includeStack.isEmpty() && - macroExpansionFlag && + Config::macroExpansionFlag && /* (expandDefine=fileDefineCache->findDefine(yyFileName,yytext)) */ - fileDefineDict->find(yytext) + (def=fileDefineDict->find(yytext)) ) { + //printf("Found it!\n"); roundCount=0; defArgsStr=yytext; - findDefArgContext = CopyLine; - BEGIN(FindDefineArgs); + if (def->nargs==-1) // no function macro + { + QCString result = expandMacro(defArgsStr); + outputArray(result,result.length()); + } + else // zero or more arguments + { + findDefArgContext = CopyLine; + BEGIN(FindDefineArgs); + } } else { @@ -889,14 +914,16 @@ BN [ \t\r\n] } <CopyLine>{ID} { Define *def=0; + //printf("Search for define %s\n",yytext); if (includeStack.isEmpty() && - macroExpansionFlag && + Config::macroExpansionFlag && (def=fileDefineDict->find(yytext)) && - def->nargs==0 + def->nargs==-1 ) { - QString name=yytext; - QString result=expandMacro(name); + //printf("Found it!\n"); + QCString name=yytext; + QCString result=expandMacro(name); outputArray(result,result.length()); } else @@ -921,7 +948,7 @@ BN [ \t\r\n] roundCount--; if (roundCount==0) { - QString result=expandMacro(defArgsStr); + QCString result=expandMacro(defArgsStr); if (findDefArgContext==CopyLine) { outputArray(result,result.length()); @@ -964,15 +991,15 @@ BN [ \t\r\n] defArgsStr+=*yytext; } <Command>"include"{B}*/{ID} { - if (macroExpansionFlag) + if (Config::macroExpansionFlag) BEGIN(IncludeID); } <Command>"include"{B}*[<"] { BEGIN(Include); } <Command>"define"{B}+ { - //printf("!!!DefineName\n"); - BEGIN(DefineName); + //printf("!!!DefName\n"); + BEGIN(DefName); } <Command>"ifdef"/{B}*"(" { incrLevel(); @@ -1094,6 +1121,7 @@ BN [ \t\r\n] guardExpr+=" 1L "; else guardExpr+=" 0L "; + lastGuardName=yytext; BEGIN(Guard); } <DefinedExpr2>{ID} { @@ -1101,6 +1129,7 @@ BN [ \t\r\n] guardExpr+=" 1L "; else guardExpr+=" 0L "; + lastGuardName.resize(0); } <DefinedExpr1,DefinedExpr2>\n { // should not happen, handle anyway ifcount=0; @@ -1133,11 +1162,12 @@ BN [ \t\r\n] if (!otherCaseDone()) { guardExpr.resize(0); + lastGuardName.resize(0); BEGIN(Guard); } else { - BEGIN(Start); + BEGIN(SkipCPPBlock); } } } @@ -1184,9 +1214,9 @@ BN [ \t\r\n] BEGIN(Start); } <Include>[^\">\n]+[\">] { - QString incName=yytext; + QCString incName=yytext; //int l=incName.length(); - //QString incFileName=incName.left(l-1); + //QCString incFileName=incName.left(l-1); //if (fileDefineCache->fileCached(incFileName)) //{ // printf("file already cached!\n"); @@ -1197,7 +1227,7 @@ BN [ \t\r\n] BEGIN(Start); } -<DefineName>{ID}/"(" { +<DefName>{ID}/"(" { //printf("Define() `%s'\n",yytext); argDict = new QDict<int>(31); argDict->setAutoDelete(TRUE); @@ -1208,33 +1238,80 @@ BN [ \t\r\n] defVarArgs = FALSE; BEGIN(DefineArg); } -<DefineName>{ID}/{B}* { +<DefName>{ID}/{B}* { //printf("Define `%s'\n",yytext); argDict = 0; - defArgs = 0; + defArgs = -1; defArgsStr.resize(0); defText.resize(0); defName = yytext; defVarArgs = FALSE; - QString tmp=(QString)"#define "+defName+defArgsStr; + QCString tmp=(QCString)"#define "+defName+defArgsStr; outputArray(tmp.data(),tmp.length()); quoteArg=FALSE; BEGIN(DefineText); } +<DefName>{ID}/{B}*"\n" { + argDict = 0; + defArgs = -1; + defName = yytext; + defArgsStr.resize(0); + defText.resize(0); + defVarArgs = FALSE; + if ( defName!=lastGuardName ) + { // define may appear in the output + QCString tmp=(QCString)"#define "+defName+defArgsStr; + outputArray(tmp.data(),tmp.length()); + quoteArg=FALSE; + BEGIN(DefineText); + } + else // define is a guard => hide + { + //printf("Found a guard %s\n",yytext); + Define *def=0; + //if (includeStack.isEmpty()) + //{ + // addDefine(); + //} + if (!Config::onlyPredefinedFlag && (def=fileDefineDict->find(defName))==0) + { + fileDefineDict->insert(defName,newDefine()); + } + else if (def)// name already exists + { + if (def->undef) // undefined name + { + def->undef = FALSE; + def->name = defName; + def->definition = defText.stripWhiteSpace(); + def->nargs = defArgs; + def->fileName = yyFileName; + def->lineNr = yyLineNr; + } + else + { + //printf("Error: define %s is defined more than once!\n",defName.data()); + } + } + outputChar('\n'); + lastGuardName.resize(0); + BEGIN(Start); + } + } <DefineArg>","{B}* { defArgsStr+=yytext; } <DefineArg>"("{B}* { defArgsStr+=yytext; } <DefineArg>")"{B}* { defArgsStr+=yytext; - QString tmp=(QString)"#define "+defName+defArgsStr; + QCString tmp=(QCString)"#define "+defName+defArgsStr; outputArray(tmp.data(),tmp.length()); quoteArg=FALSE; BEGIN(DefineText); } <DefineArg>{ID}("..."?) { //printf("Define addArg(%s)\n",yytext); - QString argName=yytext; + QCString argName=yytext; defVarArgs = yytext[yyleng-1]=='.'; - if (defVarArgs) + if (defVarArgs) // strip ellipsis argName=argName.left(argName.length()-3); defArgsStr+=yytext; argDict->insert(argName,new int(defArgs)); @@ -1301,14 +1378,6 @@ BN [ \t\r\n] quoteArg=TRUE; } <DefineText>{ID} { - //bool quote=FALSE; - //char *p=yytext; - //if (p[0]=='#') - //{ - // p++; - // quote=TRUE; - // defText+="\""; - //} if (quoteArg) { defText+="\""; @@ -1320,7 +1389,7 @@ BN [ \t\r\n] { if (!quoteArg) defText+=' '; defText+='@'; - QString numStr; + QCString numStr; numStr.setNum(*n); defText+=numStr; if (!quoteArg) defText+=' '; @@ -1348,16 +1417,14 @@ BN [ \t\r\n] outputChar('\n'); Define *def=0; //printf("Define name=`%s' text=`%s'\n",defName.data(),defText.data()); - if (includeStack.isEmpty()) addDefine(); - if (!onlyPredefinedFlag && (def=fileDefineDict->find(defName))==0) + if (includeStack.isEmpty()) + { + addDefine(); + } + if (!Config::onlyPredefinedFlag && (def=fileDefineDict->find(defName))==0) { fileDefineDict->insert(defName,newDefine()); } - //if ((def=fileDefineCache->findDefine(yyFileName,defName))==0) - //{ - // printf("define is not found\n"); - // fileDefineCache->insertDefine(yyFileName,defName,newDefine()); - //} else if (def)// name already exists { //printf("define found\n"); @@ -1377,6 +1444,7 @@ BN [ \t\r\n] } delete argDict; yyLineNr++; + lastGuardName.resize(0); BEGIN(Start); } <DefineText>{B}* { defText += ' '; } @@ -1411,7 +1479,7 @@ BN [ \t\r\n] { FileState *fs=includeStack.pop(); //fileDefineCache->merge(yyFileName,fs->fileName); - if (inputFilter.isEmpty()) + if (Config::inputFilter.isEmpty()) fclose(fs->filePtr); else pclose(fs->filePtr); @@ -1447,7 +1515,7 @@ BN [ \t\r\n] /*@ ---------------------------------------------------------------------------- */ -static int getNextChar(const QString &expr,QString *rest,uint &pos) +static int getNextChar(const QCString &expr,QCString *rest,uint &pos) { //printf("getNextChar(%s,%s,%d)\n",expr.data(),rest ? rest->data() : 0,pos); if (pos<expr.length()) @@ -1470,7 +1538,7 @@ static int getNextChar(const QString &expr,QString *rest,uint &pos) } } -static int getCurrentChar(const QString &expr,QString *rest,uint pos) +static int getCurrentChar(const QCString &expr,QCString *rest,uint pos) { //printf("getCurrentChar(%s,%s,%d)\n",expr.data(),rest ? rest->data() : 0,pos); if (pos<expr.length()) @@ -1492,7 +1560,7 @@ static int getCurrentChar(const QString &expr,QString *rest,uint pos) } } -static void unputChar(const QString &expr,QString *rest,uint &pos,char c) +static void unputChar(const QCString &expr,QCString *rest,uint &pos,char c) { //printf("unputChar(%s,%s,%d,%c)\n",expr.data(),rest ? rest->data() : 0,pos,c); if (pos<expr.length()) @@ -1554,37 +1622,92 @@ void preprocessFile(const char *fileName,BufStr &output) expandedDict->clear(); // add predefined macros - char *defStr = predefined.first(); + char *defStr = Config::predefined.first(); while (defStr) { - QString ds = defStr; - int i; - if ((i=ds.find('='))==-1) + QCString ds = defStr; + int i_equals=ds.find('='); + int i_obrace=ds.find('('); + int i_cbrace=ds.find(')'); + + if (i_obrace==0) continue; // no define name + + if (i_obrace<i_equals && i_cbrace<i_equals && + i_obrace!=-1 && i_cbrace!=-1 && + i_obrace<i_cbrace + ) // predefined function macro definition { - if (ds.length()>0) - { - Define *def = new Define; - def->name = ds; - def->definition = "1"; - def->nargs = 0; - fileDefineDict->insert(ds,def); + QRegExp reId("[a-z_A-Z][a-z_A-Z0-9]*"); // regexp matching an id + QDict<int> argDict(17); + argDict.setAutoDelete(TRUE); + int i=i_obrace+1,p,l,count=0; + // gather the formal arguments in a dictionary + while (i<i_cbrace && (p=reId.match(ds,i,&l))) + { + argDict.insert(ds.mid(p,l),new int(count++)); + i=p+l; + } + // strip definition part + QCString tmp=ds.right(ds.length()-i_equals-1); + QCString definition; + i=0; + // substitute all occurrences of formal arguments by their + // corresponding markers + while ((p=reId.match(tmp,i,&l))!=-1) + { + if (p>i) definition+=tmp.mid(i,p-i); + int *argIndex; + if ((argIndex=argDict[tmp.mid(p,l)])!=0) + { + QCString marker; + marker.sprintf(" @%d ",*argIndex); + definition+=marker; + } + else + { + definition+=tmp.mid(p,l); + } + i=p+l; } + if (i<(int)tmp.length()) definition+=tmp.mid(i,tmp.length()-i); + + // add define definition to the dictionary of defines for this file + Define *def = new Define; + def->name = ds.left(i_obrace); + def->definition = definition; + def->nargs = count; + fileDefineDict->insert(def->name,def); + + //printf("#define `%s' `%s' #nargs=%d\n", + // def->name.data(),def->definition.data(),def->nargs); } - else + else if ((i_obrace==-1 || i_obrace>i_equals) && + (i_cbrace==-1 || i_cbrace>i_equals) && + ds.length()>0 && (int)ds.length()>i_equals + ) // predefined non-function macro definition { - if (i>0 && (int)ds.length()>i) + Define *def = new Define; + if (i_equals==-1) // simple define without argument + { + def->name = ds; + def->definition = "1"; // substitute occurrences by 1 (true) + } + else // simple define with argument { - Define *def = new Define; - def->name = ds.left(i); - def->definition = ds.right(ds.length()-i-1); - def->nargs = 0; - fileDefineDict->insert(ds.left(i),def); - } + def->name = ds.left(i_equals); + def->definition = ds.right(ds.length()-i_equals-1); + } + def->nargs = -1; + fileDefineDict->insert(def->name,def); + + //printf("#define `%s' `%s' #nargs=%d\n", + // def->name.data(),def->definition.data(),def->nargs); } - defStr=predefined.next(); + + defStr=Config::predefined.next(); } - if (inputFilter.isEmpty()) + if (Config::inputFilter.isEmpty()) { preYYin = fopen(fileName,"r"); if (!preYYin) @@ -1595,7 +1718,7 @@ void preprocessFile(const char *fileName,BufStr &output) } else { - QString cmd = inputFilter+" "+fileName; + QCString cmd = Config::inputFilter+" "+fileName; preYYin = popen(cmd,"r"); if (!preYYin) { @@ -1605,10 +1728,15 @@ void preprocessFile(const char *fileName,BufStr &output) } yyLineNr = 1; level = 0; + ifcount = 0; yyFileName = fileName; BEGIN( Start ); + + lastGuardName.resize(0); + guardExpr.resize(0); + preYYlex(); - if (inputFilter.isEmpty()) + if (Config::inputFilter.isEmpty()) fclose(preYYin); else pclose(preYYin); @@ -1629,8 +1757,7 @@ void preprocessFile(const char *fileName,BufStr &output) #endif } - extern "C" { // some bogus code to keep the compiler happy - int preYYwrap() { return 1 ; } +// int preYYwrap() { return 1 ; } void preYYdummy() { yy_flex_realloc(0,0); } } diff --git a/src/qtbc.h b/src/qtbc.h new file mode 100644 index 0000000..2049fdd --- /dev/null +++ b/src/qtbc.h @@ -0,0 +1,42 @@ +/****************************************************************************** + * + * $Id$ + * + * Copyright (C) 1997-1999 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. + * + * All output generated with Doxygen is not covered 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 + +#define GCI QCollection::Item + +#include <qcstring.h> +#include <qstring.h> +inline QCString convertToQCString(const QString &s) { return s.local8Bit(); } + +#else /* QT_VERSION < 200 */ + +#include <qstring.h> +#define QCString QString +inline QCString convertToQCString(const QCString &s) { return s; } + +#endif + +#endif diff --git a/src/scanner.h b/src/scanner.h index acebd5f..1e6bad7 100644 --- a/src/scanner.h +++ b/src/scanner.h @@ -17,9 +17,9 @@ #ifndef SCANNER_H #define SCANNER_H +#include "qtbc.h" #include <stdio.h> #include <qlist.h> -#include <qstring.h> #include "entry.h" #include "code.h" @@ -28,8 +28,8 @@ class OutputList; extern void parseMain(Entry *); extern void parseDoc(OutputList &ol,const char *clName, const char *memName, - const QString &docString); -extern void parseExample(OutputList &ol,const QString &docString, + const QCString &docString); +extern void parseExample(OutputList &ol,const QCString &docString, const char *fileName); -extern void parseText(OutputList &ol,const QString &txtString); +extern void parseText(OutputList &ol,const QCString &txtString); #endif diff --git a/src/scanner.l b/src/scanner.l index 9737ff1..9c7b477 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -25,8 +25,8 @@ #include <assert.h> #include <ctype.h> +#include "qtbc.h" #include <qarray.h> -#include <qstring.h> #include <qstack.h> #include <qregexp.h> @@ -51,14 +51,14 @@ * statics */ static bool insideArgumentList; -static QString className; -static QString memberName; -static QString refName; +static QCString className; +static QCString memberName; +static QCString refName; static OutputList * outDoc; -static QString code; -static QString linkRef; -static QString linkText; -static QString codeBlock; +static QCString code; +static QCString linkRef; +static QCString linkText; +static QCString codeBlock; static const char * inputString; static int inputPosition; static int lastContext; @@ -78,6 +78,7 @@ static int lastGroupContext; static int lastFormulaContext; static int lastAnchorContext; static int nextDefContext; +static int overloadContext; static Protection protection; static Protection baseProt; static int bracketCount = 0 ; @@ -87,6 +88,8 @@ static int ifCount = 0 ; static Entry* current_root = 0 ; static Entry* global_root = 0 ; static Entry* current = 0 ; +static Entry* previous = 0 ; +static Entry* tempEntry = 0 ; static int yyLineNr = 0 ; static int anonCount = 0 ; static char yyFileName[2048] ; @@ -97,10 +100,10 @@ static bool removeSlashes; static Specifier virt; static Specifier baseVirt; static bool exampleDoc; -static QString exampleName; -static QString htmlUrl,htmlText; -static QString currentIncludeFile; -static QString msType,msName,msArgs; +static QCString exampleName; +static QCString htmlUrl,htmlText; +static QCString currentIncludeFile; +static QCString msType,msName,msArgs; static int includeFileOffset = 0; static int includeFileLength = 0; static bool firstLine; @@ -119,16 +122,16 @@ static bool firstSeeArg; static bool javaDocSee; static char afterDocTerminator; static int tmpDocType; -static QString sectionLabel; -static QString sectionTitle; +static QCString sectionLabel; +static QCString sectionTitle; static SectionInfo::SectionType sectionType; -static QString funcPtrType; -static QString templateStr; -static QString baseName; -static QString *specName; -static QString formulaText; -static QString sectionRef; +static QCString funcPtrType; +static QCString templateStr; +static QCString baseName; +static QCString *specName; +static QCString formulaText; +static QCString sectionRef; // state variable for reading the argument list of a function static int argRoundCount; @@ -136,7 +139,7 @@ static int argSharpCount; static int currentArgumentContext; static int lastCopyArgStringContext; static int lastCopyArgContext; -static QString *copyArgString; +static QCString *copyArgString; @@ -404,9 +407,9 @@ static void verbIncludeFile(OutputList &ol,const char *name) } -static QString stripQuotes(const char *s) +static QCString stripQuotes(const char *s) { - QString name; + QCString name; if (s==0 || *s==0) return name; name=s; if (name.at(0)=='"' && name.at(name.length()-1)=='"') @@ -416,9 +419,9 @@ static QString stripQuotes(const char *s) return name; } -static QString stripKnownExtensions(const char *text) +static QCString stripKnownExtensions(const char *text) { - QString result=text; + QCString result=text; if (result.right(4)==".tex") result=result.left(result.length()-4); else if (result.right(5)==".html") result=result.left(result.length()-5); //printf("%s stripKnowExtensions(%s)\n",result.data(),text); @@ -430,7 +433,7 @@ static void skipLine(OutputList &ol,const char *key) bool found=FALSE; while (!found) { - QString s; + QCString s; char c; while ( includeFileOffset<includeFileLength && (c=currentIncludeFile[includeFileOffset++])!='\n' && c!=0 @@ -451,7 +454,7 @@ static void skipUntil(const char *key) bool found=FALSE; while (!found) { - QString s; + QCString s; int i=includeFileOffset; char c; while ( i<includeFileLength && @@ -470,7 +473,7 @@ static void skipUntil(const char *key) static void showLine(OutputList &ol,const char *key) { - QString s; + QCString s; char c; bool found=FALSE; while (!found) @@ -494,7 +497,7 @@ static void showUntil(OutputList &ol,const char *key) bool found=FALSE; while (!found) { - QString s; + QCString s; char c; while ( includeFileOffset<includeFileLength && (c=currentIncludeFile[includeFileOffset++])!='\n' && c!=0 @@ -537,8 +540,9 @@ static void addSection() if (sectionDict[sectionLabel]==0) { SectionInfo *si=new SectionInfo(sectionLabel,sectionTitle,sectionType); + //printf("Adding section addr=%p label=`%s' sectionTitle=`%s' fileName=%s\n",si,sectionLabel.data(),sectionTitle.data(),si->fileName.data()); sectionDict.insert(sectionLabel,si); - current->anchors->append(new QString(sectionLabel)); + current->anchors->append(new QCString(sectionLabel)); } else { @@ -548,10 +552,10 @@ static void addSection() // Adds a formula text to the list/dictionary of formulas if it was // not already added. Returns the label of the formula. -static QString addFormula() +static QCString addFormula() { - QString formLabel; - QString fText=formulaText.simplifyWhiteSpace(); + QCString formLabel; + QCString fText=formulaText.simplifyWhiteSpace(); Formula *f=0; if ((f=formulaDict[fText])==0) { @@ -568,8 +572,17 @@ static QString addFormula() return formLabel; } -/* ----------------------------------------------------------------- - */ +static bool nameIsOperator(QCString &name) +{ + return name.right(8)=="operator" && + (name.length()==8 || !isId(name.at(name.length()-9))); +} + +/* ----------------------------------------------------------------- */ + +static void addToBody(const char *text); +static void addToBodyCond(const char *text); +/* ----------------------------------------------------------------- */ #undef YY_INPUT #define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size); @@ -641,6 +654,8 @@ TT [tT][tT] UL [uU][lL] VAR [vV][aA][rR] +%option noyywrap + %x Define %x DefineArg %x DefineEnd @@ -664,13 +679,15 @@ VAR [vV][aA][rR] %x NameSpaceDocArg1 %x SkipCurly %x SkipCurlyCpp +%x SkipCurlyEndDoc %x SkipString %x SkipInits %x SkipCPP %x SkipCPPBlock %x SkipComment %x SkipCxxComment -%x SkipBlock +%x SkipCurlyBlock +%x SkipRoundBlock %x SkipCode %x Sharp %x SkipSharp @@ -688,6 +705,7 @@ VAR [vV][aA][rR] %x ClassDocFunc %x ClassDocFuncPtr %x ClassDocFuncQual +%x ClassDocFuncSkipLine %x ClassDocFuncExc %x ClassDocDefine %x ClassDocRelates @@ -818,7 +836,7 @@ VAR [vV][aA][rR] <DocScan,Text>"&"[AEIOUaeiou]"circ;" { outDoc->writeCirc(yytext[1]); } <DocScan,Text>"&"[ANOano]"tilde;" { outDoc->writeTilde(yytext[1]); } <DocScan,DocHtmlScan,DocLatexScan>"$("[a-z_A-Z]+")" { - QString envvar=&yytext[2]; + QCString envvar=&yytext[2]; envvar=envvar.left(envvar.length()-1); outDoc->docify(getenv(envvar)); } @@ -879,7 +897,7 @@ VAR [vV][aA][rR] outDoc->codify(c); } <DocScan>("\\"|"@")"internal"/{BN} { - if (!internalDocsFlag) + if (!Config::internalDocsFlag) { outDoc->newParagraph(); scanString(theTranslator->trForInternalUseOnly()+"\n"); @@ -921,7 +939,7 @@ VAR [vV][aA][rR] Formula *formula=formulaNameDict[yytext]; if (formula) { - QString formName; + QCString formName; formName.sprintf("form-%d.gif",formula->getId()); outDoc->writeFormula(formName,formula->getFormulaText()); } @@ -952,7 +970,7 @@ VAR [vV][aA][rR] inParBlock=TRUE; outDoc->startDescList(); outDoc->startBold(); - outDoc->docify(((QString)yytext).stripWhiteSpace()); + outDoc->docify(((QCString)yytext).stripWhiteSpace()); outDoc->endBold(); outDoc->endDescTitle(); outDoc->writeDescItem(); @@ -1137,7 +1155,7 @@ VAR [vV][aA][rR] BEGIN(DocScan); } <DocScan>"\\section "{ID}"\n" { - QString secName=&yytext[9]; // skip "\section " + QCString secName=&yytext[9]; // skip "\section " secName=secName.left(secName.length()-1); // remove \n //printf("SectionName %s found\n",secName.data()); SectionInfo *sec; @@ -1149,7 +1167,7 @@ VAR [vV][aA][rR] } } <DocScan>"\\anchor "{ID}"\n" { - QString secName=&yytext[8]; + QCString secName=&yytext[8]; secName=secName.left(secName.length()-1); SectionInfo *sec; if ((sec=sectionDict[secName])) @@ -1164,11 +1182,11 @@ VAR [vV][aA][rR] BEGIN(DocRefItem); } <DocRefName>{ID} { - QString ref=yytext; + QCString ref=yytext; SectionInfo *sec; if ((sec=sectionDict[ref])) { - QString text; + QCString text; if (sec->title.isEmpty()) text=sec->label; else @@ -1179,6 +1197,7 @@ VAR [vV][aA][rR] } else { + //printf(" ref sec=%p sec->fileName=%s\n",sec,sec->fileName.data()); outDoc->writeSectionRef(sec->fileName,sec->label,text); } } @@ -1198,7 +1217,7 @@ VAR [vV][aA][rR] } <DocRefArg>[^\"\n]+[\n\"] { yytext[yyleng-1]='\0'; - QString text=substitute(yytext,"\\\\","\\"); + QCString text=substitute(yytext,"\\\\","\\"); SectionInfo *sec; if ((sec=sectionDict[sectionRef])) { @@ -1250,13 +1269,13 @@ VAR [vV][aA][rR] <DocScan>{SCOPEMASK}(("()")?) { generateRef(*outDoc,className,yytext,inSeeBlock); } -<DocScan>({SCOPEMASK}"::")?"operator"[^(\r\n.,]*"("[a-z_A-Z,\<\> \t\*\&]*")" { - QString oName=yytext; +<DocScan>({SCOPEMASK}"::")?"operator()("[a-z_A-Z,\<\> \t\*\&]*")" { + QCString oName=yytext; generateRef(*outDoc,className, removeRedundantWhiteSpace(oName),inSeeBlock); } -<DocScan>({SCOPEMASK}"::")?"operator()("[a-z_A-Z,\<\> \t\*\&]*")" { - QString oName=yytext; +<DocScan>({SCOPEMASK}"::")?"operator"[^(\r\n.,]*"("[a-z_A-Z,\<\> \t\*\&]*")" { + QCString oName=yytext; generateRef(*outDoc,className, removeRedundantWhiteSpace(oName),inSeeBlock); } @@ -1532,9 +1551,28 @@ VAR [vV][aA][rR] <DocCode,DocEmphasis,DocBold,DocScan,Text>. { outDoc->writeChar(*yytext); } -<NextSemi>"{" { BEGIN(SkipBlock); } -<SkipBlock>"{" { ++bracketCount ; } -<SkipBlock>"}" { if( bracketCount ) +<NextSemi>"{" { + bracketCount=0; + BEGIN(SkipCurlyBlock); + } +<NextSemi>"(" { + roundCount=0; + BEGIN(SkipRoundBlock); + } +<SkipRoundBlock>"(" { + ++roundCount; + } +<SkipRoundBlock>")" { + if (roundCount ) + --roundCount ; + else + BEGIN( NextSemi ) ; + } +<SkipCurlyBlock>"{" { + ++bracketCount ; + } +<SkipCurlyBlock>"}" { + if( bracketCount ) --bracketCount ; else BEGIN( NextSemi ) ; @@ -1653,7 +1691,7 @@ VAR [vV][aA][rR] BEGIN( ClassName ); } <FindMembers>{B}*(("typedef"{BN}+)?)"class"{BN}+ { - isTypedef=((QString)yytext).find("typedef")!=-1; + isTypedef=((QCString)yytext).find("typedef")!=-1; current->section = Entry::CLASS_SEC ; addType( current ) ; current->type += " class" ; @@ -1663,7 +1701,7 @@ VAR [vV][aA][rR] BEGIN( ClassName ) ; } <FindMembers>{B}*(("typedef"{BN}+)?)"struct"{BN}+ { - isTypedef=((QString)yytext).find("typedef")!=-1; + isTypedef=((QCString)yytext).find("typedef")!=-1; current->section = Entry::STRUCT_SEC ; addType( current ) ; current->type += " struct" ; @@ -1673,7 +1711,7 @@ VAR [vV][aA][rR] BEGIN( ClassName ) ; } <FindMembers>{B}*(("typedef"{BN}+)?)"union"{BN}+ { - isTypedef=((QString)yytext).find("typedef")!=-1; + isTypedef=((QCString)yytext).find("typedef")!=-1; current->section = Entry::UNION_SEC ; addType( current ) ; current->type += " union" ; @@ -1683,7 +1721,7 @@ VAR [vV][aA][rR] BEGIN( ClassName ) ; } <FindMembers>{B}*(("typedef"{BN}+)?)"enum"{BN}+ { - isTypedef=((QString)yytext).find("typedef")!=-1; + isTypedef=((QCString)yytext).find("typedef")!=-1; current->section = Entry::ENUM_SEC ; addType( current ) ; current->type += " enum" ; @@ -1751,7 +1789,7 @@ VAR [vV][aA][rR] <FindMembers>"using"{BN}+ { lineCount(); BEGIN(Using); } <Using>";" { BEGIN(FindMembers); } <FindMembers>{SCOPENAME}{BN}*"<>" { // guided template decl - QString n=yytext; + QCString n=yytext; addType( current ); current->name=n.left(n.length()-2); } @@ -1761,7 +1799,7 @@ VAR [vV][aA][rR] addType( current ); current->name=yytext; current->name=current->name.stripWhiteSpace(); - if (current->name.right(8)=="operator") + if (nameIsOperator(current->name)) BEGIN( Operator ); else BEGIN( EndTemplate ); @@ -1813,7 +1851,7 @@ VAR [vV][aA][rR] { current->name += yytext; } - QString tmp=yytext; + QCString tmp=yytext; if (tmp.right(8)=="operator") BEGIN( Operator ); else @@ -1868,7 +1906,7 @@ VAR [vV][aA][rR] <DefineEnd>. <FindMembers>[*&]+ { current->name += yytext ; } -<FindMembers,MemberSpec,Function,NextSemi>";"{BN}*("/**"|"//!"|"/*!")"<" { +<FindMembers,MemberSpec,Function,NextSemi>";"{BN}*("/**"|"//!"|"/*!"|"///")"<" { lineCount(); current->doc.resize(0); current->brief.resize(0); @@ -1876,12 +1914,12 @@ VAR [vV][aA][rR] afterDocTerminator = ';'; if (yytext[yyleng-3]=='/') BEGIN(AfterDocLine); - else if (yytext[yyleng-2]=='*') + else if (yytext[yyleng-2]=='*' && Config::autoBriefFlag) BEGIN(AfterDocBrief); else BEGIN(AfterDoc); } -<MemberSpec,FindFields,FindMembers,NextSemi>","{BN}*("/**"|"//!"|"/*!")"<" { +<MemberSpec,FindFields,FindMembers,NextSemi>","{BN}*("/**"|"//!"|"/*!"|"///")"<" { lineCount(); current->doc.resize(0); current->brief.resize(0); @@ -1889,12 +1927,12 @@ VAR [vV][aA][rR] afterDocTerminator = ','; if (yytext[yyleng-3]=='/') BEGIN(AfterDocLine); - else if (yytext[yyleng-2]=='*') + else if (yytext[yyleng-2]=='*' && Config::autoBriefFlag) BEGIN(AfterDocBrief); else BEGIN(AfterDoc); } -<DefineEnd,FindFields,FindFieldArg>{BN}*("/**"|"//!"|"/*!")"<" { +<DefineEnd,FindFields,FindFieldArg>{BN}*("/**"|"//!"|"/*!"|"///")"<" { lineCount(); current->doc.resize(0); current->brief.resize(0); @@ -1905,7 +1943,7 @@ VAR [vV][aA][rR] afterDocTerminator = 0; if (yytext[yyleng-3]=='/') BEGIN(AfterDocLine); - else if (yytext[yyleng-2]=='*') + else if (yytext[yyleng-2]=='*' && Config::autoBriefFlag) BEGIN(AfterDocBrief); else BEGIN(AfterDoc); @@ -1914,8 +1952,10 @@ VAR [vV][aA][rR] BEGIN(NextSemi); } <FindMembers>[:;,] { - QString oldType = current->type.copy(); - QString oldDocs = current->doc.copy(); + QCString oldType = current->type.copy(); + QCString oldDocs = current->doc.copy(); + if ( *yytext != ':') + { current->type=current->type.simplifyWhiteSpace(); current->args=current->args.simplifyWhiteSpace(); current->name=current->name.stripWhiteSpace(); @@ -1931,9 +1971,12 @@ VAR [vV][aA][rR] current->sig = sig = FALSE; current->virt = Normal; current->stat = gstat; + } // skip expression or bitfield if needed if ( *yytext == ':') + { BEGIN( NextSemi ); + } else { if ( *yytext == ',' ) @@ -2004,7 +2047,7 @@ VAR [vV][aA][rR] current->slot = slot; } <FindFieldArg>"," { unput(*yytext); BEGIN(FindFields); } -<Curly>[^\r\n{}"/]* { current->program += yytext ; } +<Curly>[^\r\n{}"'/]* { current->program += yytext ; } <Curly>"//".* { current->program += yytext ; } <Curly>\"[^\r\n"]*\" { current->program += yytext ; } <Curly>"/*"{B}* { current->program += yytext ; @@ -2016,6 +2059,9 @@ VAR [vV][aA][rR] lastContext = Curly ; BEGIN( Comment ) ; } +<Curly>"'"\\[0-7]{1,3}"'" { current->program += yytext; } +<Curly>"'"\\."'" { current->program += yytext; } +<Curly>"'"."'" { current->program += yytext; } <Curly>"{" { current->program += yytext ; ++bracketCount ; } @@ -2026,16 +2072,15 @@ VAR [vV][aA][rR] } else { - QString &cn = current->name; - QString &rn = current_root->name; - //printf("current->name=`%s' current_root->name=`%s'\n", - // cn.data(),rn.data()); - if (cn && cn[0]!='@' && + QCString &cn = current->name; + QCString rn = stripAnnonymousScope(current_root->name); + //printf("cn=`%s' rn=`%s'\n",cn.data(),rn.data()); + if (!cn.isEmpty() && !rn.isEmpty() && (current_root->section & Entry::SCOPE_MASK)) { cn.prepend(rn+"::"); } - if (isTypedef && cn.length()==0) + if (isTypedef && cn.isEmpty()) { //printf("Typedef Name\n"); BEGIN( TypedefName ); @@ -2150,6 +2195,7 @@ VAR [vV][aA][rR] <MemberSpecSkip>"{" { bracketCount=0; lastCurlyContext = MemberSpecSkip; + previous = current; BEGIN(SkipCurly); } <MemberSpecSkip>"," { BEGIN(MemberSpec); } @@ -2392,8 +2438,8 @@ VAR [vV][aA][rR] current->name=current->name.simplifyWhiteSpace(); current->type=current->type.simplifyWhiteSpace(); current->args=current->args.simplifyWhiteSpace(); - QString &cn=current->name; - QString &rn=current_root->name; + QCString &cn=current->name; + QCString &rn=current_root->name; //printf("current_root->name=`%s'\n",rn.data()); //printf("Function: `%s' `%s' `%s'\n",current->type.data(),cn.data(),current->args.data()); int i; @@ -2415,7 +2461,7 @@ VAR [vV][aA][rR] if (*yytext!=';' || (current_root->section&Entry::SCOPE_MASK) ) { int tempArg=current->name.find('<'); - QString tempName; + QCString tempName; if (tempArg==-1) tempName=current->name; else @@ -2437,7 +2483,7 @@ VAR [vV][aA][rR] else // a global function prototype or function variable { //printf("Scanner.l: prototype? type=`%s' name=`%s' args=`%s'\n",current->type.data(),current->name.data(),current->args.data()); - QRegExp re("([^)])"); + QRegExp re("([^)]*)"); if (!current->type.isNull() && current->type.find(re,0)!=-1) { //printf("Scanner.l: found function variable!\n"); @@ -2450,6 +2496,7 @@ VAR [vV][aA][rR] current->proto = TRUE; } } + previous = current; current_root->addSubEntry(current); current = new Entry ; current->protection = protection; @@ -2459,46 +2506,127 @@ VAR [vV][aA][rR] current->slot = slot; lastCurlyContext = FindMembers; if( *yytext == '{' ) - BEGIN( SkipCurly ) ; + { + addToBody(yytext); + BEGIN( SkipCurly ) ; + } else if( *yytext == ':' ) - BEGIN( SkipInits ) ; + { + addToBody(yytext); + BEGIN( SkipInits ) ; + } else - BEGIN( FindMembers ) ; + BEGIN( FindMembers ) ; } <SkipInits>"{" { + addToBody(yytext); lastCurlyContext = FindMembers; BEGIN( SkipCurly ) ; } -<SkipCurly,SkipCurlyCpp>"{" { ++bracketCount ; } -<SkipCurly,SkipCurlyCpp>"}" { if( bracketCount ) +<SkipCurly>"{" { + addToBody(yytext); + ++bracketCount ; + } +<SkipCurly>"}" { + addToBody(yytext); + if( bracketCount ) --bracketCount ; else - //BEGIN( FindMembers ) ; BEGIN( lastCurlyContext ) ; } -<SkipCurly>"'"\\[0-7]{1,3}"'" -<SkipCurly>"'"\\."'" -<SkipCurly>"'"."'" +<SkipCurly>"}"{BN}*("/*!"|"/**"|"//!"|"///")"<" { + if ( bracketCount ) + { + addToBody(yytext); + --bracketCount ; + } + else + { + lineCount(); + tempEntry = current; // temporarily switch to the previous entry + current = previous; + current->doc.resize(0); + current->brief.resize(0); + lastAfterDocContext = SkipCurlyEndDoc; + afterDocTerminator = '}'; + if (yytext[yyleng-3]=='/') + BEGIN(AfterDocLine); + else if (yytext[yyleng-2]=='*' && Config::autoBriefFlag) + BEGIN(AfterDocBrief); + else + BEGIN(AfterDoc); + } + } +<SkipCurlyEndDoc>"}" { + addToBody("}"); + current = tempEntry; + BEGIN( lastCurlyContext ); + } +<SkipCurly>"'"\\[0-7]{1,3}"'" { + addToBody(yytext); + } +<SkipCurly>"'"\\."'" { + addToBody(yytext); + } +<SkipCurly>"'"."'" { + addToBody(yytext); + } <SkipCurly>\" { + addToBody(yytext); lastStringContext=SkipCurly; BEGIN( SkipString ); } -<SkipCurly>^{B}*"#" { BEGIN( SkipCurlyCpp ); } -<SkipCurlyCpp>\n { yyLineNr++; +<SkipCurly>^{B}*"#" { + addToBody(yytext); + BEGIN( SkipCurlyCpp ); + } +<SkipCurly,SkipInits>\n { + yyLineNr++; + addToBody(yytext); + } +<SkipCurly,SkipCurlyCpp>. { + addToBody(yytext); + } +<SkipCurlyCpp>\n { + addToBody(yytext); + yyLineNr++; lastCurlyContext = FindMembers; BEGIN( SkipCurly ); } -<SkipCurlyCpp>\\[\r]*"\n"[\r]* { yyLineNr++; } -<SkipCurlyCpp>"/*" -<SkipCurlyCpp>"*/" -<SkipCurlyCpp>"//" -<SkipString>\\. -<SkipString>\" { BEGIN( lastStringContext ); } -<SkipString>"/*" -<SkipString>"*/" -<SkipString>"//" - +<SkipCurlyCpp>\\[\r]*"\n"[\r]* { + addToBody(yytext); + yyLineNr++; + } +<SkipInits,SkipCurly,SkipCurlyCpp>"/*" { + addToBody(yytext); + } +<SkipInits,SkipCurly,SkipCurlyCpp>"*/" { + addToBody(yytext); + } +<SkipInits,SkipCurly,SkipCurlyCpp>"//".* { + addToBody(yytext); + } +<SkipInits,SkipCurly,SkipCurlyCpp>. { + addToBody(yytext); + } +<SkipString>\\. { + addToBodyCond(yytext); + } +<SkipString>\" { + addToBodyCond(yytext); + BEGIN( lastStringContext ); + } +<SkipString>"/*"|"*/"|"//" { + addToBodyCond(yytext); + } +<SkipString>\n { + yyLineNr++; + addToBodyCond(yytext); + } +<SkipString>. { + addToBodyCond(yytext); + } <Bases,ClassName>";" { current->section = Entry::EMPTY_SEC ; current->type.resize(0) ; @@ -2507,7 +2635,7 @@ VAR [vV][aA][rR] current->argList->clear(); BEGIN( FindMembers ) ; } -<ClassName>{ID} { +<ClassName>{SCOPENAME} { current->name = yytext ; BEGIN( ClassVar ); } @@ -2522,7 +2650,7 @@ VAR [vV][aA][rR] <ClassVar>{ID} { if (isTypedef) { - typedefDict.insert(yytext,new QString(current->name)); + typedefDict.insert(yytext,new QCString(current->name)); current->type.prepend("typedef "); } current->type += ' ' ; @@ -2638,22 +2766,34 @@ VAR [vV][aA][rR] } <FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator>("//"{B}*)?"/**"/[^/*] { removeSlashes=(yytext[1]=='/'); + lastDocContext = YY_START; if (current_root->section & Entry::SCOPE_MASK) current->inside = current_root->name+"::"; - if (YY_START==Curly) + if (!Config::autoBriefFlag) // use the Qt style { tmpDocType=-1; - current->doc+="\n\n"; - lastDocContext = Curly; + if (YY_START==Curly) + current->doc+="\n\n"; + else + current->doc.resize(0); BEGIN( Doc ); } - else - { - tmpDocType=Doc; - current->doc.resize(0); - current->brief.resize(0); - lastDocContext = YY_START; - BEGIN( JavaDoc ); + else // Use the javadoc style + { + if (YY_START==Curly) + { + tmpDocType=-1; + current->doc+="\n\n"; + lastDocContext = Curly; + BEGIN( Doc ); + } + else + { + tmpDocType=Doc; + current->doc.resize(0); + current->brief.resize(0); + BEGIN( JavaDoc ); + } } } <FindMembers,FindFields,MemberSpec,FuncQual,Operator>"//!" { @@ -2679,7 +2819,7 @@ VAR [vV][aA][rR] current->args.resize(0); current->argList->clear(); bracketCount=0; - BEGIN( SkipBlock ); + BEGIN( SkipCurlyBlock ); } <JavaDoc>"@short"{B}+ { @@ -2728,24 +2868,31 @@ VAR [vV][aA][rR] current->startLine = yyLineNr; BEGIN( ClassDocFunc ); } -<LineDoc,Doc,JavaDoc>{B}*("\\"|"@")"def"{B}* { +<Doc,JavaDoc>{B}*("\\"|"@")"def"{B}+ { nextDefContext = YY_START==LineDoc ? DefLineDoc : ClassDoc; current->section = Entry::DEFINEDOC_SEC; current->fileName = yyFileName; current->startLine = yyLineNr; BEGIN( ClassDocDefine ); } -<Doc,JavaDoc>{B}*("\\"|"@")"overload"{B}* { +<LineDoc,Doc,JavaDoc>{B}*("\\"|"@")"overload"{B}* { + overloadContext = YY_START; BEGIN( ClassDocOverload ); } -<ClassDocOverload>{B}*"\n" { - QString orgDoc = current->doc; +<ClassDocOverload>{B}*/"\n" { + QCString orgDoc = current->doc; current->doc = getOverloadDocs(); current->doc += "\n\n"; current->doc += orgDoc; - yyLineNr++; - BEGIN( Doc ); + BEGIN( overloadContext ); } +<ClassDocOverload>{B}*/"*/" { + QCString orgDoc = current->doc; + current->doc = getOverloadDocs(); + current->doc += "\n\n"; + current->doc += orgDoc; + BEGIN( overloadContext ); + } <ClassDocOverload>. { unput(*yytext); current->section = Entry::OVERLOADDOC_SEC; current->fileName = yyFileName; @@ -3104,7 +3251,7 @@ VAR [vV][aA][rR] } <GroupName>{ID} { current->groups->append( - new QString(yytext) + new QCString(yytext) ); } <GroupName>\n { @@ -3177,6 +3324,9 @@ VAR [vV][aA][rR] current->section = Entry::VARIABLEDOC_SEC; newDocState(); } +<ClassDocFunc>"operator"{B}*"("{B}*")" { + current->name+=yytext; + } <ClassDocFunc>"(" { current->args+=*yytext; currentArgumentContext = ClassDocFuncQual; @@ -3194,6 +3344,9 @@ VAR [vV][aA][rR] current->name+=')'; BEGIN( ClassDocFunc ); } +<ClassDocFuncQual>"{" { + BEGIN( ClassDocFuncSkipLine); + } <ClassDocFuncQual>{B}*"const"{B}* { current->args += " const "; current->argList->constSpecifier=TRUE; @@ -3221,7 +3374,7 @@ VAR [vV][aA][rR] <ClassDocFunc,ClassDocFuncQual>. { current->name += *yytext; } -<ClassDocFuncQual>"\n" { +<ClassDocFuncQual,ClassDocFuncSkipLine>"\n" { yyLineNr++; current->name = current->name.stripWhiteSpace(); newDocState(); @@ -3229,6 +3382,7 @@ VAR [vV][aA][rR] <Doc>. { current->doc += *yytext; } <DefLineDoc,LineDoc>. { current->brief += *yytext; } <Doc>\n { yyLineNr++; current->doc += *yytext; } +<LineDoc>[\n\r]{B}*"//"[!/] <LineDoc>\n { yyLineNr++; BEGIN( lastDocContext ); @@ -3306,6 +3460,20 @@ VAR [vV][aA][rR] //---------------------------------------------------------------------------- +static void addToBody(const char *text) +{ + if (Config::includeSourceFlag) + previous->body+=text; +} + +static void addToBodyCond(const char *text) +{ + if (Config::includeSourceFlag && lastStringContext==SkipCurly) + previous->body+=text; +} + +//---------------------------------------------------------------------------- + void scanString(const char *s) { const char *oldInputString = inputString; @@ -3414,7 +3582,7 @@ void parseMain(Entry *rt) //---------------------------------------------------------------------------- -void parseDocument(OutputList &ol,const QString &docString) +void parseDocument(OutputList &ol,const QCString &docString) { //inParamBlock=inSeeBlock=inReturnBlock=FALSE; curTable = 0; @@ -3441,7 +3609,7 @@ void parseDocument(OutputList &ol,const QString &docString) //---------------------------------------------------------------------------- void parseDoc(OutputList &ol,const char *clName, - const char *memName,const QString &docString) + const char *memName,const QCString &docString) { initParser(); initParseCodeContext(); @@ -3461,7 +3629,7 @@ void parseDoc(OutputList &ol,const char *clName, //---------------------------------------------------------------------------- -void parseText(OutputList &ol,const QString &txtString) +void parseText(OutputList &ol,const QCString &txtString) { inputString = txtString; outDoc = new OutputList(&ol); @@ -3476,7 +3644,7 @@ void parseText(OutputList &ol,const QString &txtString) //---------------------------------------------------------------------------- -void parseExample(OutputList &ol,const QString &docString, +void parseExample(OutputList &ol,const QCString &docString, const char *fileName) { initParser(); @@ -3487,9 +3655,3 @@ void parseExample(OutputList &ol,const QString &docString, } //---------------------------------------------------------------------------- - -extern "C" { // some sillyness to keep the compiler happy -int scanYYwrap() { return 1 ; } -void bogus() { yy_flex_realloc(0,0); } -} - diff --git a/src/searchindex.cpp b/src/searchindex.cpp index 241d0a8..50d6556 100644 --- a/src/searchindex.cpp +++ b/src/searchindex.cpp @@ -14,6 +14,7 @@ * */ +#include "qtbc.h" #include "searchindex.h" #include "suffixtree.h" @@ -44,7 +45,7 @@ bool SearchIndex::addWord(const char *key,const char *word,bool special) DocRef *dr=0; if (word && key && strlen(key)>0 && (dr=refDict[key])) { - suffixTree->insertWord(((QString)word).lower(),dr->index(),special); + suffixTree->insertWord(((QCString)word).lower(),dr->index(),special); return TRUE; } else if (word) diff --git a/src/searchindex.h b/src/searchindex.h index 64071fb..f51afa6 100644 --- a/src/searchindex.h +++ b/src/searchindex.h @@ -17,8 +17,8 @@ #ifndef _SEARCHINDEX_H #define _SEARCHINDEX_H +#include "qtbc.h" #include <qintdict.h> -#include <qstring.h> #include <qlist.h> #include <qdict.h> @@ -40,8 +40,8 @@ class DocRef int offset() const { return o; } private: - QString n; - QString u; + QCString n; + QCString u; int i; int o; }; diff --git a/src/section.h b/src/section.h index fc287ae..aa9a674 100644 --- a/src/section.h +++ b/src/section.h @@ -18,9 +18,9 @@ #ifndef SECTION_H #define SECTION_H +#include "qtbc.h" #include <qlist.h> #include <qdict.h> -#include <qstring.h> class Definition; @@ -29,11 +29,11 @@ struct SectionInfo enum SectionType { Section, Subsection, Anchor }; SectionInfo(const char *l,const char *t,SectionType st) { label=l; title=t; type=st; definition=0; } - QString fileName; - QString label; - QString title; + QCString label; + QCString title; SectionType type; Definition *definition; + QCString fileName; }; class SectionList : public QList<SectionInfo> diff --git a/src/suffixtree.cpp b/src/suffixtree.cpp index 604531f..8b8ce88 100644 --- a/src/suffixtree.cpp +++ b/src/suffixtree.cpp @@ -15,6 +15,8 @@ */ #include <stdio.h> + +#include "qtbc.h" #include "suffixtree.h" #define MAXWORDLEN 1024 @@ -112,7 +114,7 @@ int SuffixNode::insert(const char *word,int refId,int inName,int fullWord) SuffixNode *sn=children->first(); while (sn) { - char *lab=sn->label.data(); + const char *lab=sn->label.data(); char w=word[0],l=lab[0],i=0; while (w!=0 && l!=0 && w==l) { i++; w=word[i]; l=lab[i]; } if (w==0 && l==0) // match found @@ -320,7 +322,7 @@ SuffixTree::~SuffixTree() void SuffixTree::insertWord(const char *word,int index,bool inName) { - QString suffix=word; + QCString suffix=word; uint i; for (i=2;i<suffix.length()-1;i++) { diff --git a/src/suffixtree.h b/src/suffixtree.h index 381253c..a93d45e 100644 --- a/src/suffixtree.h +++ b/src/suffixtree.h @@ -17,9 +17,9 @@ #ifndef SUFFIXTREE_H #define SUFFIXTREE_H +#include "qtbc.h" #include <qlist.h> #include <qarray.h> -#include <qstring.h> #include <qfile.h> class SuffixNodeList; @@ -56,7 +56,7 @@ class SuffixNode private: SuffixNodeList *children; QArray<WordRef> references; - QString label; + QCString label; int branchOffset; int totalFreq; }; @@ -20,7 +20,8 @@ * includes */ #include <stdio.h> -#include <qstring.h> + +#include "qtbc.h" #include <qfileinf.h> #include "classdef.h" @@ -30,18 +31,19 @@ #include "doxygen.h" #include "util.h" #include "message.h" +#include "defargs.h" #define YY_NO_UNPUT #define YY_NEVER_INTERACTIVE 1 static int yyLineNr; -static QString className; -static QString fileName; -static QString namespaceName; -static QString tagName; -static QString memberName; -static QString anchorName; -static QString argString; +static QCString className; +static QCString fileName; +static QCString namespaceName; +static QCString tagName; +static QCString memberName; +static QCString anchorName; +static QCString argString; static ClassDef *cd; static FileDef *fd; static NamespaceDef *nd; @@ -105,8 +107,11 @@ static void addMember(const char *name,const char *anchor,const char *args) MemberNameDict *mnd=0; MemberNameList *mnl=0; MemberDef *md; + ArgumentList *argList = new ArgumentList; + stringToArgumentList(args,argList); md=new MemberDef(0,name,args,0,Public,Normal,FALSE,FALSE, - MemberDef::Function,0,0); + MemberDef::Function,0,argList); + delete argList; md->setReference(anchor); if (cd) // member of a class { @@ -129,7 +134,7 @@ static void addMember(const char *name,const char *anchor,const char *args) mnd=&functionNameDict; mnl=&functionNameList; } - MemberName *mn; + MemberName *mn = 0; if ((mn=(*mnd)[memberName])) { //printf("mn->inSort()\n"); @@ -156,6 +161,8 @@ ID [a-z_A-Z][a-z_A-Z0-9]* FILE [a-z_A-Z0-9\.\-\+\:\\\/]+ SCOPE ({ID}"::")*{ID} +%option noyywrap + %x Pass1 %x Pass2 %x AnchorName @@ -272,6 +279,6 @@ void parseTagFile(const char *fileName) fclose(f); } -extern "C" { // some bogus code to keep the compiler happy - int tagYYwrap() { return 1 ; } -} +//extern "C" { // some bogus code to keep the compiler happy +// int tagYYwrap() { return 1 ; } +//} diff --git a/src/translator.h b/src/translator.h index 6f69c9b..d5c4f67 100644 --- a/src/translator.h +++ b/src/translator.h @@ -17,7 +17,7 @@ #ifndef TRANSLATOR_H #define TRANSLATOR_H -#include <qstring.h> +#include "qtbc.h" #include "classdef.h" #include "util.h" @@ -28,166 +28,164 @@ class Translator // NOTICE: // the following functions are now obsolete: these are no longer used and // will disappear in future versions. You do not have to translate them! - virtual QString trInherits() + virtual QCString trInherits() { return "Inherits"; } - virtual QString trAnd() + virtual QCString trAnd() { return "and"; } - virtual QString trInheritedBy() + virtual QCString trInheritedBy() { return "Inherited By"; } - virtual QString trReference() + virtual QCString trReference() { return "Reference"; } - virtual QString trReimplementedFrom() + virtual QCString trReimplementedFrom() { return "Reimplemented from"; } - virtual QString trReimplementedIn() + virtual QCString trReimplementedIn() { return "Reimplemented in"; } - virtual QString trIncludeFile() + virtual QCString trIncludeFile() { return "Include File"; } - virtual QString trNamespaces() - { return "Namespace List"; } // end of obsolete functions //-------------------------------------------------------------------- - virtual QString latexBabelPackage() + virtual QCString latexBabelPackage() // returns the name of the package that is included by LaTeX { return ""; } - virtual QString trRelatedFunctions() + virtual QCString trRelatedFunctions() // used in the compound documentation before a list of related functions. { return "Related Functions"; } - virtual QString trRelatedSubscript() + virtual QCString trRelatedSubscript() // subscript for the related functions. { return "(Note that these are not member functions.)"; } - virtual QString trDetailedDescription() + virtual QCString trDetailedDescription() // header that is put before the detailed description of files, classes and namespaces. { return "Detailed Description"; } - virtual QString trMemberTypedefDocumentation() + virtual QCString trMemberTypedefDocumentation() // header that is put before the list of typedefs. { return "Member Typedef Documentation"; } - virtual QString trMemberEnumerationDocumentation() + virtual QCString trMemberEnumerationDocumentation() // header that is put before the list of enumerations. { return "Member Enumeration Documentation"; } - virtual QString trMemberFunctionDocumentation() + virtual QCString trMemberFunctionDocumentation() // header that is put before the list of member functions. { return "Member Function Documentation"; } - virtual QString trMemberDataDocumentation() + virtual QCString trMemberDataDocumentation() // header that is put before the list of member attributes. { return "Member Data Documentation"; } - virtual QString trGeneratedFrom(const char *s,bool single) + virtual QCString trGeneratedFrom(const char *s,bool single) { // here s is one of " Class", " Struct" or " Union" // single is true implies a single file - QString result=(QString)"The documentation for this"+s+ + QCString result=(QCString)"The documentation for this"+s+ " was generated from the following file"; if (single) result+=":"; else result+="s:"; return result; } - virtual QString trMore() + virtual QCString trMore() // this is the text of a link put after brief descriptions. { return "More..."; } - virtual QString trListOfAllMembers() + virtual QCString trListOfAllMembers() // put in the class documentation { return "List of all members."; } - virtual QString trMemberList() + virtual QCString trMemberList() // used as the title of the "list of all members" page of a class { return "Member List"; } - virtual QString trThisIsTheListOfAllMembers() + virtual QCString trThisIsTheListOfAllMembers() // this is the first part of a sentence that is followed by a class name { return "This is the complete list of members for "; } - virtual QString trIncludingInheritedMembers() + virtual QCString trIncludingInheritedMembers() // this is the remainder of the sentence after the class name { return ", including all inherited members."; } - virtual QString trGeneratedAutomatically(const char *s) + virtual QCString trGeneratedAutomatically(const char *s) // this is put at the author sections at the bottom of man pages. // parameter s is name of the project name. - { QString result="Generated automatically by Doxygen"; - if (s) result+=(QString)" for "+s; + { QCString result="Generated automatically by Doxygen"; + if (s) result+=(QCString)" for "+s; result+=" from the source code."; return result; } - virtual QString trEnumName() + virtual QCString trEnumName() // put after an enum name in the list of all members { return "enum name"; } - virtual QString trEnumValue() + virtual QCString trEnumValue() // put after an enum value in the list of all members { return "enum value"; } - virtual QString trDefinedIn() + virtual QCString trDefinedIn() // put after an undocumented member in the list of all members { return "defined in"; } - virtual QString trVerbatimText(const char *f) + virtual QCString trVerbatimText(const char *f) // put as in introduction in the verbatim header file of a class. // parameter f is the name of the include file. - { return (QString)"This is the verbatim text of the "+f+" include file."; } + { return (QCString)"This is the verbatim text of the "+f+" include file."; } // quick reference sections - virtual QString trModules() + virtual QCString trModules() // This is put above each page as a link to the list of all groups of // compounds or files (see the \group command). { return "Modules"; } - virtual QString trClassHierarchy() + virtual QCString trClassHierarchy() // This is put above each page as a link to the class hierarchy { return "Class Hierarchy"; } - virtual QString trCompoundList() + virtual QCString trCompoundList() // This is put above each page as a link to the list of annotated classes { return "Compound List"; } - virtual QString trFileList() + virtual QCString trFileList() // This is put above each page as a link to the list of documented files { return "File List"; } - virtual QString trHeaderFiles() + virtual QCString trHeaderFiles() // This is put above each page as a link to the list of all verbatim headers { return "Header Files"; } - virtual QString trCompoundMembers() + virtual QCString trCompoundMembers() // This is put above each page as a link to all members of compounds. { return "Compound Members"; } - virtual QString trFileMembers() + virtual QCString trFileMembers() // This is put above each page as a link to all members of files. { return "File Members"; } - virtual QString trRelatedPages() + virtual QCString trRelatedPages() // This is put above each page as a link to all related pages. { return "Related Pages"; } - virtual QString trExamples() + virtual QCString trExamples() // This is put above each page as a link to all examples. { return "Examples"; } - virtual QString trSearch() + virtual QCString trSearch() // This is put above each page as a link to the search engine. { return "Search"; } - virtual QString trClassHierarchyDescription() + virtual QCString trClassHierarchyDescription() // This is an introduction to the class hierarchy. { return "This inheritance list is sorted roughly, " "but not completely, alphabetically:"; } - virtual QString trFileListDescription(bool extractAll) + virtual QCString trFileListDescription(bool extractAll) // This is an introduction to the list with all files. { - QString result="Here is a list of all "; + QCString result="Here is a list of all "; if (!extractAll) result+="documented "; result+="files with brief descriptions:"; return result; } - virtual QString trCompoundListDescription() + virtual QCString trCompoundListDescription() // This is an introduction to the annotated compound list { return "Here are the classes, structs and " "unions with brief descriptions:"; } - virtual QString trCompoundMembersDescription(bool extractAll) + virtual QCString trCompoundMembersDescription(bool extractAll) // This is an introduction to the page with all class members { - QString result="Here is a list of all "; + QCString result="Here is a list of all "; if (!extractAll) result+="documented "; result+="class members with links to "; if (extractAll) @@ -196,10 +194,10 @@ class Translator result+="the classes they belong to:"; return result; } - virtual QString trFileMembersDescription(bool extractAll) + virtual QCString trFileMembersDescription(bool extractAll) // This is an introduction to the page with all file members { - QString result="Here is a list of all "; + QCString result="Here is a list of all "; if (!extractAll) result+="documented "; result+="file members with links to "; if (extractAll) @@ -208,207 +206,207 @@ class Translator result+="the files they belong to:"; return result; } - virtual QString trHeaderFilesDescription() + virtual QCString trHeaderFilesDescription() // This is an introduction to the page with the list of all header files { return "Here are the header files that make up the API:"; } - virtual QString trExamplesDescription() + virtual QCString trExamplesDescription() // This is an introduction to the page with the list of all examples { return "Here is a list of all examples:"; } - virtual QString trRelatedPagesDescription() + virtual QCString trRelatedPagesDescription() // This is an introduction to the page with the list of related pages { return "Here is a list of all related documentation pages:"; } - virtual QString trModulesDescription() + virtual QCString trModulesDescription() // This is an introduction to the page with the list of class/file groups { return "Here is a list of all modules:"; } - virtual QString trNoDescriptionAvailable() + virtual QCString trNoDescriptionAvailable() // This sentences is used in the annotated class/file lists if no brief // description is given. { return "No description available"; } // index titles (the project name is prepended for these) - virtual QString trDocumentation() + virtual QCString trDocumentation() // This is used in HTML as the title of index.html. { return "Documentation"; } - virtual QString trModuleIndex() + virtual QCString trModuleIndex() // This is used in LaTeX as the title of the chapter with the // index of all groups. { return "Module Index"; } - virtual QString trHierarchicalIndex() + virtual QCString trHierarchicalIndex() // This is used in LaTeX as the title of the chapter with the // class hierarchy. { return "Hierarchical Index"; } - virtual QString trCompoundIndex() + virtual QCString trCompoundIndex() // This is used in LaTeX as the title of the chapter with the // annotated compound index { return "Compound Index"; } - virtual QString trFileIndex() + virtual QCString trFileIndex() // This is used in LaTeX as the title of the chapter with the // list of all files. { return "File Index"; } - virtual QString trModuleDocumentation() + virtual QCString trModuleDocumentation() // This is used in LaTeX as the title of the chapter containing // the documentation of all groups. { return "Module Documentation"; } - virtual QString trClassDocumentation() + virtual QCString trClassDocumentation() // This is used in LaTeX as the title of the chapter containing // the documentation of all classes, structs and unions. { return "Class Documentation"; } - virtual QString trFileDocumentation() + virtual QCString trFileDocumentation() // This is used in LaTeX as the title of the chapter containing // the documentation of all files. { return "File Documentation"; } - virtual QString trExampleDocumentation() + virtual QCString trExampleDocumentation() // This is used in LaTeX as the title of the chapter containing // the documentation of all examples. { return "Example Documentation"; } - virtual QString trPageDocumentation() + virtual QCString trPageDocumentation() // This is used in LaTeX as the title of the chapter containing // the documentation of all related pages. { return "Page Documentation"; } - virtual QString trReferenceManual() + virtual QCString trReferenceManual() // This is used in LaTeX as the title of the document { return "Reference Manual"; } - virtual QString trDefines() + virtual QCString trDefines() // This is used in the documentation of a file as a header before the // list of defines { return "Defines"; } - virtual QString trFuncProtos() + virtual QCString trFuncProtos() // This is used in the documentation of a file as a header before the // list of function prototypes { return "Function Prototypes"; } - virtual QString trTypedefs() + virtual QCString trTypedefs() // This is used in the documentation of a file as a header before the // list of typedefs { return "Typedefs"; } - virtual QString trEnumerations() + virtual QCString trEnumerations() // This is used in the documentation of a file as a header before the // list of enumerations { return "Enumerations"; } - virtual QString trFunctions() + virtual QCString trFunctions() // This is used in the documentation of a file as a header before the // list of (global) functions { return "Functions"; } - virtual QString trVariables() + virtual QCString trVariables() // This is used in the documentation of a file as a header before the // list of (global) variables { return "Variables"; } - virtual QString trEnumerationValues() + virtual QCString trEnumerationValues() // This is used in the documentation of a file as a header before the // list of (global) variables { return "Enumeration values"; } - virtual QString trAuthor() + virtual QCString trAuthor() // This is used in man pages as the author section. { return "Author"; } - virtual QString trDefineDocumentation() + virtual QCString trDefineDocumentation() // This is used in the documentation of a file before the list of // documentation blocks for defines { return "Define Documentation"; } - virtual QString trFunctionPrototypeDocumentation() + virtual QCString trFunctionPrototypeDocumentation() // This is used in the documentation of a file/namespace before the list // of documentation blocks for function prototypes { return "Function Prototype Documentation"; } - virtual QString trTypedefDocumentation() + virtual QCString trTypedefDocumentation() // This is used in the documentation of a file/namespace before the list // of documentation blocks for typedefs { return "Typedef Documentation"; } - virtual QString trEnumerationTypeDocumentation() + virtual QCString trEnumerationTypeDocumentation() // This is used in the documentation of a file/namespace before the list // of documentation blocks for enumeration types { return "Enumeration Type Documentation"; } - virtual QString trEnumerationValueDocumentation() + virtual QCString trEnumerationValueDocumentation() // This is used in the documentation of a file/namespace before the list // of documentation blocks for enumeration values { return "Enumeration Value Documentation"; } - virtual QString trFunctionDocumentation() + virtual QCString trFunctionDocumentation() // This is used in the documentation of a file/namespace before the list // of documentation blocks for functions { return "Function Documentation"; } - virtual QString trVariableDocumentation() + virtual QCString trVariableDocumentation() // This is used in the documentation of a file/namespace before the list // of documentation blocks for variables { return "Variable Documentation"; } - virtual QString trCompounds() + virtual QCString trCompounds() // This is used in the documentation of a file/namespace/group before // the list of links to documented compounds { return "Compounds"; } - virtual QString trFiles() + virtual QCString trFiles() // This is used in the documentation of a group before the list of // links to documented files { return "Files"; } - virtual QString trGeneratedAt(const char *date,const char *projName) + virtual QCString trGeneratedAt(const char *date,const char *projName) { - QString result=(QString)"Generated at "+date; - if (projName) result+=(QString)" for "+projName; - result+=(QString)" by"; + QCString result=(QCString)"Generated at "+date; + if (projName) result+=(QCString)" for "+projName; + result+=(QCString)" by"; return result; } - virtual QString trWrittenBy() + virtual QCString trWrittenBy() { return "written by"; } - virtual QString trClassDiagram(const char *clName) + virtual QCString trClassDiagram(const char *clName) // this text is put before a class diagram { - return (QString)"Class diagram for "+clName; + return (QCString)"Class diagram for "+clName; } - virtual QString trForInternalUseOnly() + virtual QCString trForInternalUseOnly() // this text is generated when the \internal command is used. { return "For internal use only."; } - virtual QString trReimplementedForInternalReasons() + virtual QCString trReimplementedForInternalReasons() // this text is generated when the \reimp command is used. { return "Reimplemented for internal reasons; the API is not affected."; } - virtual QString trWarning() + virtual QCString trWarning() // this text is generated when the \warning command is used. { return "Warning"; } - virtual QString trBugsAndLimitations() + virtual QCString trBugsAndLimitations() // this text is generated when the \bug command is used. { return "Bugs and limitations"; } - virtual QString trVersion() + virtual QCString trVersion() // this text is generated when the \version command is used. { return "Version"; } - virtual QString trDate() + virtual QCString trDate() // this text is generated when the \date command is used. { return "Date"; } - virtual QString trAuthors() + virtual QCString trAuthors() // this text is generated when the \author command is used. { return "Author(s)"; } - virtual QString trReturns() + virtual QCString trReturns() // this text is generated when the \return command is used. { return "Returns"; } - virtual QString trSeeAlso() + virtual QCString trSeeAlso() // this text is generated when the \sa command is used. { return "See also"; } - virtual QString trParameters() + virtual QCString trParameters() // this text is generated when the \param command is used. { return "Parameters"; } - virtual QString trExceptions() + virtual QCString trExceptions() // this text is generated when the \exception command is used. { return "Exceptions"; } - virtual QString trGeneratedBy() + virtual QCString trGeneratedBy() // this text is used in the title page of a LaTeX document. { return "Generated by"; } // new since 0.49-990307 - virtual QString trNamespaceList() + virtual QCString trNamespaceList() // used as the title of page containing all the index of all namespaces. { return "Namespace List"; } - virtual QString trNamespaceListDescription(bool extractAll) + virtual QCString trNamespaceListDescription(bool extractAll) // used as an introduction to the namespace list { - QString result="Here is a list of all "; + QCString result="Here is a list of all "; if (!extractAll) result+="documented "; result+="namespaces with brief descriptions:"; return result; } - virtual QString trFriends() + virtual QCString trFriends() // used in the class documentation as a header before the list of all // friends of a class { return "Friends"; } @@ -417,7 +415,7 @@ class Translator // new since 0.49-990405 ////////////////////////////////////////////////////////////////////////// - virtual QString trRelatedFunctionDocumentation() + virtual QCString trRelatedFunctionDocumentation() // used in the class documentation as a header before the list of all // related classes { return "Friends And Related Function Documentation"; } @@ -426,11 +424,11 @@ class Translator // new since 0.49-990425 ////////////////////////////////////////////////////////////////////////// - virtual QString trCompoundReference(const char *clName, + virtual QCString trCompoundReference(const char *clName, ClassDef::CompoundType compType) // used as the title of the HTML page of a class/struct/union { - QString result=(QString)clName+" "; + QCString result=(QCString)clName+" "; switch(compType) { case ClassDef::Class: result+=" Class"; break; @@ -440,49 +438,49 @@ class Translator result+=" Reference"; return result; } - virtual QString trFileReference(const char *fileName) + virtual QCString trFileReference(const char *fileName) // used as the title of the HTML page of a file { - QString result=fileName; + QCString result=fileName; result+=" File Reference"; return result; } - virtual QString trNamespaceReference(const char *namespaceName) + virtual QCString trNamespaceReference(const char *namespaceName) // used as the title of the HTML page of a namespace { - QString result=namespaceName; + QCString result=namespaceName; result+=" Namespace Reference"; return result; } // these are for the member sections of a class, struct or union - virtual QString trPublicMembers() + virtual QCString trPublicMembers() { return "Public Members"; } - virtual QString trPublicSlots() + virtual QCString trPublicSlots() { return "Public Slots"; } - virtual QString trSignals() + virtual QCString trSignals() { return "Signals"; } - virtual QString trStaticPublicMembers() + virtual QCString trStaticPublicMembers() { return "Static Public Members"; } - virtual QString trProtectedMembers() + virtual QCString trProtectedMembers() { return "Protected Members"; } - virtual QString trProtectedSlots() + virtual QCString trProtectedSlots() { return "Protected Slots"; } - virtual QString trStaticProtectedMembers() + virtual QCString trStaticProtectedMembers() { return "Static Protected Members"; } - virtual QString trPrivateMembers() + virtual QCString trPrivateMembers() { return "Private Members"; } - virtual QString trPrivateSlots() + virtual QCString trPrivateSlots() { return "Private Slots"; } - virtual QString trStaticPrivateMembers() + virtual QCString trStaticPrivateMembers() { return "Static Private Members"; } // end of member sections - virtual QString trWriteList(int numEntries) + virtual QCString trWriteList(int numEntries) { // this function is used to produce a comma-separated list of items. // use generateMarker(i) to indicate where item i should be put. - QString result; + QCString result; int i; // the inherits list contain `numEntries' classes for (i=0;i<numEntries;i++) @@ -502,38 +500,38 @@ class Translator return result; } - virtual QString trInheritsList(int numEntries) + virtual QCString trInheritsList(int numEntries) // used in class documentation to produce a list of base classes, // if class diagrams are disabled. { return "Inherits "+trWriteList(numEntries)+"."; } - virtual QString trInheritedByList(int numEntries) + virtual QCString trInheritedByList(int numEntries) // used in class documentation to produce a list of super classes, // if class diagrams are disabled. { return "Inherited by "+trWriteList(numEntries)+"."; } - virtual QString trReimplementedFromList(int numEntries) + virtual QCString trReimplementedFromList(int numEntries) // used in member documentation blocks to produce a list of // members that are hidden by this one. { return "Reimplemented from "+trWriteList(numEntries)+"."; } - virtual QString trReimplementedInList(int numEntries) + virtual QCString trReimplementedInList(int numEntries) { // used in member documentation blocks to produce a list of // all member that overwrite the implementation of this member. return "Reimplemented in "+trWriteList(numEntries)+"."; } - virtual QString trNamespaceMembers() + virtual QCString trNamespaceMembers() // This is put above each page as a link to all members of namespaces. { return "Namespace Members"; } - virtual QString trNamespaceMemberDescription(bool extractAll) + virtual QCString trNamespaceMemberDescription(bool extractAll) // This is an introduction to the page with all namespace members { - QString result="Here is a list of all "; + QCString result="Here is a list of all "; if (!extractAll) result+="documented "; result+="namespace members with links to "; if (extractAll) @@ -542,14 +540,23 @@ class Translator result+="the namespaces they belong to:"; return result; } - virtual QString trNamespaceIndex() + virtual QCString trNamespaceIndex() // This is used in LaTeX as the title of the chapter with the // index of all namespaces. { return "Namespace Index"; } - virtual QString trNamespaceDocumentation() + virtual QCString trNamespaceDocumentation() // This is used in LaTeX as the title of the chapter containing // the documentation of all namespaces. { return "Namespace Documentation"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990522 +////////////////////////////////////////////////////////////////////////// + + // This is used in the documentation before the list of all + // namespaces in a file. + virtual QCString trNamespaces() + { return "Namespaces"; } }; #endif diff --git a/src/translator_cz.h b/src/translator_cz.h index 9a0656e..a867de8 100644 --- a/src/translator_cz.h +++ b/src/translator_cz.h @@ -17,7 +17,7 @@ #ifndef TRANSLATOR_CZ_H #define TRANSLATOR_CZ_H -#include <qstring.h> +#include "translator.h" // The translation from English to Czech by Vlastimil Havran. // In the cases where are more translations possible I hope @@ -29,247 +29,247 @@ class TranslatorCzech : public Translator { public: - QString latexBabelPackage() + QCString latexBabelPackage() { return "czech"; } - QString trInherits() + QCString trInherits() { return "Dedi"; } - QString trAnd() + QCString trAnd() { return "a"; } - QString trInheritedBy() + QCString trInheritedBy() { return "Je Potomkem"; } - QString trRelatedFunctions() + QCString trRelatedFunctions() { return "Pribuzne Metody"; } - QString trRelatedSubscript() + QCString trRelatedSubscript() { return "(Tyto funkce nejsou metody.)"; } - QString trDetailedDescription() + QCString trDetailedDescription() { return "Podrobna Dokumentace"; } - QString trMemberTypedefDocumentation() + QCString trMemberTypedefDocumentation() { return "Dokumentace pro Deklaraci Typu (typedef) ve Tride";} - QString trMemberEnumerationDocumentation() + QCString trMemberEnumerationDocumentation() { return "Dokumentace Vyctovych Typu"; } - QString trEnumerationValueDocumentation() + QCString trEnumerationValueDocumentation() { return "Dokumentace Hodnot Vyctovych Typu"; } - QString trMemberFunctionDocumentation() + QCString trMemberFunctionDocumentation() { return "Dokumentace Metod"; } - QString trMemberDataDocumentation() + QCString trMemberDataDocumentation() { return "Dokumentace Datovych Slozek Tridy"; } - QString trGeneratedFrom(const char *s,bool single) + QCString trGeneratedFrom(const char *s,bool single) { - QString result=(QString)"Dokumentace pro tento"+s+ + QCString result=(QCString)"Dokumentace pro tento"+s+ " byla generovana z nasledujiciho souboru"; if (single) result+=":"; else result+="s:"; return result; } - QString trMore() + QCString trMore() { return "Detaily"; } - QString trReference() + QCString trReference() { return "Reference"; } - QString trListOfAllMembers() + QCString trListOfAllMembers() { return "Seznam vsech datovych slozek a metod tridy."; } - QString trMemberList() + QCString trMemberList() { return "Seznam datovych polozek a metod tridy"; } - QString trThisIsTheListOfAllMembers() + QCString trThisIsTheListOfAllMembers() { return "Toto je uplny seznam datovych slozek a metod tridy pro"; } - QString trIncludingInheritedMembers() + QCString trIncludingInheritedMembers() { return "zahrnuje vsechny nasledujici zdedene datove slozky a metody."; } - QString trGeneratedAutomatically(const char *s) - { QString result="Automaticky vygenerovany pomoci programu Doxygen"; - if (s) result+=(QString)" pro "+s; + QCString trGeneratedAutomatically(const char *s) + { QCString result="Automaticky vygenerovany pomoci programu Doxygen"; + if (s) result+=(QCString)" pro "+s; result+=" ze zdrojoveho souboru."; return result; } - QString trEnumName() + QCString trEnumName() { return "pojmenovani vyctoveho typu"; } - QString trEnumValue() + QCString trEnumValue() { return "hodnota vyctoveho typu"; } - QString trDefinedIn() + QCString trDefinedIn() { return "definovany v"; } - QString trIncludeFile() + QCString trIncludeFile() { return "Vklada soubor"; } - QString trVerbatimText(const char *f) - { return (QString)"Toto je presny text z vlozeneho souboru "+f+""; } - QString trModules() + QCString trVerbatimText(const char *f) + { return (QCString)"Toto je presny text z vlozeneho souboru "+f+""; } + QCString trModules() { return "Moduly"; } - QString trClassHierarchy() + QCString trClassHierarchy() { return "Hierarchie trid"; } - QString trCompoundList() + QCString trCompoundList() { return "Seznam objektovych typu"; } - QString trFileList() + QCString trFileList() { return "Seznam souboru"; } - QString trHeaderFiles() + QCString trHeaderFiles() { return "Hlavickove soubory"; } - QString trCompoundMembers() + QCString trCompoundMembers() { return "Datove slozky a metody objektovych typu"; } - QString trFileMembers() + QCString trFileMembers() { return "Globalni deklarace"; } - QString trRelatedPages() + QCString trRelatedPages() { return "Souvisejici stranky"; } - QString trExamples() + QCString trExamples() { return "Priklady:"; } - QString trSearch() + QCString trSearch() { return "Hledej"; } - QString trClassHierarchyDescription() + QCString trClassHierarchyDescription() { return "Tento seznam dedicnych zavislosti je temer setriden" " podle abecedy:"; } - QString trFileListDescription(bool extractAll) + QCString trFileListDescription(bool extractAll) { - QString result="A toto je seznam vsech "; + QCString result="A toto je seznam vsech "; if (!extractAll) result+="dokumentovanych "; result+="souboru s kratkymi popisy:"; return result; } - QString trCompoundListDescription() + QCString trCompoundListDescription() { return "Zde jsou tridy, struktury a " "unie s kratkymi popisy:"; } - QString trCompoundMembersDescription(bool extractAll) + QCString trCompoundMembersDescription(bool extractAll) { - QString result="Zde je seznam vsech "; + QCString result="Zde je seznam vsech "; if (!extractAll) result+="dokumentovanych "; result+="clenu tridy (metod a datovych slozek) s odkazy na "; if (extractAll) result+="dokumentaci tridy pro kazdo polozku:"; else result+="tridy, kam patri:"; return result; } - QString trFileMembersDescription(bool extractAll) + QCString trFileMembersDescription(bool extractAll) { - QString result="Zde je seznam vsech "; + QCString result="Zde je seznam vsech "; if (!extractAll) result+="zdokumentovanych "; result+="globalnich deklaraci s odkazy "; if (extractAll) result+="na dokumentaci k souboru pro kazdou deklaraci:"; else result+="na soubory, kde jsou umisteny:"; return result; } - QString trHeaderFilesDescription() + QCString trHeaderFilesDescription() {return "Zde jsou hlavickove soubory ktere tvori programove" " rozhrani aplikace(API):"; } - QString trExamplesDescription() + QCString trExamplesDescription() { return "Zde je seznam vsech prikladu:"; } - QString trRelatedPagesDescription() + QCString trRelatedPagesDescription() { return "Zde je seznam vsech souvisejicich stranek dokumentace:"; } - QString trModulesDescription() + QCString trModulesDescription() { return "Zde je seznam vsech modulu:"; } - QString trNoDescriptionAvailable() + QCString trNoDescriptionAvailable() { return "Zadny popis neni k dispozici."; } - QString trDocumentation() + QCString trDocumentation() { return "Dokumentace"; } - QString trModuleIndex() + QCString trModuleIndex() { return "Index modulu"; } - QString trHierarchicalIndex() + QCString trHierarchicalIndex() { return "Index Hierarchie"; } - QString trCompoundIndex() + QCString trCompoundIndex() { return "Index objektovych typu"; } - QString trFileIndex() + QCString trFileIndex() { return "Index souboru"; } - QString trModuleDocumentation() + QCString trModuleDocumentation() { return "Dokumentace modulu"; } - QString trClassDocumentation() + QCString trClassDocumentation() { return "Dokumentace tridy"; } - QString trFileDocumentation() + QCString trFileDocumentation() { return "Dokumentace souboru"; } - QString trExampleDocumentation() + QCString trExampleDocumentation() { return "Dokumentace prikladu"; } - QString trPageDocumentation() + QCString trPageDocumentation() { return "Dokumentace stranek"; } - QString trReferenceManual() + QCString trReferenceManual() { return "Referencni manual"; } - QString trDefines() + QCString trDefines() { return "Definice"; } - QString trFuncProtos() + QCString trFuncProtos() { return "Prototypy funkci"; } - QString trTypedefs() + QCString trTypedefs() { return "Deklarace datovych typu(typedefs)"; } - QString trEnumerations() + QCString trEnumerations() { return "Vyctove typy (enumerations)"; } - QString trFunctions() + QCString trFunctions() { return "Funkce"; } - QString trVariables() + QCString trVariables() { return "Promenne"; } - QString trEnumerationValues() + QCString trEnumerationValues() { return "Hodnoty vyctovych typu"; } - QString trReimplementedFrom() + QCString trReimplementedFrom() { return "Je znovu implementovan z"; } - QString trReimplementedIn() + QCString trReimplementedIn() { return "Je znovu implementovan v"; } - QString trAuthor() + QCString trAuthor() { return "Autor"; } - QString trDefineDocumentation() + QCString trDefineDocumentation() { return "Dokumentace definic pomoci maker"; } - QString trFunctionPrototypeDocumentation() + QCString trFunctionPrototypeDocumentation() { return "Dokumentace prototypu funkci"; } - QString trTypedefDocumentation() + QCString trTypedefDocumentation() { return "Dokumentace deklaraci datovych typu(typedefs)"; } - QString trEnumerationTypeDocumentation() + QCString trEnumerationTypeDocumentation() { return "Dokumentace vyctovych typu"; } - QString trFunctionDocumentation() + QCString trFunctionDocumentation() { return "Dokumentace funkci"; } - QString trVariableDocumentation() + QCString trVariableDocumentation() { return "Dokumentace promennych"; } - QString trCompounds() + QCString trCompounds() { return "Polozky objektovych typu"; } - QString trFiles() + QCString trFiles() { return "Soubory:"; } - QString trGeneratedAt(const char *date,const char *projName) + QCString trGeneratedAt(const char *date,const char *projName) { - QString result=(QString)"Gegenerovany v "+date; - if (projName) result+=(QString)" pro "+projName; - result+=(QString)" "; + QCString result=(QCString)"Gegenerovany v "+date; + if (projName) result+=(QCString)" pro "+projName; + result+=(QCString)" "; return result; } - QString trWrittenBy() + QCString trWrittenBy() { return "napsany "; } - QString trClassDiagram(const char *clName) + QCString trClassDiagram(const char *clName) { - return (QString)"Diagram trid pro "+clName; + return (QCString)"Diagram trid pro "+clName; } - QString trForInternalUseOnly() + QCString trForInternalUseOnly() { return "Jen pro interni pouziti."; } - QString trReimplementedForInternalReasons() + QCString trReimplementedForInternalReasons() { return "Znovu implementovany z internich duvodu; programove rozhrani" " aplikace(API) neni zmeneno."; } - QString trWarning() + QCString trWarning() { return "Upozorneni"; } - QString trBugsAndLimitations() + QCString trBugsAndLimitations() { return "Chyby a omezeni"; } - QString trVersion() + QCString trVersion() { return "Verze"; } - QString trDate() + QCString trDate() { return "Datum"; } - QString trAuthors() + QCString trAuthors() { return "Autor(i)"; } - QString trReturns() + QCString trReturns() { return "ma navratovou hodnotu"; } - QString trSeeAlso() + QCString trSeeAlso() { return "Podivej se take na"; } - QString trParameters() + QCString trParameters() { return "Parametry"; } - QString trExceptions() + QCString trExceptions() { return "Vyjimky"; } - QString trGeneratedBy() + QCString trGeneratedBy() { return "Gegenerovan podle"; } // new since 0.49-990307 - QString trNamespaces() + QCString trNamespaces() { return "Prostory jmen"; } - QString trNamespaceList() + QCString trNamespaceList() { return "Seznam prostoru jmen"; } - QString trNamespaceListDescription(bool extractAll) + QCString trNamespaceListDescription(bool extractAll) { - QString result="Zde jsou vsechny "; + QCString result="Zde jsou vsechny "; if (!extractAll) result+="dokumentovane "; result+="prostory jem s kratkymi popisy:"; return result; } - QString trFriends() + QCString trFriends() { return "Spratelene tridy, funkce a metody"; } }; diff --git a/src/translator_de.h b/src/translator_de.h new file mode 100644 index 0000000..8cf43b6 --- /dev/null +++ b/src/translator_de.h @@ -0,0 +1,559 @@ +/****************************************************************************** + * + * $Id$ + * + * Copyright (C) 1997-1999 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. + * + * All output generated with Doxygen is not covered by this license. + * + * The translation into German was provided by + * Jens Breitenstein (Jens.Breitenstein@tlc.de) + */ + +#ifndef TRANSLATOR_DE_H +#define TRANSLATOR_DE_H + +#include "translator.h" + +class TranslatorGerman : public Translator +{ + public: + //-------------------------------------------------------------------- + // NOTICE: + // the following functions are now obsolete: these are no longer used and + // will disappear in future versions. You do not have to translate them! + QCString trInherits() + { return "Abgeleitet von "; } + QCString trAnd() + { return "und"; } + QCString trInheritedBy() + { return "Basisklasse für"; } + QCString trReference() + { return "Verweis"; } + QCString trReimplementedFrom() + { return "Implementiert von"; } + QCString trReimplementedIn() + { return "erneute Implementation in"; } + QCString trIncludeFile() + { return "Include-Datei"; } + QCString trNamespaces() + { return "Namensbereiche"; } + // end of obsolete functions + //-------------------------------------------------------------------- + + QCString latexBabelPackage() + // returns the name of the package that is included by LaTeX + { return "deutsch"; } + + QCString trRelatedFunctions() + // used in the compound documentation before a list of related functions. + { return "Verwandte Funktionen"; } + + QCString trRelatedSubscript() + // subscript for the related functions. + { return "(Es handelt sich hierbei nicht um Elementfunktionen.)"; } + + QCString trDetailedDescription() + // header that is put before the detailed description of files, classes and namespaces. + { return "Ausführliche Beschreibung"; } + + QCString trMemberTypedefDocumentation() + // header that is put before the list of typedefs. + { return "Dokumentation der benutzerdefinierten Datentypen"; } + + QCString trMemberEnumerationDocumentation() + // header that is put before the list of enumerations. + { return "Dokumentation der Aufzählungstypen"; } + + QCString trMemberFunctionDocumentation() + // header that is put before the list of member functions. + { return "Dokumentation der Elementfunktionen"; } + + QCString trMemberDataDocumentation() + // header that is put before the list of member attributes. + { return "Dokumentation der Datenelemente"; } + + QCString trGeneratedFrom(const char *s,bool single) + { // here s is one of " Class", " Struct" or " Union" + // single is true implies a single file + QCString result=(QCString)"Die Dokumentation für diese"+s+ + " wurde aus "; + if (single) + result+="folgender Datei erzeugt:"; + else + result+="folgenden Dateien erzeugt:"; + + return result; + } + + QCString trMore() + // this is the text of a link put after brief descriptions. + { return "Mehr..."; } + + QCString trListOfAllMembers() + // put in the class documentation + { return "Aufstellung aller Elemente"; } + + QCString trMemberList() + // used as the title of the "list of all members" page of a class + { return "Elementverzeichnis"; } + + QCString trThisIsTheListOfAllMembers() + // this is the first part of a sentence that is followed by a class name + { return "Vollständige Aufstellung aller Elemente für"; } + + QCString trIncludingInheritedMembers() + // this is the remainder of the sentence after the class name + { return "einschlie&suml;lich aller geerbten Elemente."; } + + QCString trGeneratedAutomatically(const char *s) + // this is put at the author sections at the bottom of man pages. + // parameter s is name of the project name. + { QCString result="Automatisch erzeugt von Doxygen"; + if (s) result+=(QCString)" für "+s; + result+=" aus dem Quellcode."; + return result; + } + + QCString trEnumName() + // put after an enum name in the list of all members + { return "enum Bezeichner"; } + + QCString trEnumValue() + // put after an enum value in the list of all members + { return "enum Wert"; } + + QCString trDefinedIn() + // put after an undocumented member in the list of all members + { return "Definiert in"; } + + QCString trVerbatimText(const char *f) + // put as in introduction in the verbatim header file of a class. + // parameter f is the name of the include file. + { return (QCString)"Dieses ist der unveränderte Text aus der " + "Include-Datei "+f+"."; } + + // quick reference sections + QCString trModules() + // This is put above each page as a link to the list of all groups of + // compounds or files (see the \group command). + { return "Module"; } + QCString trClassHierarchy() + // This is put above each page as a link to the class hierarchy + { return "Klassenhierarchie"; } + QCString trCompoundList() + // This is put above each page as a link to the list of annotated classes + { return "Übersicht"; } + QCString trFileList() + // This is put above each page as a link to the list of documented files + { return "Auflistung der Dateien"; } + QCString trHeaderFiles() + // This is put above each page as a link to the list of all verbatim headers + { return "Auflistung der Header-Dateien"; } + QCString trCompoundMembers() + // This is put above each page as a link to all members of compounds. + { return "Elementübersicht"; } + QCString trFileMembers() + // This is put above each page as a link to all members of files. + { return "Datei-Elemente"; } + QCString trRelatedPages() + // This is put above each page as a link to all related pages. + { return "Zusätzliche Informationen"; } + QCString trExamples() + // This is put above each page as a link to all examples. + { return "Beispiele"; } + QCString trSearch() + // This is put above each page as a link to the search engine. + { return "Suchen"; } + + QCString trClassHierarchyDescription() + // This is an introduction to the class hierarchy. + { return "Die Liste der Ableitungen ist -mit Einschränkungen- " + "alphabetisch sortiert:"; + } + QCString trFileListDescription(bool extractAll) + // This is an introduction to the list with all files. + { + QCString result="Hier folgt die Aufzählung aller "; + if (!extractAll) result+="dokumentierten "; + result+="Dateien mit einer Kurzbeschreibung:"; + return result; + } + QCString trCompoundListDescription() + // This is an introduction to the annotated compound list + { return "Hier folgt die Aufzählung aller Klassen, Strukturen " + "und Varianten mit einer Kurzbeschreibung:"; + } + QCString trCompoundMembersDescription(bool extractAll) + // This is an introduction to the page with all class members + { + QCString result="Hier folgt die Aufzählung aller "; + if (!extractAll) result+="dokumentierten "; + result+="Klassenelemente mit Verweisen auf "; + if (extractAll) result+="die Klassendokumentation zu jedem Element:"; + else result+="die zugehörigen Klassen:"; + return result; + } + QCString trFileMembersDescription(bool extractAll) + // This is an introduction to the page with all file members + { + QCString result="Hier folgt die Aufzählung aller "; + if (!extractAll) result+="dokumentierter "; + result+="Dateielemente mit Verweisen auf "; + if (extractAll) result+="die Dateidokumentation zu jedem Element:"; + else result+="die zugehörigen Dateien:"; + return result; + } + QCString trHeaderFilesDescription() + // This is an introduction to the page with the list of all header files + { return "Hier folgen die Headerdateien, welche die API definieren:"; } + QCString trExamplesDescription() + // This is an introduction to the page with the list of all examples + { return "Hier folgt eine Liste mit allen Beispielen:"; } + QCString trRelatedPagesDescription() + // This is an introduction to the page with the list of related pages + { return "Hier folgt eine Liste mit zusammengehörigen Themengebieten:"; } + QCString trModulesDescription() + // This is an introduction to the page with the list of class/file groups + { return "Hier folgt die Aufzählung aller Module:"; } + QCString trNoDescriptionAvailable() + // This sentences is used in the annotated class/file lists if no brief + // description is given. + { return "Keine Beschreibung verfügbar"; } + + // index titles (the project name is prepended for these) + QCString trDocumentation() + // This is used in HTML as the title of index.html. + { return "Dokumentation"; } + QCString trModuleIndex() + // This is used in LaTeX as the title of the chapter with the + // index of all groups. + { return "Modul-Verzeichnis"; } + QCString trHierarchicalIndex() + // This is used in LaTeX as the title of the chapter with the + // class hierarchy. + { return "Hierarchie-Verzeichnis"; } + QCString trCompoundIndex() + // This is used in LaTeX as the title of the chapter with the + // annotated compound index + { return "Compound-Verzeichnis"; } + QCString trFileIndex() + // This is used in LaTeX as the title of the chapter with the + // list of all files. + { return "Datei-Verzeichnis"; } + QCString trModuleDocumentation() + // This is used in LaTeX as the title of the chapter containing + // the documentation of all groups. + { return "Modul-Dokumentation"; } + QCString trClassDocumentation() + // This is used in LaTeX as the title of the chapter containing + // the documentation of all classes, structs and unions. + { return "Klassen-Dokumentation"; } + QCString trFileDocumentation() + // This is used in LaTeX as the title of the chapter containing + // the documentation of all files. + { return "Datei-Dokumentation"; } + QCString trExampleDocumentation() + // This is used in LaTeX as the title of the chapter containing + // the documentation of all examples. + { return "Dokumentation der Beispiele"; } + QCString trPageDocumentation() + // This is used in LaTeX as the title of the chapter containing + // the documentation of all related pages. + { return "Seitenbeschreibung"; } + QCString trReferenceManual() + // This is used in LaTeX as the title of the document + { return "Nachschlagewerk"; } + + QCString trDefines() + // This is used in the documentation of a file as a header before the + // list of defines + { return "Makrodefinitionen"; } + QCString trFuncProtos() + // This is used in the documentation of a file as a header before the + // list of function prototypes + { return "Funktionsprototypen"; } + QCString trTypedefs() + // This is used in the documentation of a file as a header before the + // list of typedefs + { return "Typendefinitionen"; } + QCString trEnumerations() + // This is used in the documentation of a file as a header before the + // list of enumerations + { return "Aufzählungen"; } + QCString trFunctions() + // This is used in the documentation of a file as a header before the + // list of (global) functions + { return "Funktionen"; } + QCString trVariables() + // This is used in the documentation of a file as a header before the + // list of (global) variables + { return "Variablen"; } + QCString trEnumerationValues() + // This is used in the documentation of a file as a header before the + // list of (global) variables + { return "Aufzählungswerte"; } + + QCString trAuthor() + // This is used in man pages as the author section. + { return "Autor"; } + + QCString trDefineDocumentation() + // This is used in the documentation of a file before the list of + // documentation blocks for defines + { return "Makro-Dokumentation"; } + QCString trFunctionPrototypeDocumentation() + // This is used in the documentation of a file/namespace before the list + // of documentation blocks for function prototypes + { return "Funktionsprototypen Dokumentation"; } + QCString trTypedefDocumentation() + // This is used in the documentation of a file/namespace before the list + // of documentation blocks for typedefs + { return "Dokumentation der benutzerdefinerten Typen"; } + QCString trEnumerationTypeDocumentation() + // This is used in the documentation of a file/namespace before the list + // of documentation blocks for enumeration types + { return "Dokumentation der Aufzählungstypen"; } + QCString trEnumerationValueDocumentation() + // This is used in the documentation of a file/namespace before the list + // of documentation blocks for enumeration values + { return "Dokumentation des Wertebereiches der Aufzählungstypen"; } + QCString trFunctionDocumentation() + // This is used in the documentation of a file/namespace before the list + // of documentation blocks for functions + { return "Dokumentation der Funktionen"; } + QCString trVariableDocumentation() + // This is used in the documentation of a file/namespace before the list + // of documentation blocks for variables + { return "Variablen-Dokumentation"; } + QCString trCompounds() + // This is used in the documentation of a file/namespace/group before + // the list of links to documented compounds + { return "Übersicht"; } + QCString trFiles() + // This is used in the documentation of a group before the list of + // links to documented files + { return "Dateien"; } + + QCString trGeneratedAt(const char *date,const char *projName) + { + QCString result=(QCString)"Erzeugt am "+date; + if (projName) result+=(QCString)" für "+projName; + result+=(QCString)" von"; + return result; + } + QCString trWrittenBy() + { + return "geschrieben von"; + } + + QCString trClassDiagram(const char *clName) + // this text is put before a class diagram + { + return (QCString)"Klassendiagramm für "+clName; + } + + QCString trForInternalUseOnly() + // this text is generated when the \internal command is used. + { return "Nur für den internen Gebrauch."; } + QCString trReimplementedForInternalReasons() + // this text is generated when the \reimp command is used. + { return "Aufgrund interner Gründe neu implementiert; " + "Das API wird davon nicht berührt."; + } + QCString trWarning() + // this text is generated when the \warning command is used. + { return "Warnung"; } + QCString trBugsAndLimitations() + // this text is generated when the \bug command is used. + { return "Fehler und Einschränkungen"; } + QCString trVersion() + // this text is generated when the \version command is used. + { return "Version"; } + QCString trDate() + // this text is generated when the \date command is used. + { return "Datum"; } + QCString trAuthors() + // this text is generated when the \author command is used. + { return "Autor(en)"; } + QCString trReturns() + // this text is generated when the \return command is used. + { return "Rückgabe"; } + QCString trSeeAlso() + // this text is generated when the \sa command is used. + { return "Siehe auch"; } + QCString trParameters() + // this text is generated when the \param command is used. + { return "Parameter"; } + QCString trExceptions() + // this text is generated when the \exception command is used. + { return "Ausnahmebehandlung"; } + QCString trGeneratedBy() + // this text is used in the title page of a LaTeX document. + { return "Erzeugt von"; } + + // new since 0.49-990307 + + QCString trNamespaceList() + // used as the title of page containing all the index of all namespaces. + { return ""; } + QCString trNamespaceListDescription(bool extractAll) + // used as an introduction to the namespace list + { + QCString result="Lister aller "; + if (!extractAll) result+="dokumentierter "; + result+="Namensbereiche mit Kurzbeschreibung:"; + return result; + } + QCString trFriends() + // used in the class documentation as a header before the list of all + // friends of a class + { return "Freundbeziehungen"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990405 +////////////////////////////////////////////////////////////////////////// + + QCString trRelatedFunctionDocumentation() + // used in the class documentation as a header before the list of all + // related classes + { return "Freundbeziehungen und Funktionsdokumentation"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990425 +////////////////////////////////////////////////////////////////////////// + + QCString trCompoundReference(const char *clName, + ClassDef::CompoundType compType) + // used as the title of the HTML page of a class/struct/union + { + QCString result=(QCString)clName+" "; + switch(compType) + { + case ClassDef::Class: result+=" Klassen"; break; + case ClassDef::Struct: result+=" Strukturen"; break; + case ClassDef::Union: result+=" Varianten"; break; + } + result+="referenz"; + return result; + } + QCString trFileReference(const char *fileName) + // used as the title of the HTML page of a file + { + QCString result=fileName; + result+=" Dateireferenz"; + return result; + } + QCString trNamespaceReference(const char *namespaceName) + // used as the title of the HTML page of a namespace + { + QCString result=namespaceName; + result+=" Namensbereichsreferenz"; + return result; + } + + // these are for the member sections of a class, struct or union + QCString trPublicMembers() + { return "Öffentliche Datenelemente"; } + QCString trPublicSlots() + { return "Öffentliche Slots"; } + QCString trSignals() + { return "Signale"; } + QCString trStaticPublicMembers() + { return "Öffentliche, statische Datenelemente"; } + QCString trProtectedMembers() + { return "Geschützte Datenelemente"; } + QCString trProtectedSlots() + { return "Geschützte Slots"; } + QCString trStaticProtectedMembers() + { return "Geschützte, statische Datenelemente"; } + QCString trPrivateMembers() + { return "Private Datenelemente"; } + QCString trPrivateSlots() + { return "Private Slots"; } + QCString trStaticPrivateMembers() + { return "Private, statische Datenelemente"; } + // end of member sections + + QCString trWriteList(int numEntries) + { + // this function is used to produce a comma-separated list of items. + // use generateMarker(i) to indicate where item i should be put. + QCString result; + int i; + // the inherits list contain `numEntries' classes + for (i=0;i<numEntries;i++) + { + // use generateMarker to generate placeholders for the class links! + result+=generateMarker(i); // generate marker for entry i in the list + // (order is left to right) + + if (i!=numEntries-1) // not the last entry, so we need a separator + { + if (i<numEntries-2) // not the fore last entry + result+=", "; + else // the fore last entry + result+=", und "; + } + } + return result; + } + + QCString trInheritsList(int numEntries) + // used in class documentation to produce a list of base classes, + // if class diagrams are disabled. + { + return "Abgeleitet von "+trWriteList(numEntries)+"."; + } + QCString trInheritedByList(int numEntries) + // used in class documentation to produce a list of super classes, + // if class diagrams are disabled. + { + return "Basisklasse für "+trWriteList(numEntries)+"."; + } + QCString trReimplementedFromList(int numEntries) + // used in member documentation blocks to produce a list of + // members that are hidden by this one. + { + return "Implementiert von "+trWriteList(numEntries)+"."; + } + QCString trReimplementedInList(int numEntries) + { + // used in member documentation blocks to produce a list of + // all member that overwrite the implementation of this member. + return "Erneute Implementation in "+trWriteList(numEntries)+"."; + } + + QCString trNamespaceMembers() + // This is put above each page as a link to all members of namespaces. + { return "Elemente eines Namensbereiches"; } + QCString trNamespaceMemberDescription(bool extractAll) + // This is an introduction to the page with all namespace members + { + QCString result="Hier folgt die Aufzählung aller "; + if (!extractAll) result+="dokumentierter "; + result+="Namensbereichselemente mit Verweisen auf "; + if (extractAll) + result+="die Namensbereichsdokumentation für jedes Element:"; + else + result+="die zugehörigen Dateien:"; + return result; + } + QCString trNamespaceIndex() + // This is used in LaTeX as the title of the chapter with the + // index of all namespaces. + { return "Verzeichnis der Namensbereiche"; } + QCString trNamespaceDocumentation() + // This is used in LaTeX as the title of the chapter containing + // the documentation of all namespaces. + { return "Dokumentation der Namensbereiche"; } +}; + +#endif + diff --git a/src/translator_es.h b/src/translator_es.h new file mode 100644 index 0000000..9fcda7b --- /dev/null +++ b/src/translator_es.h @@ -0,0 +1,405 @@ +/****************************************************************************** + * + * $Id$ + * + * Copyright (C) 1997-1999 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. + * + * All output generated with Doxygen is not covered by this license. + * + */ + + +/** + * translator_es.h modifief by Francisco Oltra + * Some notes: + * - Computer related use of the spanish language differs from + * country to country, so some words might not sound so good + * to some people (but it does to me, *grin* ). A good example + * is the spanish for File: i use "Archivo", others may prefer + * "Fichero". + * - Some words were not translated for understandability, since + * we are talking about a computer program here! + * - Some of the functions are called in some order coherent with + * the english grammar, this results in some ugly constructs. + */ + +#ifndef TRANSLATOR_ES_H +#define TRANSLATOR_ES_H + +#include "translator.h" + +class TranslatorSpanish : public Translator +{ + public: + QCString latexBabelPackage() + { return "spanish"; } + QCString trRelatedFunctions() + { return "Funciones Relacionadas"; } + QCString trRelatedSubscript() + { return "(Note que estos no son funciones miembro.)"; } + QCString trDetailedDescription() + { return "Descripción Detallada"; } + QCString trMemberTypedefDocumentation() + { return "Documentación de Miembros Typedef"; } + QCString trMemberEnumerationDocumentation() + { return "Documentación de Miembros de Enumeración"; } + QCString trEnumerationValueDocumentation() + { return "Documentación de los Valores de Enumeración"; } + QCString trMemberFunctionDocumentation() + { return "Documentación de Funciones Miembro"; } + QCString trMemberDataDocumentation() + { return "Documentación de Datos Miembro"; } + QCString trGeneratedFrom(const char *s,bool single) + { + QCString result=(QCString)"La documentación para esta"+s+ + " fue generada del siguiente archivo"; + if (single) result+=":"; else result+="s:"; + return result; + } + QCString trMore() + { return "Más..."; } + QCString trListOfAllMembers() + { return "Lista de todos los miembros."; } + QCString trMemberList() + { return "Lista de Miembros"; } + QCString trThisIsTheListOfAllMembers() + { return "Esta es la lista completa de miembros para "; } + QCString trIncludingInheritedMembers() + { return ", incluyendo todos los miembros heredados."; } + QCString trGeneratedAutomatically(const char *s) + { QCString result="Generado automáticamente por Doxygen"; + if (s) result+=(QCString)" para "+s; + result+=" desde el código fuente."; + return result; + } + QCString trEnumName() + { return "nombre de enum"; } + QCString trEnumValue() + { return "valor de enum"; } + QCString trDefinedIn() + { return "definido en"; } + QCString trVerbatimText(const char *f) + { return (QCString)"Esto es texto verbatim del archivo incluído "+f+"."; } + QCString trModules() + { return "Modulos"; } + QCString trClassHierarchy() + { return "Jerarquía de la clase"; } + QCString trCompoundList() + { return "Lista de Tipos Compuestos"; } + QCString trFileList() + { return "Lista de Archivos"; } + QCString trHeaderFiles() + { return "Archivos de Cabecera"; } + QCString trCompoundMembers() + { return "Miembros de Compuestos"; } + QCString trFileMembers() + { return "Miembros de los Archivos"; } + QCString trRelatedPages() + { return "Páginas Relacionadas"; } + QCString trExamples() + { return "Ejemplos"; } + QCString trSearch() + { return "Buscar"; } + QCString trClassHierarchyDescription() + { return "Esta lista de herencia está ordenada alfabéticamente, " + "pero no completamente:"; + } + QCString trFileListDescription(bool extractAll) + { + QCString result="Esta es una lista de todos "; + result+="los archivos "; + if (!extractAll) result+="documentados "; + result+="con breves descripciones:"; + return result; + } + QCString trCompoundListDescription() + { return "Aquí estan las clases, estructuras y " + "uniones con descripciones breves:"; + } + QCString trCompoundMembersDescription(bool extractAll) + { + QCString result="Esta es una lista de todos "; + result+="miembros de clases "; + if (!extractAll) result+="documentados "; + result+="con enlaces a "; + if (extractAll) result+="la documentación de clase para cada miembro:"; + else result+="las clases a que pertenecen:"; + return result; + } + QCString trFileMembersDescription(bool extractAll) + { + QCString result="Esta es una lista de todos los miembros de los archivos "; + if (!extractAll) result+="documentados "; + result+="con enlaces a "; + if (extractAll) result+="la documentación de archivo para cada miembro:"; + else result+="los archivos a que pertenecen:"; + return result; + } + QCString trHeaderFilesDescription() + { return "Aquí estan los archivos de cabecera que forman el API:"; } + QCString trExamplesDescription() + { return "Esta es la lista de todos los ejemplos:"; } + QCString trRelatedPagesDescription() + { return "Esta es una lista de todos las páginas con documentación relacionada:"; } + QCString trModulesDescription() + { return "Esta es una lista con todos los modulos:"; } + QCString trNoDescriptionAvailable() + { return "No existe descripción disponible"; } + + QCString trDocumentation() + { return "Documentación"; } + QCString trModuleIndex() + { return "Índice de Modulos"; } + QCString trHierarchicalIndex() + { return "Índice Jerárquico"; } + QCString trCompoundIndex() + { return "Índice de Tipos Compuestos"; } + QCString trFileIndex() + { return "Índice de Archivos"; } + QCString trModuleDocumentation() + { return "Documentación de los Modulos"; } + QCString trClassDocumentation() + { return "Documentación de las clases"; } + QCString trFileDocumentation() + { return "Documentación de los Archivos"; } + QCString trExampleDocumentation() + { return "Documentación de los Ejemplos"; } + QCString trPageDocumentation() + { return "Documentación de las Páginas Relacionadas"; } + QCString trReferenceManual() + { return "Manual de Referencia"; } + + QCString trDefines() + { return "Definiciones"; } + QCString trFuncProtos() + { return "Prototipo de Funciones"; } + QCString trTypedefs() + { return "Typedefs"; } + QCString trEnumerations() + { return "Enumeraciones"; } + QCString trFunctions() + { return "Funciones"; } + QCString trVariables() + { return "Variables"; } + QCString trEnumerationValues() + { return "Valores de Enumeraciones"; } + QCString trAuthor() + { return "Autor"; } + QCString trDefineDocumentation() + { return "Documentación de las Definiciones"; } + QCString trFunctionPrototypeDocumentation() + { return "Documentación de los Prototipos de Funciones"; } + QCString trTypedefDocumentation() + { return "Documentación de Typedefs"; } + QCString trEnumerationTypeDocumentation() + { return "Documentación de Enumeración de tipos"; } + QCString trFunctionDocumentation() + { return "Documentación de Funciones"; } + QCString trVariableDocumentation() + { return "Documentación de Variables"; } + QCString trCompounds() + { return "Tipos Compuestos"; } + QCString trFiles() + { return "Archivos"; } + QCString trGeneratedAt(const char *date,const char *projName) + { + QCString result=(QCString)"Generado el "+date; + if (projName) result+=(QCString)" para "+projName; + result+=(QCString)" por"; + return result; + } + QCString trWrittenBy() + { + return "escrito por"; + } + QCString trClassDiagram(const char *clName) + { + return (QCString)"Diagrama de clases para "+clName; + } + + QCString trForInternalUseOnly() + { return "Para uso interno solamente."; } + QCString trReimplementedForInternalReasons() + { return "Reimplementado por razones internas; el API no se ve afectado."; + } + QCString trWarning() + { return "Atención"; } + QCString trBugsAndLimitations() + { return "Bugs y Limitaciones"; } + QCString trVersion() + { return "Versión"; } + QCString trDate() + { return "Fecha"; } + QCString trAuthors() + { return "Autor(es)"; } + QCString trReturns() + { return "Devuelve"; } + QCString trSeeAlso() + { return "Ver también"; } + QCString trParameters() + { return "Parámetros"; } + QCString trExceptions() + { return "Excepciones"; } + QCString trGeneratedBy() + { return "Generado por"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990307 +////////////////////////////////////////////////////////////////////////// + + QCString trNamespaceList() + { return "Lista de Namespaces"; } + QCString trNamespaceListDescription(bool extractAll) + { + QCString result="Esta es una lista de los namespaces "; + if (!extractAll) result+="documentados "; + result+="con descripciones breves:"; + return result; + } + QCString trFriends() + { return "Clases Amigas"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990405 +////////////////////////////////////////////////////////////////////////// + + QCString trRelatedFunctionDocumentation() + { return "Documentación de Clases Amigas y Funciones Relacionadas"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990425 +////////////////////////////////////////////////////////////////////////// + + virtual QCString trCompoundReference(const char *clName, + ClassDef::CompoundType compType) + // used as the title of the HTML page of a class/struct/union + { + QCString result=(QCString)clName+" "; + switch(compType) + { + case ClassDef::Class: result+=" Clase"; break; + case ClassDef::Struct: result+=" Estructura"; break; + case ClassDef::Union: result+=" Unión"; break; + } + result+=" Referencia"; + return result; + } + virtual QCString trFileReference(const char *fileName) + // used as the title of the HTML page of a file + { + QCString result=fileName; + result+=" Referencia de Archivos"; + return result; + } + virtual QCString trNamespaceReference(const char *namespaceName) + // used as the title of the HTML page of a namespace + { + QCString result=namespaceName; + result+=" Referencia de Namespace"; + return result; + } + + // these are for the member sections of a class, struct or union + virtual QCString trPublicMembers() + { return "Miembros Públicos"; } + virtual QCString trPublicSlots() + { return "Slots Públicos"; } + virtual QCString trSignals() + { return "Señales"; } + virtual QCString trStaticPublicMembers() + { return "Miembros Estáticos Públicos"; } + virtual QCString trProtectedMembers() + { return "Miembros Protegidos"; } + virtual QCString trProtectedSlots() + { return "Slots Protegidos"; } + virtual QCString trStaticProtectedMembers() + { return "Miembros Protegidos Estáticos"; } + virtual QCString trPrivateMembers() + { return "Miembros Privados"; } + virtual QCString trPrivateSlots() + { return "Slots Privados"; } + virtual QCString trStaticPrivateMembers() + { return "Miembros Estáticos Privados"; } + // end of member sections + + virtual QCString trWriteList(int numEntries) + { + // this function is used to produce a comma-separated list of items. + // use generateMarker(i) to indicate where item i should be put. + QCString result; + int i; + // the inherits list contain `numEntries' classes + for (i=0;i<numEntries;i++) + { + // use generateMarker to generate placeholders for the class links! + result+=generateMarker(i); // generate marker for entry i in the list + // (order is left to right) + + if (i!=numEntries-1) // not the last entry, so we need a separator + { + if (i<numEntries-2) // not the fore last entry + result+=", "; + else // the fore last entry + result+=" y "; + } + } + return result; + } + + virtual QCString trInheritsList(int numEntries) + // used in class documentation to produce a list of base classes, + // if class diagrams are disabled. + { + return "Hereda a "+trWriteList(numEntries)+"."; + } + virtual QCString trInheritedByList(int numEntries) + // used in class documentation to produce a list of super classes, + // if class diagrams are disabled. + { + return "Heredado por "+trWriteList(numEntries)+"."; + } + virtual QCString trReimplementedFromList(int numEntries) + // used in member documentation blocks to produce a list of + // members that are hidden by this one. + { + return "Reimplementado por "+trWriteList(numEntries)+"."; + } + virtual QCString trReimplementedInList(int numEntries) + { + // used in member documentation blocks to produce a list of + // all member that overwrite the implementation of this member. + return "Reimplementado en "+trWriteList(numEntries)+"."; + } + + virtual QCString trNamespaceMembers() + // This is put above each page as a link to all members of namespaces. + { return "Miembros del Namespace"; } + virtual QCString trNamespaceMemberDescription(bool extractAll) + // This is an introduction to the page with all namespace members + { + QCString result="Esta es una lista de todos los miembros de namespace "; + if (!extractAll) result+="documentados "; + result+="con enlaces a "; + if (extractAll) + result+="a la documentación de namespaces para cada miembro:"; + else + result+="los namespaces a los que pertenecen:"; + return result; + } + virtual QCString trNamespaceIndex() + // This is used in LaTeX as the title of the chapter with the + // index of all namespaces. + { return "Índice de Namespaces"; } + virtual QCString trNamespaceDocumentation() + // This is used in LaTeX as the title of the chapter containing + // the documentation of all namespaces. + { return "Documentación de Namespaces"; } +}; + +#endif diff --git a/src/translator_fr.h b/src/translator_fr.h index 319f156..8214221 100644 --- a/src/translator_fr.h +++ b/src/translator_fr.h @@ -12,122 +12,124 @@ * * All output generated with Doxygen is not covered by this license. * + * The translation into French was provided by + * Christophe Bordeux (bordeux@lig.di.epfl.ch) */ #ifndef TRANSLATOR_FR_H #define TRANSLATOR_FR_H -#include <qstring.h> +#include "translator.h" class TranslatorFrench : public Translator { public: - QString latexBabelPackage() + QCString latexBabelPackage() { return "french"; } - QString trInherits() + QCString trInherits() { return "Hérite de"; } - QString trAnd() + QCString trAnd() { return "et"; } - QString trInheritedBy() + QCString trInheritedBy() { return "Dérivée par"; } - QString trRelatedFunctions() + QCString trRelatedFunctions() { return "Fonctions associées"; } - QString trRelatedSubscript() + QCString trRelatedSubscript() { return "(Noter que ces fonctions ne sont pas des méthodes de la classe)"; } - QString trDetailedDescription() + QCString trDetailedDescription() { return "Description détaillée"; } - QString trMemberTypedefDocumentation() + QCString trMemberTypedefDocumentation() { return "Documentation des types imbriqués"; } - QString trMemberEnumerationDocumentation() + QCString trMemberEnumerationDocumentation() { return "Documentation des énumérations imbriqués"; } - QString trMemberFunctionDocumentation() + QCString trMemberFunctionDocumentation() { return "Documentation des méthodes"; } - QString trMemberDataDocumentation() + QCString trMemberDataDocumentation() { return "Documentation des données imbriqués"; } - QString trGeneratedFrom(const char *s,bool single) + QCString trGeneratedFrom(const char *s,bool single) { - QString result=(QString)"La documentation pour cette"+s+ + QCString result=(QCString)"La documentation pour cette"+s+ " a été générée à partir "; if (single) result+="du fichier suivant:"; else result+="des fichiers suivants:"; return result; } - QString trMore() + QCString trMore() { return "Plus de détails..."; } - QString trReference() + QCString trReference() { return "Référence"; } - QString trListOfAllMembers() + QCString trListOfAllMembers() { return "Liste de tous les membres"; } - QString trMemberList() + QCString trMemberList() { return "Liste des membres"; } - QString trThisIsTheListOfAllMembers() + QCString trThisIsTheListOfAllMembers() { return "Ceci est la liste complète des membres de"; } - QString trIncludingInheritedMembers() + QCString trIncludingInheritedMembers() { return "y compris des membres des classes héritées."; } - QString trGeneratedAutomatically(const char *s) - { QString result="Généré automatiquement par Doxygen"; - if (s) result+=(QString)" pour "+s; + QCString trGeneratedAutomatically(const char *s) + { QCString result="Généré automatiquement par Doxygen"; + if (s) result+=(QCString)" pour "+s; result+=" à partir du code source."; return result; } - QString trEnumName() + QCString trEnumName() { return "énumération"; } - QString trEnumValue() + QCString trEnumValue() { return "élément d'une énumération"; } - QString trDefinedIn() + QCString trDefinedIn() { return "défini dans"; } - QString trIncludeFile() + QCString trIncludeFile() { return "Fichier inclu"; } - QString trVerbatimText(const char *f) - { return (QString)"Ce texte provient du fichier inclu "+f+"."; } + QCString trVerbatimText(const char *f) + { return (QCString)"Ce texte provient du fichier inclu "+f+"."; } - QString trModules() + QCString trModules() { return "Modules"; } - QString trClassHierarchy() + QCString trClassHierarchy() { return "Hiérarchie des classes"; } - QString trCompoundList() + QCString trCompoundList() { return "Liste des composants"; } - QString trFileList() + QCString trFileList() { return "Liste des fichiers"; } - QString trHeaderFiles() + QCString trHeaderFiles() { return "Fichiers d'entête"; } - QString trCompoundMembers() + QCString trCompoundMembers() { return "Composants"; } - QString trFileMembers() + QCString trFileMembers() { return "Déclarations"; } - QString trRelatedPages() + QCString trRelatedPages() { return "Pages associées"; } - QString trExamples() + QCString trExamples() { return "Exemples"; } - QString trSearch() + QCString trSearch() { return "Recherche"; } - QString trClassHierarchyDescription() + QCString trClassHierarchyDescription() { return "Cette liste d'héritage est, autant que possible, " "classée par ordre alphabétique"; } - QString trFileListDescription(bool extractAll) + QCString trFileListDescription(bool extractAll) { - QString result="Liste de tous les fichiers "; + QCString result="Liste de tous les fichiers "; if (!extractAll) result+="documentés "; result+="avec une brève description :"; return result; } - QString trCompoundListDescription() + QCString trCompoundListDescription() { return "Liste des classes, des strutures et des unions " "avec une brève description :"; } - QString trCompoundMembersDescription(bool extractAll) + QCString trCompoundMembersDescription(bool extractAll) { - QString result="Liste de tous les membres de classe "; + QCString result="Liste de tous les membres de classe "; if (!extractAll) result+="documentés "; result+="avec les liens vers "; if (extractAll) result+="la documentation de la classe correspondante :"; else result+="les classes auxquelles ils appartiennent :"; return result; } - QString trFileMembersDescription(bool extractAll) + QCString trFileMembersDescription(bool extractAll) { - QString result="Liste de toutes les déclarations"; + QCString result="Liste de toutes les déclarations"; if (!extractAll) result+="documentées "; result+="avec liens sur "; if (extractAll) result+="la documentation du fichier correspondant " @@ -135,140 +137,140 @@ class TranslatorFrench : public Translator else result+="les fichiers dans lesquels elles sont définies :"; return result; } - QString trHeaderFilesDescription() + QCString trHeaderFilesDescription() { return "Liste de tous les fichiers d'entête constituant " "l'interface de programmation :"; } - QString trExamplesDescription() + QCString trExamplesDescription() { return "Liste de tous les exemples :"; } - QString trRelatedPagesDescription() + QCString trRelatedPagesDescription() { return "Liste de toutes les pages de documentation associées :"; } - QString trModulesDescription() + QCString trModulesDescription() { return "Liste de tous les modules"; } - QString trNoDescriptionAvailable() + QCString trNoDescriptionAvailable() { return "Aucune description n'est disponible"; } - QString trDocumentation() + QCString trDocumentation() { return "Documentation"; } - QString trModuleIndex() + QCString trModuleIndex() { return "Index des modules"; } - QString trHierarchicalIndex() + QCString trHierarchicalIndex() { return "Index hiérarchique"; } - QString trCompoundIndex() + QCString trCompoundIndex() { return "Index des composants"; } - QString trFileIndex() + QCString trFileIndex() { return "Index des fichiers"; } - QString trModuleDocumentation() + QCString trModuleDocumentation() { return "Documentation du module"; } - QString trClassDocumentation() + QCString trClassDocumentation() { return "Documentation de la classe"; } - QString trFileDocumentation() + QCString trFileDocumentation() { return "Documentation du fichier"; } - QString trExampleDocumentation() + QCString trExampleDocumentation() { return "Documentation de l'exemple"; } - QString trPageDocumentation() + QCString trPageDocumentation() { return "Documentation de la page"; } - QString trReferenceManual() + QCString trReferenceManual() { return "Manuel de référence"; } - QString trDefines() + QCString trDefines() { return "Définitions des macros"; } - QString trFuncProtos() + QCString trFuncProtos() { return "Prototypes des fonctions"; } - QString trTypedefs() + QCString trTypedefs() { return "Définitions des types"; } - QString trEnumerations() + QCString trEnumerations() { return "Enumérations"; } - QString trFunctions() + QCString trFunctions() { return "Fonctions"; } - QString trVariables() + QCString trVariables() { return "Variables"; } - QString trEnumerationValues() + QCString trEnumerationValues() { return "Eléments énumérés"; } - QString trReimplementedFrom() + QCString trReimplementedFrom() { return "Redéfini à partir de"; } - QString trReimplementedIn() + QCString trReimplementedIn() { return "Redéfini dans"; } - QString trAuthor() + QCString trAuthor() { return "Auteur"; } - QString trDefineDocumentation() + QCString trDefineDocumentation() { return "Documentation de la macro"; } - QString trFunctionPrototypeDocumentation() + QCString trFunctionPrototypeDocumentation() { return "Documentation du prototype de la fonction"; } - QString trTypedefDocumentation() + QCString trTypedefDocumentation() { return "Documentation du type"; } - QString trEnumerationTypeDocumentation() + QCString trEnumerationTypeDocumentation() { return "Documentation du type de l'énumeration"; } - QString trEnumerationValueDocumentation() + QCString trEnumerationValueDocumentation() { return "Documentation de l'élément de l'énumeration"; } - QString trFunctionDocumentation() + QCString trFunctionDocumentation() { return "Documentation de la fonction"; } - QString trVariableDocumentation() + QCString trVariableDocumentation() { return "Documentation de la variable"; } - QString trCompounds() + QCString trCompounds() { return "Composants"; } - QString trFiles() + QCString trFiles() { return "Fichiers"; } - QString trGeneratedAt(const char *date,const char *projName) + QCString trGeneratedAt(const char *date,const char *projName) { - QString result=(QString)"Généré le "+date; - if (projName) result+=(QString)" pour "+projName; - result+=(QString)" par "; + QCString result=(QCString)"Généré le "+date; + if (projName) result+=(QCString)" pour "+projName; + result+=(QCString)" par "; return result; } - QString trWrittenBy() + QCString trWrittenBy() { return "écrit par"; } - QString trClassDiagram(const char *clName) + QCString trClassDiagram(const char *clName) { - return (QString)"Graphe d'héritage de la classe "+clName; + return (QCString)"Graphe d'héritage de la classe "+clName; } - QString trForInternalUseOnly() + QCString trForInternalUseOnly() { return "A usage interne uniquement."; } - QString trReimplementedForInternalReasons() + QCString trReimplementedForInternalReasons() { return "Redéfini pour des raisons internes; " "l'interface n'est pas modifiée"; } - QString trWarning() + QCString trWarning() { return "Avertissement"; } - QString trBugsAndLimitations() + QCString trBugsAndLimitations() { return "Bogues et limitations"; } - QString trVersion() + QCString trVersion() { return "Version"; } - QString trDate() + QCString trDate() { return "Date"; } - QString trAuthors() + QCString trAuthors() { return "Auteur(s)"; } - QString trReturns() + QCString trReturns() { return "Renvoie"; } - QString trSeeAlso() + QCString trSeeAlso() { return "Voir également"; } - QString trParameters() + QCString trParameters() { return "Paramètres"; } - QString trExceptions() + QCString trExceptions() { return "Exceptions"; } - QString trGeneratedBy() + QCString trGeneratedBy() { return "Généré par"; } // new since 0.49-990307 - virtual QString trNamespaces() + virtual QCString trNamespaces() { return "Namespaces"; } - virtual QString trNamespaceList() + virtual QCString trNamespaceList() { return "Liste des Namespaces"; } - virtual QString trNamespaceListDescription(bool extractAll) + virtual QCString trNamespaceListDescription(bool extractAll) { - QString result="Liste de tous les namespaces "; + QCString result="Liste de tous les namespaces "; if (!extractAll) result+="documentés "; result+="avec une brève description :"; return result; } - virtual QString trFriends() + virtual QCString trFriends() { return "Friends"; } // new since 0.49-990405 - virtual QString trRelatedFunctionDocumentation() + virtual QCString trRelatedFunctionDocumentation() { return "Documentation des fonctions amies et associées"; } }; diff --git a/src/translator_it.h b/src/translator_it.h index 316f43a..e2f76dc 100644 --- a/src/translator_it.h +++ b/src/translator_it.h @@ -4,6 +4,9 @@ * * Copyright (C) 1997-1999 by Dimitri van Heesch. * + * Initial Italian Translation by Ahmed Aldo Faisal + * Revised and completed by Alessandro Falappa (June 1999) + * * 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 @@ -17,250 +20,360 @@ #ifndef TRANSLATOR_IT_H #define TRANSLATOR_IT_H -#include <qstring.h> +#include "translator.h" class TranslatorItalian : public Translator { public: - QString latexBabelPackage() + QCString latexBabelPackage() { return "italian"; } - QString trInherits() + QCString trInherits() { return "eredita"; } - QString trAnd() + QCString trAnd() { return "e"; } - QString trInheritedBy() - { return "Ereditato da"; } - QString trRelatedFunctions() - { return "Funzioni relative"; } - QString trRelatedSubscript() - { return "(Nota che questo no sono funzioni membro)"; } - QString trDetailedDescription() + QCString trInheritedBy() + //{ return "Ereditato da"; } + { return "Ereditate da"; } + QCString trRelatedFunctions() + //{ return "Funzioni relative"; } + { return "Funzioni collegate"; } + QCString trRelatedSubscript() + //{ return "(Nota che questo no sono funzioni membro)"; } + { return "(Attenzione, queste non sono funzioni membro)"; } + QCString trDetailedDescription() { return "Descrizione dettagliata"; } - QString trMemberTypedefDocumentation() - { return "Documentazione dei membri Typedef"; } - QString trMemberEnumerationDocumentation() - { return "Documentazione dei membri enumerati"; } - QString trEnumerationValueDocumentation() - { return "Documentazione dei tipi enumerati"; } - QString trMemberFunctionDocumentation() + QCString trMemberTypedefDocumentation() + //{ return "Documentazione dei membri Typedef"; } + { return "Documentazione delle ridefinizioni dei tipi (typedef)"; } + QCString trMemberEnumerationDocumentation() + //{ return "Documentazione dei membri enumerati"; } + { return "Documentazione dei tipi enumerati (enum)"; } + QCString trEnumerationValueDocumentation() + { return "Documentazione dei valori dei tipi enumerati"; } + QCString trMemberFunctionDocumentation() { return "Documentazione delle funzioni membro"; } - QString trMemberDataDocumentation() + QCString trMemberDataDocumentation() { return "Documentazione dei dati membro"; } - QString trGeneratedFrom(const char *s,bool single) + QCString trGeneratedFrom(const char *s,bool single) { - QString result=(QString)"La documentazione di questa "+s+ - " e stata generata dal seguente file"; - if (single) result+=":"; else result+=":"; + QCString result=(QCString)"La documentazione di questa "+s+ + " è stata generata a partire"; + if (single) result+=" dal seguente file:"; + else result+=" dai seguenti files:"; return result; } - QString trMore() + QCString trMore() { return "Continua..."; } - QString trReference() + QCString trReference() { return "Riferimento"; } - QString trListOfAllMembers() - { return "Lista di tuti i memberi."; } - QString trMemberList() - { return "Lista membri"; } - QString trThisIsTheListOfAllMembers() - { return "Questa e la lista completa di tutti i membri"; } - QString trIncludingInheritedMembers() - { return "includendo tutti i membri ereditati."; } - QString trGeneratedAutomatically(const char *s) - { QString result="Generato automaticalmenta da Doxygen"; - if (s) result+=(QString)" per "+s; - result+=" dall codice."; + QCString trListOfAllMembers() + { return "Lista di tutti i membri."; } + QCString trMemberList() + { return "Lista dei membri"; } + QCString trThisIsTheListOfAllMembers() + { return "Questa è la lista completa di tutti i membri di "; } + QCString trIncludingInheritedMembers() + { return ", includendo tutti i membri ereditati."; } + QCString trGeneratedAutomatically(const char *s) + { + QCString result="Generato automaticamente da Doxygen"; + if (s) result+=(QCString)" per "+s; + result+=" a partire dal codice sorgente."; return result; } - QString trEnumName() - { return "nome dell enum"; } - QString trEnumValue() - { return "valore dell enum"; } - QString trDefinedIn() + QCString trEnumName() + { return "nome di tipo enumerato"; } + QCString trEnumValue() + { return "valore di tipo enumerato"; } + QCString trDefinedIn() { return "definito in"; } - QString trIncludeFile() + QCString trIncludeFile() { return "Include il file"; } - QString trVerbatimText(const char *f) - { return (QString)"Questo e il contenuto verbatim dell file "+f+"."; } - QString trModules() + QCString trVerbatimText(const char *f) + { return (QCString)"Questo è il contenuto integrale dell file "+f+"."; } + QCString trModules() { return "Moduli"; } - QString trClassHierarchy() - { return "gerarchia delle classi"; } - QString trCompoundList() - { return "Lista dei tipi composti"; } - QString trFileList() - { return "Lista dei file"; } - QString trHeaderFiles() - { return "List dei fei file header"; } - QString trCompoundMembers() - { return "Membri composti"; } - QString trFileMembers() - { return "Membri dell file"; } - QString trRelatedPages() - { return "Relativo a pagina"; } - QString trExamples() - { return "Esempio"; } - QString trSearch() - { return "Ricerca"; } - QString trClassHierarchyDescription() - { return "Qua sono la lista delle classi, structs e unions" - "gesorte:"; + QCString trClassHierarchy() + { return "Gerarchia delle classi"; } + QCString trCompoundList() + { return "Lista dei composti"; } + QCString trFileList() + { return "Lista dei files"; } + QCString trHeaderFiles() + { return "Lista dei file header"; } + QCString trCompoundMembers() + { return "Membri dei composti"; } + QCString trFileMembers() + { return "Membri dei files"; } + QCString trRelatedPages() + { return "Pagine collegate"; } + QCString trExamples() + { return "Esempi"; } + QCString trSearch() + { return "Cerca"; } + QCString trClassHierarchyDescription() + { + return "Questa lista di ereditarietà è ordinata " + "approssimativamente, ma non completamente, in ordine alfabetico:"; } - QString trFileListDescription(bool extractAll) + QCString trFileListDescription(bool extractAll) { - QString result="Hieronder volgt de lijst met alle "; - if (!extractAll) result+="gedocumenteerde "; - result+="files, elk met een korte beschrijving:"; + QCString result="Questa è una lista "; + if (!extractAll) result+="dei files documentati "; + else result+="di tutti i files "; + result+="con una loro breve descrizione:"; return result; } - QString trCompoundListDescription() - { return "Hieronder volgen de klassen, structs en " - "unions met voor elk een korte beschrijving:"; + QCString trCompoundListDescription() + { return "Queste sono le classi, structs e " + "unions con una loro breve descrizione:"; } - QString trCompoundMembersDescription(bool extractAll) + QCString trCompoundMembersDescription(bool extractAll) { - QString result="Hieronder volgt de lijst met alle "; - if (!extractAll) result+="gedocumenteerde "; - result+="klasse members met links naar "; - if (extractAll) result+="de klasse Documentazione voor elke member:"; - else result+="de klassen waartoe ze behoren:"; + QCString result="Questa è una lista "; + if (!extractAll) result+="dei membri documentati, "; + else result+="di tutti i membri "; + result+="con collegamenti "; + if (extractAll) result+="alla documentazione della classe di ciascun membro:"; + else result+="alla documentazione delle classi a cui appartengono:"; return result; } - QString trFileMembersDescription(bool extractAll) + QCString trFileMembersDescription(bool extractAll) { - QString result="Hieronder volgt de lijst met alle "; - if (!extractAll) result+="gedocumenteerde "; - result+="file members met links naar "; - if (extractAll) result+="de file Documentazione voor elke member:"; - else result+="de files waartoe ze behoren:"; + QCString result="Questa è una lista "; + if (!extractAll) result+="dei membri dei files documentati, "; + else result+="di tutti i membri dei files "; + result+="con collegamenti "; + if (extractAll) result+="alla documentazione del file di ciascun membro:"; + else result+="alla documentazione dei files a cui appartengono:"; return result; } - QString trHeaderFilesDescription() - { return "Hieronder volgen de header files die de API vormen:"; } - QString trExamplesDescription() - { return "Hieronder volgt de lijst met alle voorbeelden:"; } - QString trRelatedPagesDescription() - { return "Hieronder volgt de lijst met alle pagina's die gerelateerde Documentazione bevatten:"; } - QString trModulesDescription() - { return "Hieronder volgt de lijst met alle modules:"; } - QString trNoDescriptionAvailable() - { return "Geen korte beschrijving beschikbaar"; } + QCString trHeaderFilesDescription() + { return "Questi sono gli header files che compongono l'API:"; } + QCString trExamplesDescription() + { return "Questa è la lista di tutti gli esempi:"; } + QCString trRelatedPagesDescription() + { return "Questa è la lista di tutte le pagine di documentazione collegate fra loro:"; } + QCString trModulesDescription() + { return "Questa è la lista di tutti i moduli:"; } + QCString trNoDescriptionAvailable() + { return "Descrizione non disponibile"; } - QString trDocumentation() + QCString trDocumentation() { return "Documentazione"; } - QString trModuleIndex() - { return "Module Index"; } - QString trHierarchicalIndex() - { return "Hiërarchische Index"; } - QString trCompoundIndex() - { return "Compound Index"; } - QString trFileIndex() - { return "File Index"; } - QString trModuleDocumentation() - { return "Module Documentazione"; } - QString trClassDocumentation() - { return "Klasse Documentazione"; } - QString trFileDocumentation() - { return "File Documentazione"; } - QString trExampleDocumentation() - { return "Documentazione di voorbeelden"; } - QString trPageDocumentation() - { return "Documentazione di gerelateerde pagina's"; } - QString trReferenceManual() - { return "Naslagwerk"; } + QCString trModuleIndex() + { return "Indice dei moduli"; } + QCString trHierarchicalIndex() + { return "Indice della gerarchia"; } + QCString trCompoundIndex() + { return "Indice dei composti"; } + QCString trFileIndex() + { return "Indice dei files"; } + QCString trModuleDocumentation() + { return "Documentazione dei moduli"; } + QCString trClassDocumentation() + { return "Documentazione delle classi"; } + QCString trFileDocumentation() + { return "Documentazione dei files"; } + QCString trExampleDocumentation() + { return "Documentazione degli esempi"; } + QCString trPageDocumentation() + { return "Documentazione delle pagine"; } + QCString trReferenceManual() + { return "Manuale di riferimento"; } - QString trDefines() - { return "Defines"; } - QString trFuncProtos() - { return "Functie Prototypes"; } - QString trTypedefs() + QCString trDefines() + { return "Definizioni"; } + QCString trFuncProtos() + { return "Prototipi delle funzioni"; } + QCString trTypedefs() { return "Typedefs"; } - QString trEnumerations() - { return "Enumeraties"; } - QString trFunctions() - { return "Functies"; } - QString trVariables() - { return "Variabelen"; } - QString trEnumerationValues() - { return "Enumeratie waarden"; } - QString trReimplementedFrom() - { return "Nieuwe implementatie di"; } - QString trReimplementedIn() - { return "Opnieuw geïmplementeerd in"; } - QString trAuthor() - { return "auteur"; } - QString trDefineDocumentation() - { return "Lista "; } - QString trFunctionPrototypeDocumentation() - { return "Documentazione di functie Prototypes"; } - QString trTypedefDocumentation() - { return "Documentazione di typedefs"; } - QString trEnumerationTypeDocumentation() - { return "Documentazione di enumeratie types"; } - QString trFunctionDocumentation() - { return "Documentazione di functies"; } - QString trVariableDocumentation() - { return "Lista variabelen"; } - QString trCompounds() - { return "Compounds"; } - QString trFiles() + QCString trEnumerations() + { return "Tipi enumerati"; } + QCString trFunctions() + { return "Funzioni"; } + QCString trVariables() + { return "Variabili"; } + QCString trEnumerationValues() + { return "Valori dei tipi enumerati"; } + QCString trReimplementedFrom() + { return "Nuova implementazione di"; } + QCString trReimplementedIn() + { return "Reimplementato in"; } + QCString trAuthor() + { return "Autore"; } + QCString trDefineDocumentation() + { return "Documentazione delle definizioni"; } + QCString trFunctionPrototypeDocumentation() + { return "Documentazione dei prototipi delle funzioni"; } + QCString trTypedefDocumentation() + { return "Documentazione dei typedefs"; } + QCString trEnumerationTypeDocumentation() + { return "Documentazione dei tipi enumerati"; } + QCString trFunctionDocumentation() + { return "Documentazione delle funzioni"; } + QCString trVariableDocumentation() + { return "Documentazione delle variabili"; } + QCString trCompounds() + { return "Composti"; } + QCString trFiles() { return "Files"; } - QString trGeneratedAt(const char *date,const char *projName) + QCString trGeneratedAt(const char *date,const char *projName) { - QString result=(QString)"Gegenereerd op "+date; - if (projName) result+=(QString)" voor "+projName; - result+=(QString)" door"; + QCString result=(QCString)"Generato il "+date; + if (projName) result+=(QCString)" per "+projName; + result+=(QCString)" da"; return result; } - QString trWrittenBy() + QCString trWrittenBy() { - return "geschreven door"; + return "scritto da"; } - QString trClassDiagram(const char *clName) + QCString trClassDiagram(const char *clName) { - return (QString)"Klasse diagram voor "+clName; + return (QCString)"Diagramma delle classi per "+clName; } - QString trForInternalUseOnly() - { return "Alleen voor intern gebruik."; } - QString trReimplementedForInternalReasons() - { return "Om interne rederene opnieuwd geïmplemented; " - "de API wordt er niet door beïnvloed."; + QCString trForInternalUseOnly() + { return "Solo per uso interno."; } + QCString trReimplementedForInternalReasons() + { return "Reimplementato per motivi interni; " + "l'API non è stata modificata."; } - QString trWarning() - { return "Waarschuwing"; } - QString trBugsAndLimitations() - { return "Fouten en beperkingen"; } - QString trVersion() - { return "Versie"; } - QString trDate() - { return "Datum"; } - QString trAuthors() - { return "Auteur(s)"; } - QString trReturns() - { return "Retourneerd"; } - QString trSeeAlso() - { return "Zie ook"; } - QString trParameters() - { return "Parameters"; } - QString trExceptions() - { return "Excepties"; } - QString trGeneratedBy() - { return "Gegenereerd door"; } + QCString trWarning() + { return "Attenzione"; } + QCString trBugsAndLimitations() + { return "Bugs e limitazioni"; } + QCString trVersion() + { return "Versione"; } + QCString trDate() + { return "Data"; } + QCString trAuthors() + { return "Autore(i)"; } + QCString trReturns() + { return "Restituisce"; } + QCString trSeeAlso() + { return "Vedi anche"; } + QCString trParameters() + { return "Parametri"; } + QCString trExceptions() + { return "Eccezioni"; } + QCString trGeneratedBy() + { return "Generato da"; } - // new since 0.49-990307 +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990307 +////////////////////////////////////////////////////////////////////////// - QString trNamespaces() + QCString trNamespaces() { return "Namespaces"; } - QString trNamespaceList() - { return "Namespace Lijst"; } - QString trNamespaceListDescription(bool extractAll) + QCString trNamespaceList() + { return "Lista dei namespaces"; } + QCString trNamespaceListDescription(bool extractAll) { - QString result="Hier is een lijst met alle "; - if (!extractAll) result+="gedocumenteerde "; - result+="namespaces met voor elk een korte beschrijving:"; + QCString result="Questa è la lista "; + if (!extractAll) result+="dei namespaces documentati, "; + else result+="di tutti i namespaces "; + result+="con una loro breve descrizione:"; return result; } - QString trFriends() + QCString trFriends() { return "Friends"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990405 +////////////////////////////////////////////////////////////////////////// + + QCString trRelatedFunctionDocumentation() + { return "Documentazione dei friends e delle funzioni collegate"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990425 +////////////////////////////////////////////////////////////////////////// + + QCString trCompoundReference(const char *clName, + ClassDef::CompoundType compType) + { + QCString result="Riferimenti per la"; + switch(compType) + { + case ClassDef::Class: result+=" classe"; break; + case ClassDef::Struct: result+=" struct"; break; + case ClassDef::Union: result+=" union"; break; + } + result+=" "+(QCString)clName; + return result; + } + QCString trFileReference(const char *fileName) + { + QCString result="Riferimenti per il file "; + result+=(QCString)fileName; + return result; + } + QCString trNamespaceReference(const char *namespaceName) + { + QCString result="Riferimenti per il namespace "; + result+=(QCString)namespaceName; + return result; + } + + // these are for the member sections of a class, struct or union + QCString trPublicMembers() + { return "Membri pubblici"; } + QCString trPublicSlots() + { return "Slots pubblici"; } + QCString trSignals() + { return "Signals"; } + QCString trStaticPublicMembers() + { return "Membri pubblici statici"; } + QCString trProtectedMembers() + { return "Membri protetti"; } + QCString trProtectedSlots() + { return "Slots protetti"; } + QCString trStaticProtectedMembers() + { return "Membri protetti statici"; } + QCString trPrivateMembers() + { return "Membri privati"; } + QCString trPrivateSlots() + { return "Slots privati"; } + QCString trStaticPrivateMembers() + { return "Membri privati statici"; } + + + QCString trInheritsList(int numEntries) + { + return "Eredita da "+trWriteList(numEntries)+"."; + } + QCString trInheritedByList(int numEntries) + { + return "Base per "+trWriteList(numEntries)+"."; + } + QCString trReimplementedFromList(int numEntries) + { + return "Reimplementa "+trWriteList(numEntries)+"."; + } + QCString trReimplementedInList(int numEntries) + { + return "Reimplementata in "+trWriteList(numEntries)+"."; + } + + QCString trNamespaceMembers() + { return "Membri dei namespaces"; } + QCString trNamespaceMemberDescription(bool extractAll) + { + QCString result="Questa è la lista "; + if (!extractAll) result+="dei membri dei namespaces documentati, "; + else result+="di tutti i membri dei namespaces "; + result+="con collegamenti "; + if (extractAll) + result+="alla documentazione del namespace per ciascun membro:"; + else + result+="ai namespaces a cui appartengono:"; + return result; + } + QCString trNamespaceIndex() + { return "Indice dei namespaces"; } + QCString trNamespaceDocumentation() + { return "Documentazione dei namespaces"; } }; #endif diff --git a/src/translator_jp.h b/src/translator_jp.h new file mode 100644 index 0000000..a2e2bfd --- /dev/null +++ b/src/translator_jp.h @@ -0,0 +1,268 @@ +/****************************************************************************** + * + * $Id$ + * + * Copyright (C) 1997-1999 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. + * + * All output generated with Doxygen is not covered by this license. + * + */ + +#ifndef TRANSLATOR_JP_H +#define TRANSLATOR_JP_H + +#include "translator.h" + +class TranslatorJapanese : public Translator +{ + public: + QCString latexBabelPackage() + { return "a4j"; } + QCString trInherits() + { return "·Ñ¾µ"; } + QCString trAnd() + { return "¤È"; } + QCString trInheritedBy() + { return "¼¡¤Ë·Ñ¾µ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£"; } + QCString trRelatedFunctions() + { return "´ØÏ¢¤¹¤ë´Ø¿ô"; } + QCString trRelatedSubscript() + { return "¡Ê¤³¤ì¤é¤Ï¥á¥ó¥Ð´Ø¿ô¤Ç¤Ê¤¤¤³¤È¤ËÃí°Õ¡Ë"; } + QCString trDetailedDescription() + { return "²òÀâ"; } + QCString trMemberTypedefDocumentation() + { return "¥á¥ó¥Ð·¿ÄêµÁ¤Î²òÀâ"; } + QCString trMemberEnumerationDocumentation() + { return "¥á¥ó¥ÐÎóµó·¿¤Î²òÀâ"; } + QCString trEnumerationValueDocumentation() + { return "Îóµó·¿ÃͤβòÀâ"; } + QCString trMemberFunctionDocumentation() + { return "¥á¥ó¥Ð´Ø¿ô¤Î²òÀâ"; } + QCString trMemberDataDocumentation() + { return "¥á¥ó¥Ð¥Ç¡¼¥¿¤Î²òÀâ"; } + QCString trGeneratedFrom(const char *s,bool) + { + QCString result=(QCString)"¤³¤Î"+s+ + "¤ËÂФ¹¤ë¥É¥¥å¥á¥ó¥È¤Ï°Ê²¼¤Î¥Õ¥¡¥¤¥ë¤«¤éÀ¸À®¤µ¤ì¤Þ¤·¤¿¡£"; + return result; + } + QCString trMore() + { return "¤è¤ê¾Ü¤·¤¯..."; } + QCString trReference() + { return "¥ê¥Õ¥¡¥ì¥ó¥¹"; } + QCString trListOfAllMembers() + { return "¤¹¤Ù¤Æ¤Î¥á¥ó¥Ð¥ê¥¹¥È"; } + QCString trMemberList() + { return "¥á¥ó¥Ð¥ê¥¹¥È"; } + QCString trThisIsTheListOfAllMembers() + { return "¤³¤ì¤Ï¼¡¤ÎÁ´¥á¥ó¥Ð¥ê¥¹¥È¤Ç¤¹¡£"; } + QCString trIncludingInheritedMembers() + { return "·Ñ¾µ¥á¥ó¥Ð¤¹¤Ù¤Æ¤ò´Þ¤ó¤Ç¡£"; } + QCString trGeneratedAutomatically(const char *s) + { QCString result; + if (s) result=(QCString)s+"¤ËÂФ·¤Æ"; + result+="¥½¡¼¥¹¥³¡¼¥É¤«¤é Doxygen ¤¬¼«Æ°Åª¤ËÀ¸À®¤·¤Þ¤·¤¿¡£"; + return result; + } + QCString trEnumName() + { return "enum ·¿"; } + QCString trEnumValue() + { return "enum ÃÍ"; } + QCString trDefinedIn() + { return "¼¡¤ÇÄêµÁ¤µ¤ì¤Þ¤·¤¿¡£"; } + QCString trIncludeFile() + { return "¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë"; } + QCString trVerbatimText(const char *f) + { return (QCString)"¤³¤ì¤Ï¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë"+f+ + "¤Î Verbatim ¥Æ¥¥¹¥È¤Ç¤¹¡£"; } + QCString trModules() + { return "¥â¥¸¥å¡¼¥ë"; } + QCString trClassHierarchy() + { return "¥¯¥é¥¹³¬ÁØ"; } + QCString trCompoundList() + { return "¥Ç¡¼¥¿¹½Â¤¥ê¥¹¥È"; } + QCString trFileList() + { return "¥Õ¥¡¥¤¥ë¥ê¥¹¥È"; } + QCString trHeaderFiles() + { return "¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë"; } + QCString trCompoundMembers() + { return "¥Ç¡¼¥¿¹½Â¤¥á¥ó¥Ð"; } + QCString trFileMembers() + { return "¥Õ¥¡¥¤¥ë¥á¥ó¥Ð"; } + QCString trRelatedPages() + { return "´ØÏ¢¥Ú¡¼¥¸"; } + QCString trExamples() + { return "Îã"; } + QCString trSearch() + { return "¸¡º÷"; } + QCString trClassHierarchyDescription() + { return "¤³¤Î·Ñ¾µ¥ê¥¹¥È¤Ï¤ª¤ª¤Þ¤«¤Ë¤Ï¥½¡¼¥È¤µ¤ì¤Æ¤¤¤Þ¤¹¤¬¡¢" + "¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤Ç´°Á´¤Ë¥½¡¼¥È¤µ¤ì¤Æ¤Ï¤¤¤Þ¤»¤ó¡£"; + } + QCString trFileListDescription(bool extractAll) + { + QCString result="¤³¤Î¥ê¥¹¥È¤Ï¡¢"; + if (!extractAll) result+="¥É¥¥å¥á¥ó¥È²½¤µ¤ì¡¢"; + result+="´Ê°×ÀâÌÀ¤ò»ý¤Ä¥Õ¥¡¥¤¥ë¤¹¤Ù¤Æ¤Î¥ê¥¹¥È¤Ç¤¹¡£"; + return result; + } + QCString trCompoundListDescription() + { return "¤³¤ì¤Ï´Ê°×ÀâÌÀ¤ò»ý¤Ä¡¢¥¯¥é¥¹¡¢¹½Â¤ÂΡ¢¶¦ÍÑÂΤΥꥹ¥È¤Ç¤¹¡£";} + QCString trCompoundMembersDescription(bool extractAll) + { + QCString result="¤³¤ì¤Ï"; + if (!extractAll) result+="¥É¥¥å¥á¥ó¥È²½¤µ¤ì¤¿"; + result+="¥¯¥é¥¹¥á¥ó¥Ð¤¹¤Ù¤Æ¤Î¥ê¥¹¥È¤Ç¡¢¤½¤ì¤¾¤ì"; + if (extractAll) result+="¤¬Â°¤·¤Æ¤¤¤ë¥¯¥é¥¹"; + result+="¤Î²òÀâ¤Ø¤Î¥ê¥ó¥¯¤¬Ä¥¤é¤ì¤Æ¤¤¤Þ¤¹¡£"; + return result; + } + QCString trFileMembersDescription(bool extractAll) + { + QCString result="¤³¤ì¤Ï"; + if (!extractAll) result+="¥É¥¥å¥á¥ó¥È²½¤µ¤ì¤¿"; + result+="¥Õ¥¡¥¤¥ë¥á¥ó¥Ð¤¹¤Ù¤Æ¤Î¥ê¥¹¥È¤Ç¡¢¤½¤ì¤¾¤ì"; + if (extractAll) result+="¤¬Â°¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë"; + result+="¤Î²òÀâ¤Ø¤Î¥ê¥ó¥¯¤¬Ä¥¤é¤ì¤Æ¤¤¤Þ¤¹¡£"; + return result; + } + QCString trHeaderFilesDescription() + { return "API¤ò¹½À®¤¹¤ë¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Ç¤¹¡£"; } + QCString trExamplesDescription() + { return "¤¹¤Ù¤Æ¤ÎÎã¤Î¥ê¥¹¥È¤Ç¤¹¡£"; } + QCString trRelatedPagesDescription() + { return "´ØÏ¢¤¹¤ë¥É¥¥å¥á¥ó¥È¥Ú¡¼¥¸¤¹¤Ù¤Æ¤Î¥ê¥¹¥È¤Ç¤¹¡£"; } + QCString trModulesDescription() + { return "¤¹¤Ù¤Æ¤Î¥â¥¸¥å¡¼¥ë¤Î¥ê¥¹¥È¤Ç¤¹¡£"; } + QCString trNoDescriptionAvailable() + { return "¥É¥¥å¥á¥ó¥È¤¬µ½Ò¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£"; } + + QCString trDocumentation() + { return "¥É¥¥å¥á¥ó¥È"; } + QCString trModuleIndex() + { return "¥â¥¸¥å¡¼¥ëº÷°ú"; } + QCString trHierarchicalIndex() + { return "³¬Áغ÷°ú"; } + QCString trCompoundIndex() + { return "¥Ç¡¼¥¿¹½Â¤º÷°ú"; } + QCString trFileIndex() + { return "¥Õ¥¡¥¤¥ëº÷°ú"; } + QCString trModuleDocumentation() + { return "¥â¥¸¥å¡¼¥ë¤Î²òÀâ"; } + QCString trClassDocumentation() + { return "¥¯¥é¥¹¤Î²òÀâ"; } + QCString trFileDocumentation() + { return "¥Õ¥¡¥¤¥ë¤Î²òÀâ"; } + QCString trExampleDocumentation() + { return "ÎãÂê¤Î²òÀâ"; } + QCString trPageDocumentation() + { return "¥Ú¡¼¥¸¤Î²òÀâ"; } + QCString trReferenceManual() + { return "¥ê¥Õ¥¡¥ì¥ó¥¹¥Þ¥Ë¥å¥¢¥ë"; } + + QCString trDefines() + { return "¥Þ¥¯¥íÄêµÁ"; } + QCString trFuncProtos() + { return "´Ø¿ô¥×¥í¥È¥¿¥¤¥×"; } + QCString trTypedefs() + { return "·¿ÄêµÁ"; } + QCString trEnumerations() + { return "Îóµó·¿"; } + QCString trFunctions() + { return "´Ø¿ô"; } + QCString trVariables() + { return "ÊÑ¿ô"; } + QCString trEnumerationValues() + { return "Îóµó·¿ÃÍ"; } + QCString trReimplementedFrom() + { return "¼¡¤òºÆÄêµÁ"; } + QCString trReimplementedIn() + { return "¼¡¤ÇºÆÄêµÁ"; } + QCString trAuthor() + { return "ºî¼Ô"; } + QCString trDefineDocumentation() + { return "¥Þ¥¯¥íÄêµÁ¤Î²òÀâ"; } + QCString trFunctionPrototypeDocumentation() + { return "´Ø¿ô¥×¥í¥È¥¿¥¤¥×¤Î²òÀâ"; } + QCString trTypedefDocumentation() + { return "·¿ÄêµÁ¤Î²òÀâ"; } + QCString trEnumerationTypeDocumentation() + { return "Îóµó·¿¤Î²òÀâ"; } + QCString trFunctionDocumentation() + { return "´Ø¿ô¤Î²òÀâ"; } + QCString trVariableDocumentation() + { return "ÊÑ¿ô¤Î²òÀâ"; } + QCString trCompounds() + { return "¥Ç¡¼¥¿¹½Â¤"; } + QCString trFiles() + { return "¥Õ¥¡¥¤¥ë"; } + QCString trGeneratedAt(const char *date,const char *projName) + { + QCString result; + if (projName) result+=(QCString)projName+"¤ËÂФ·¤Æ"; + result+=(QCString)date+"¤ËÀ¸À®¤µ¤ì¤Þ¤·¤¿¡£"; + return result; + } + QCString trWrittenBy() + { + return "¤ò³«È¯¤·¤¿¤Î¤Ï"; + } + QCString trClassDiagram(const char *clName) + { + return (QCString)clName+"¤ËÂФ¹¤ë¥¯¥é¥¹³¬ÁØ¿Þ"; + } + QCString trForInternalUseOnly() + { return "ÆâÉô»ÈÍѤΤߡ£"; } + QCString trReimplementedForInternalReasons() + { return "ÆâÉôŪ¤ÊÍýͳ¤Ë¤è¤êºÆ¼ÂÁõ¤µ¤ì¤Þ¤·¤¿¤¬¡¢API¤Ë¤Ï±Æ¶Á¤·¤Þ¤»¤ó¡£"; + } + QCString trWarning() + { return "Ãí°Õ"; } + QCString trBugsAndLimitations() + { return "¥Ð¥°¤ÈÀ©¸Â"; } + QCString trVersion() + { return "¥Ð¡¼¥¸¥ç¥ó"; } + QCString trDate() + { return "ÆüÉÕ"; } + QCString trAuthors() + { return "ºî¼Ô"; } + QCString trReturns() + { return "Ìá¤êÃÍ"; } + QCString trSeeAlso() + { return "»²¾È"; } + QCString trParameters() + { return "°ú¿ô"; } + QCString trExceptions() + { return "Îã³°"; } + QCString trGeneratedBy() + { return ""; } + + // new since 0.49-990307 + + QCString trNamespaces() + { return "̾Á°¶õ´Ö"; } + QCString trNamespaceList() + { return "̾Á°¶õ´Ö¥ê¥¹¥È"; } + QCString trNamespaceListDescription(bool extractAll) + { + QCString result="¤³¤Î¥ê¥¹¥È¤Ï¡¢´Ê°×ÀâÌÀ¤ò»ý¤Ä¤¹¤Ù¤Æ¤Î"; + if (!extractAll) result+="¥É¥¥å¥á¥ó¥È²½¤µ¤ì¤¿"; + result+="̾Á°¶õ´Ö¤Î¥ê¥¹¥È¤Ç¤¹¡£"; + return result; + } + QCString trFriends() + { return "¥Õ¥ì¥ó¥É"; } + + // new since 0.49-990405 + + virtual QCString trRelatedFunctionDocumentation() + { return "¥Õ¥ì¥ó¥É¤È´ØÏ¢¤¹¤ë´Ø¿ô¤Î²òÀâ"; } +}; + +#endif diff --git a/src/translator_nl.h b/src/translator_nl.h index c9a96bc..f5ceea9 100644 --- a/src/translator_nl.h +++ b/src/translator_nl.h @@ -17,253 +17,253 @@ #ifndef TRANSLATOR_NL_H #define TRANSLATOR_NL_H -#include <qstring.h> +#include "translator.h" class TranslatorDutch : public Translator { public: - QString latexBabelPackage() + QCString latexBabelPackage() { return "dutch"; } - QString trRelatedFunctions() + QCString trRelatedFunctions() { return "Gerelateerde functies"; } - QString trRelatedSubscript() + QCString trRelatedSubscript() { return "(Merk op dat dit geen member functies zijn.)"; } - QString trDetailedDescription() + QCString trDetailedDescription() { return "Gedetaileerde Beschrijving"; } - QString trMemberTypedefDocumentation() + QCString trMemberTypedefDocumentation() { return "Documentatie van type definitie members"; } - QString trMemberEnumerationDocumentation() + QCString trMemberEnumerationDocumentation() { return "Documentatie van enumeratie members"; } - QString trEnumerationValueDocumentation() + QCString trEnumerationValueDocumentation() { return "Documentatie van enumeratie waarden"; } - QString trMemberFunctionDocumentation() + QCString trMemberFunctionDocumentation() { return "Documentatie van functie members"; } - QString trMemberDataDocumentation() + QCString trMemberDataDocumentation() { return "Documentatie van data members"; } - QString trGeneratedFrom(const char *s,bool single) + QCString trGeneratedFrom(const char *s,bool single) { - QString result=(QString)"De documentatie voor deze"+s+ + QCString result=(QCString)"De documentatie voor deze"+s+ " is gegenereerd op grond van de volgende file"; if (single) result+=":"; else result+="s:"; return result; } - QString trMore() + QCString trMore() { return "Meer..."; } - QString trListOfAllMembers() + QCString trListOfAllMembers() { return "Lijst van alle members."; } - QString trMemberList() + QCString trMemberList() { return "Member Lijst"; } - QString trThisIsTheListOfAllMembers() + QCString trThisIsTheListOfAllMembers() { return "Dit is de complete lijst van alle members voor"; } - QString trIncludingInheritedMembers() + QCString trIncludingInheritedMembers() { return ", inclusief alle overgeërfde members."; } - QString trGeneratedAutomatically(const char *s) - { QString result="Automatisch gegenereerd door Doxygen"; - if (s) result+=(QString)" voor "+s; + QCString trGeneratedAutomatically(const char *s) + { QCString result="Automatisch gegenereerd door Doxygen"; + if (s) result+=(QCString)" voor "+s; result+=" uit de programmacode."; return result; } - QString trEnumName() + QCString trEnumName() { return "enum naam"; } - QString trEnumValue() + QCString trEnumValue() { return "enum waarde"; } - QString trDefinedIn() + QCString trDefinedIn() { return "gedefinieerd in"; } - QString trVerbatimText(const char *f) - { return (QString)"Dit is de letterlijke tekst van de include file "+f+"."; } - QString trModules() + QCString trVerbatimText(const char *f) + { return (QCString)"Dit is de letterlijke tekst van de include file "+f+"."; } + QCString trModules() { return "Modules"; } - QString trClassHierarchy() + QCString trClassHierarchy() { return "Klasse Hiërarchie"; } - QString trCompoundList() + QCString trCompoundList() { return "Compound Lijst"; } - QString trFileList() + QCString trFileList() { return "File Lijst"; } - QString trHeaderFiles() + QCString trHeaderFiles() { return "Header Lijst"; } - QString trCompoundMembers() + QCString trCompoundMembers() { return "Compound Members"; } - QString trFileMembers() + QCString trFileMembers() { return "File members"; } - QString trRelatedPages() + QCString trRelatedPages() { return "Gerelateerde pagina's"; } - QString trExamples() + QCString trExamples() { return "Voorbeelden"; } - QString trSearch() + QCString trSearch() { return "Zoeken"; } - QString trClassHierarchyDescription() + QCString trClassHierarchyDescription() { return "Deze inheritance lijst is min of meer alfabetisch " "gesorteerd:"; } - QString trFileListDescription(bool extractAll) + QCString trFileListDescription(bool extractAll) { - QString result="Hieronder volgt de lijst met alle "; + QCString result="Hieronder volgt de lijst met alle "; if (!extractAll) result+="gedocumenteerde "; result+="files, elk met een korte beschrijving:"; return result; } - QString trCompoundListDescription() + QCString trCompoundListDescription() { return "Hieronder volgen de klassen, structs en " "unions met voor elk een korte beschrijving:"; } - QString trCompoundMembersDescription(bool extractAll) + QCString trCompoundMembersDescription(bool extractAll) { - QString result="Hieronder volgt de lijst met alle "; + QCString result="Hieronder volgt de lijst met alle "; if (!extractAll) result+="gedocumenteerde "; result+="klasse members met links naar "; if (extractAll) result+="de klasse documentatie voor elke member:"; else result+="de klassen waartoe ze behoren:"; return result; } - QString trFileMembersDescription(bool extractAll) + QCString trFileMembersDescription(bool extractAll) { - QString result="Hieronder volgt de lijst met alle "; + QCString result="Hieronder volgt de lijst met alle "; if (!extractAll) result+="gedocumenteerde "; result+="file members met links naar "; if (extractAll) result+="de file documentatie voor elke member:"; else result+="de files waartoe ze behoren:"; return result; } - QString trHeaderFilesDescription() + QCString trHeaderFilesDescription() { return "Hieronder volgen de header files die de API vormen:"; } - QString trExamplesDescription() + QCString trExamplesDescription() { return "Hieronder volgt de lijst met alle voorbeelden:"; } - QString trRelatedPagesDescription() + QCString trRelatedPagesDescription() { return "Hieronder volgt de lijst met alle pagina's die gerelateerde documentatie bevatten:"; } - QString trModulesDescription() + QCString trModulesDescription() { return "Hieronder volgt de lijst met alle modules:"; } - QString trNoDescriptionAvailable() + QCString trNoDescriptionAvailable() { return "Geen korte beschrijving beschikbaar"; } - QString trDocumentation() + QCString trDocumentation() { return "Documentatie"; } - QString trModuleIndex() + QCString trModuleIndex() { return "Module Index"; } - QString trHierarchicalIndex() + QCString trHierarchicalIndex() { return "Hiërarchische Index"; } - QString trCompoundIndex() + QCString trCompoundIndex() { return "Compound Index"; } - QString trFileIndex() + QCString trFileIndex() { return "File Index"; } - QString trModuleDocumentation() + QCString trModuleDocumentation() { return "Module Documentatie"; } - QString trClassDocumentation() + QCString trClassDocumentation() { return "Klasse Documentatie"; } - QString trFileDocumentation() + QCString trFileDocumentation() { return "File Documentatie"; } - QString trExampleDocumentation() + QCString trExampleDocumentation() { return "Documentatie van voorbeelden"; } - QString trPageDocumentation() + QCString trPageDocumentation() { return "Documentatie van gerelateerde pagina's"; } - QString trReferenceManual() + QCString trReferenceManual() { return "Naslagwerk"; } - QString trDefines() + QCString trDefines() { return "Defines"; } - QString trFuncProtos() + QCString trFuncProtos() { return "Functie Prototypes"; } - QString trTypedefs() + QCString trTypedefs() { return "Typedefs"; } - QString trEnumerations() + QCString trEnumerations() { return "Enumeraties"; } - QString trFunctions() + QCString trFunctions() { return "Functies"; } - QString trVariables() + QCString trVariables() { return "Variabelen"; } - QString trEnumerationValues() + QCString trEnumerationValues() { return "Enumeratie waarden"; } - QString trAuthor() + QCString trAuthor() { return "auteur"; } - QString trDefineDocumentation() + QCString trDefineDocumentation() { return "Documentatie van defines"; } - QString trFunctionPrototypeDocumentation() + QCString trFunctionPrototypeDocumentation() { return "Documentatie van functie Prototypes"; } - QString trTypedefDocumentation() + QCString trTypedefDocumentation() { return "Documentatie van typedefs"; } - QString trEnumerationTypeDocumentation() + QCString trEnumerationTypeDocumentation() { return "Documentatie van enumeratie types"; } - QString trFunctionDocumentation() + QCString trFunctionDocumentation() { return "Documentatie van functies"; } - QString trVariableDocumentation() + QCString trVariableDocumentation() { return "Documentatie van variabelen"; } - QString trCompounds() + QCString trCompounds() { return "Compounds"; } - QString trFiles() + QCString trFiles() { return "Files"; } - QString trGeneratedAt(const char *date,const char *projName) + QCString trGeneratedAt(const char *date,const char *projName) { - QString result=(QString)"Gegenereerd op "+date; - if (projName) result+=(QString)" voor "+projName; - result+=(QString)" door"; + QCString result=(QCString)"Gegenereerd op "+date; + if (projName) result+=(QCString)" voor "+projName; + result+=(QCString)" door"; return result; } - QString trWrittenBy() + QCString trWrittenBy() { return "geschreven door"; } - QString trClassDiagram(const char *clName) + QCString trClassDiagram(const char *clName) { - return (QString)"Klasse diagram voor "+clName; + return (QCString)"Klasse diagram voor "+clName; } - QString trForInternalUseOnly() + QCString trForInternalUseOnly() { return "Alleen voor intern gebruik."; } - QString trReimplementedForInternalReasons() + QCString trReimplementedForInternalReasons() { return "Om interne rederene opnieuwd geïmplemented; " "de API wordt er niet door beïnvloed."; } - QString trWarning() + QCString trWarning() { return "Waarschuwing"; } - QString trBugsAndLimitations() + QCString trBugsAndLimitations() { return "Fouten en beperkingen"; } - QString trVersion() + QCString trVersion() { return "Versie"; } - QString trDate() + QCString trDate() { return "Datum"; } - QString trAuthors() + QCString trAuthors() { return "Auteur(s)"; } - QString trReturns() + QCString trReturns() { return "Retourneerd"; } - QString trSeeAlso() + QCString trSeeAlso() { return "Zie ook"; } - QString trParameters() + QCString trParameters() { return "Parameters"; } - QString trExceptions() + QCString trExceptions() { return "Excepties"; } - QString trGeneratedBy() + QCString trGeneratedBy() { return "Gegenereerd door"; } ////////////////////////////////////////////////////////////////////////// // new since 0.49-990307 ////////////////////////////////////////////////////////////////////////// - QString trNamespaceList() + QCString trNamespaceList() { return "Namespace Lijst"; } - QString trNamespaceListDescription(bool extractAll) + QCString trNamespaceListDescription(bool extractAll) { - QString result="Hier is een lijst met alle "; + QCString result="Hier is een lijst met alle "; if (!extractAll) result+="gedocumenteerde "; result+="namespaces met voor elk een korte beschrijving:"; return result; } - QString trFriends() + QCString trFriends() { return "Friends"; } ////////////////////////////////////////////////////////////////////////// // new since 0.49-990405 ////////////////////////////////////////////////////////////////////////// - QString trRelatedFunctionDocumentation() + QCString trRelatedFunctionDocumentation() { return "Documentatie van friends en gerelateerde functies"; } ////////////////////////////////////////////////////////////////////////// // new since 0.49-990425 ////////////////////////////////////////////////////////////////////////// - virtual QString trCompoundReference(const char *clName, + virtual QCString trCompoundReference(const char *clName, ClassDef::CompoundType compType) // used as the title of the HTML page of a class/struct/union { - QString result=(QString)clName+" "; + QCString result=(QCString)clName+" "; switch(compType) { case ClassDef::Class: result+=" Class"; break; @@ -273,49 +273,49 @@ class TranslatorDutch : public Translator result+=" Referentie"; return result; } - virtual QString trFileReference(const char *fileName) + virtual QCString trFileReference(const char *fileName) // used as the title of the HTML page of a file { - QString result=fileName; + QCString result=fileName; result+=" File Referentie"; return result; } - virtual QString trNamespaceReference(const char *namespaceName) + virtual QCString trNamespaceReference(const char *namespaceName) // used as the title of the HTML page of a namespace { - QString result=namespaceName; + QCString result=namespaceName; result+=" Namespace Referentie"; return result; } // these are for the member sections of a class, struct or union - virtual QString trPublicMembers() + virtual QCString trPublicMembers() { return "Public Members"; } - virtual QString trPublicSlots() + virtual QCString trPublicSlots() { return "Public Slots"; } - virtual QString trSignals() + virtual QCString trSignals() { return "Signals"; } - virtual QString trStaticPublicMembers() + virtual QCString trStaticPublicMembers() { return "Static Public Members"; } - virtual QString trProtectedMembers() + virtual QCString trProtectedMembers() { return "Protected Members"; } - virtual QString trProtectedSlots() + virtual QCString trProtectedSlots() { return "Protected Slots"; } - virtual QString trStaticProtectedMembers() + virtual QCString trStaticProtectedMembers() { return "Static Protected Members"; } - virtual QString trPrivateMembers() + virtual QCString trPrivateMembers() { return "Private Members"; } - virtual QString trPrivateSlots() + virtual QCString trPrivateSlots() { return "Private Slots"; } - virtual QString trStaticPrivateMembers() + virtual QCString trStaticPrivateMembers() { return "Static Private Members"; } // end of member sections - virtual QString trWriteList(int numEntries) + virtual QCString trWriteList(int numEntries) { // this function is used to produce a comma-separated list of items. // use generateMarker(i) to indicate where item i should be put. - QString result; + QCString result; int i; // the inherits list contain `numEntries' classes for (i=0;i<numEntries;i++) @@ -335,38 +335,38 @@ class TranslatorDutch : public Translator return result; } - virtual QString trInheritsList(int numEntries) + virtual QCString trInheritsList(int numEntries) // used in class documentation to produce a list of base classes, // if class diagrams are disabled. { return "Erft over van "+trWriteList(numEntries)+"."; } - virtual QString trInheritedByList(int numEntries) + virtual QCString trInheritedByList(int numEntries) // used in class documentation to produce a list of super classes, // if class diagrams are disabled. { return "Wordt overgeërfd door "+trWriteList(numEntries)+"."; } - virtual QString trReimplementedFromList(int numEntries) + virtual QCString trReimplementedFromList(int numEntries) // used in member documentation blocks to produce a list of // members that are hidden by this one. { return "Nieuwe implementatie van "+trWriteList(numEntries)+"."; } - virtual QString trReimplementedInList(int numEntries) + virtual QCString trReimplementedInList(int numEntries) { // used in member documentation blocks to produce a list of // all member that overwrite the implementation of this member. return "Opnieuw geïmplementeerd in "+trWriteList(numEntries)+"."; } - virtual QString trNamespaceMembers() + virtual QCString trNamespaceMembers() // This is put above each page as a link to all members of namespaces. { return "Namespace Members"; } - virtual QString trNamespaceMemberDescription(bool extractAll) + virtual QCString trNamespaceMemberDescription(bool extractAll) // This is an introduction to the page with all namespace members { - QString result="Hier is een lijst van alle "; + QCString result="Hier is een lijst van alle "; if (!extractAll) result+="gedocumenteerde "; result+="namespace members met links naar "; if (extractAll) @@ -375,11 +375,11 @@ class TranslatorDutch : public Translator result+="de namespaces waartoe ze behoren:"; return result; } - virtual QString trNamespaceIndex() + virtual QCString trNamespaceIndex() // This is used in LaTeX as the title of the chapter with the // index of all namespaces. { return "Namespace Index"; } - virtual QString trNamespaceDocumentation() + virtual QCString trNamespaceDocumentation() // This is used in LaTeX as the title of the chapter containing // the documentation of all namespaces. { return "Namespace Documentatie"; } diff --git a/src/translator_se.h b/src/translator_se.h index 4f24e0f..761d81d 100644 --- a/src/translator_se.h +++ b/src/translator_se.h @@ -14,245 +14,484 @@ * */ -/*------------------------------------------------------------------------- +/* +================================================================================== Svensk översättning av: Samuel Hägglund <sahag96@ite.mh.se> Xet Erixon <xet@xeqt.com> +================================================================================== +Uppdateringar. +1999/04/29 +* Omskrivningar av en hel del ordval, t.ex. + ENG INNAN EFTER + compound inhängnad sammansatt + structs structs strukter + unions unions unioner -Skicka gärna synpunkter. ---------------------------------------------------------------------------*/ + osv... + +* Alla översättnings-strängar returnerar i alla fall en något så när vettig + förklaring... + +1999/05/27 +* Det verkade som vi glömt en del mellanslag i vissa strängar vilket resulterade + i att en del ord blev ihopskrivna. + +* Bytt en del ordval igen... + ENG INNAN EFTER + reference manual Uppslagsbok referensmanual + +* Skrivit ihop en del ord som innan hade bindestreck +* En del nya översättningar är tillagda. +* Gamla översättningar borttagna + +=================================================================================== +Problem! + Namespace och slot: har de nån hygglig svensk översättning??? + + Skicka gärna synpunkter. +=================================================================================== +*/ #ifndef TRANSLATOR_SE_H #define TRANSLATOR_SE_H -#include <qstring.h> +#include "translator.h" class TranslatorSwedish : public Translator { public: - QString latexBabelPackage() + QCString latexBabelPackage() { return "swedish"; } - QString trInherits() - { return "Ärver"; } - QString trAnd() - { return "och"; } - QString trInheritedBy() - { return "Ärvd av"; } - QString trRelatedFunctions() + + QCString trRelatedFunctions() { return "Besläktade funktioner"; } - QString trRelatedSubscript() + + QCString trRelatedSubscript() { return "(Observera att dessa inte är medlemsfunktioner)"; } - QString trDetailedDescription() + + QCString trDetailedDescription() { return "Detaljerad beskrivning"; } - QString trMemberTypedefDocumentation() + + QCString trMemberTypedefDocumentation() { return "Dokumentation över typdefinierade medlemmar"; } - QString trMemberEnumerationDocumentation() + + QCString trMemberEnumerationDocumentation() { return "Dokumentation över egenuppräknande medlemmar"; } - QString trMemberFunctionDocumentation() + + QCString trMemberFunctionDocumentation() { return "Dokumentation över medlemsfunktioner"; } - QString trMemberDataDocumentation() + + QCString trMemberDataDocumentation() { return "Dokumentation över datamedlemmar"; } - QString trGeneratedFrom(const char *s,bool single) + + QCString trGeneratedFrom(const char *s,bool single) { - QString result=(QString)"Dokumentationen för denna"+s+ + + QCString result=(QCString)"Dokumentationen för denna"+s+ " är skapad utifrån följande fil"; if (single) result+=":"; else result+="er:"; return result; } - QString trMore() + QCString trMore() { return "Mer..."; } - QString trReference() - { return "Referens"; } - QString trListOfAllMembers() + + QCString trListOfAllMembers() { return "Lista över alla medlemmar."; } - QString trMemberList() + + QCString trMemberList() { return "Medlemslista"; } - QString trThisIsTheListOfAllMembers() - { return "Det här är en fullständig lista över medlemmar för"; } - QString trIncludingInheritedMembers() - { return "med alla ärvda medlemmar."; } - QString trGeneratedAutomatically(const char *s) - { QString result="Automatiskt skapad av Doxygen"; - if (s) result+=(QString)" för "+s; + + QCString trThisIsTheListOfAllMembers() + { return "Det här är en fullständig lista över medlemmar för "; } + + QCString trIncludingInheritedMembers() + { return " med alla ärvda medlemmar."; } + + QCString trGeneratedAutomatically(const char *s) + { QCString result="Automatiskt skapad av Doxygen"; + if (s) result+=(QCString)" för "+s; result+=" från källkoden."; return result; } - QString trEnumName() + + QCString trEnumName() { return "enum namn"; } - QString trEnumValue() + + QCString trEnumValue() { return "enum värde"; } - QString trDefinedIn() - { return "deklarerad i"; } - QString trIncludeFile() - { return "Inkluderingsfil"; } - QString trVerbatimText(const char *f) - { return (QString)"Detta är den ordagranna texten från inkluderingsfilen"+f; } - QString trModules() + + QCString trDefinedIn() + { return "definierad i"; } + + + QCString trVerbatimText(const char *f) + { return (QCString)"Detta är den ordagranna texten från inkluderingsfilen "+f; } + + QCString trModules() { return "Moduler"; } - QString trClassHierarchy() + + QCString trClassHierarchy() { return "Klasshierarki"; } - QString trCompoundList() + + QCString trCompoundList() { return "Sammansatt klasslista"; } - QString trFileList() + + QCString trFileList() { return "Fillista"; } - QString trHeaderFiles() + + QCString trHeaderFiles() { return "Headerfiler"; } - QString trCompoundMembers() + + QCString trCompoundMembers() { return "Sammansatta klassmedlemmar"; } - QString trFileMembers() + + QCString trFileMembers() { return "Filmedlemmar"; } - QString trRelatedPages() + + QCString trRelatedPages() { return "Besläktade sidor"; } - QString trExamples() + + QCString trExamples() { return "Exempel"; } - QString trSearch() + + QCString trSearch() { return "Sök"; } - QString trClassHierarchyDescription() + + QCString trClassHierarchyDescription() { return "Denna lista över arv är grovt, men inte helt, " "sorterad i alfabetisk ordning:"; } - QString trFileListDescription(bool extractAll) + + QCString trFileListDescription(bool extractAll) { - QString result="Här följer en lista över alla "; + QCString result="Här följer en lista över alla "; if (!extractAll) result+="dokumenterade "; result+="filer, med en kort beskrivning:"; return result; } - QString trCompoundListDescription() - { return "Här följer klasserna, structerna och " + + QCString trCompoundListDescription() + { return "Här följer klasserna, strukterna och " "unionerna med en kort beskrivning:"; } - QString trCompoundMembersDescription(bool extractAll) + + QCString trCompoundMembersDescription(bool extractAll) { - QString result="Här följer en lista över alla "; + + QCString result="Här följer en lista över alla "; if (!extractAll) result+="dokumenterade "; result+="klassmedlemmar med länkar till "; if (extractAll) result+="klassdokumentationen för varje medlem:"; else result+="klasserna som de tillhör:"; return result; } - QString trFileMembersDescription(bool extractAll) + + QCString trFileMembersDescription(bool extractAll) { - QString result="Här följer en lista över alla "; + QCString result="Här följer en lista över alla "; if (!extractAll) result+="dokumenterade "; result+="filmedlemmar med länkar till "; if (extractAll) result+="dokumentationsfilen för varje medlem:"; else result+="filerna som de tillhör:"; return result; } - QString trHeaderFilesDescription() + + QCString trHeaderFilesDescription() { return "Här följer headerfilerna som API:n består av:"; } - QString trExamplesDescription() + + QCString trExamplesDescription() { return "Här följer en lista med alla exempel:"; } - QString trRelatedPagesDescription() - { return "Här följer en lista över alla relaterade dokumentationssidor:"; -} QString trModulesDescription() + + QCString trRelatedPagesDescription() + { return "Här följer en lista över alla besläktade dokumentationssidor:";} + + QCString trModulesDescription() { return "Här följer en lista över alla moduler:"; } - QString trNoDescriptionAvailable() + + QCString trNoDescriptionAvailable() { return "Beskrivning saknas"; } - QString trDocumentation() + QCString trDocumentation() { return "Dokumentation"; } - QString trModuleIndex() - { return "Modul Index"; } - QString trHierarchicalIndex() + + QCString trModuleIndex() + { return "Modulindex"; } + + QCString trHierarchicalIndex() { return "Hierarkiskt Index"; } - QString trCompoundIndex() + + QCString trCompoundIndex() { return "Sammansatt Index"; } - QString trFileIndex() - { return "Fil Index"; } - QString trModuleDocumentation() + + QCString trFileIndex() + { return "Filindex"; } + + QCString trModuleDocumentation() { return "Dokumentation över moduler"; } - QString trClassDocumentation() + + QCString trClassDocumentation() { return "Dokumentation över klasser"; } - QString trFileDocumentation() + + QCString trFileDocumentation() { return "Dokumentation över filer"; } - QString trExampleDocumentation() + + QCString trExampleDocumentation() { return "Dokumentation över exempel"; } - QString trPageDocumentation() + + QCString trPageDocumentation() { return "Dokumentation av sidor"; } - QString trReferenceManual() - { return "Uppslagsbok"; } - QString trDefines() + QCString trReferenceManual() + { return "Referensmanual"; } + + QCString trDefines() { return "Definitioner"; } - QString trFuncProtos() + QCString trFuncProtos() { return "Funktionsprototyper"; } - QString trTypedefs() + QCString trTypedefs() { return "Typdefinitioner"; } - QString trEnumerations() + QCString trEnumerations() { return "Egenuppräknande typer"; } - QString trFunctions() + QCString trFunctions() { return "Funktioner"; } - QString trVariables() + + QCString trVariables() { return "Variabler"; } - QString trEnumerationValues() - { return "Egenuppräknade värden"; } - QString trReimplementedFrom() - { return "Återanvänd från"; } - QString trReimplementedIn() - { return "Återanvänd i"; } - QString trAuthor() + + QCString trEnumerationValues() + { return "Egenuppräknade typers värden"; } + + QCString trAuthor() { return "Författare"; } - QString trDefineDocumentation() + + QCString trDefineDocumentation() { return "Dokumentation över definitioner"; } - QString trFunctionPrototypeDocumentation() + + QCString trFunctionPrototypeDocumentation() { return "Dokumentation över funktionsprototyper"; } - QString trTypedefDocumentation() + + QCString trTypedefDocumentation() { return "Dokumentation över typdefinitioner"; } - QString trEnumerationTypeDocumentation() - { return "Dokumentation över egenuppräknande typer (enum)"; } - QString trEnumerationValueDocumentation() + + QCString trEnumerationTypeDocumentation() + { return "Dokumentation över egenuppräknande typer"; } + + QCString trEnumerationValueDocumentation() { return "Dokumentation över egenuppräknande typers värden"; } - QString trFunctionDocumentation() + + QCString trFunctionDocumentation() { return "Dokumentation över funktioner"; } - QString trVariableDocumentation() + + QCString trVariableDocumentation() { return "Dokumentation över variabler"; } - QString trCompounds() + + QCString trCompounds() { return "Sammansättning"; } - QString trFiles() + + QCString trFiles() { return "Filer"; } - QString trGeneratedAt(const char *date,const char *projName) - { - QString result=(QString)"Skapad "+date; - if (projName) result+=(QString)" för "+projName; - result+=(QString)" av"; + + QCString trGeneratedAt(const char *date,const char *projName) + { + QCString result=(QCString)"Skapad "+date; + if (projName) result+=(QCString)" för "+projName; + result+=(QCString)" av"; return result; } - QString trWrittenBy() + + QCString trWrittenBy() { return "skriven av"; } - QString trClassDiagram(const char *clName) + + QCString trClassDiagram(const char *clName) { - return (QString)"Klass-diagram för "+clName; + return (QCString)"Klassdiagram för "+clName; } - QString trForInternalUseOnly() + + QCString trForInternalUseOnly() { return "Endast för internt bruk."; } - QString trReimplementedForInternalReasons() - { return "Omskriven av intern anledning ; " - "API:n påverkas inte."; - } - QString trWarning() + + QCString trReimplementedForInternalReasons() + { return "Omskriven av intern anledning ; API:n påverkas inte.";} + + QCString trWarning() { return "Varning"; } - QString trBugsAndLimitations() + + QCString trBugsAndLimitations() { return "Fel och begränsningar"; } - QString trVersion() + + QCString trVersion() { return "Version"; } - QString trDate() + + QCString trDate() { return "Datum"; } - QString trAuthors() + + QCString trAuthors() { return "Författare"; } - QString trReturns() + + QCString trReturns() { return "Returnerar"; } - QString trSeeAlso() + + QCString trSeeAlso() { return "Se även"; } - QString trParameters() + + QCString trParameters() { return "Parametrar"; } - QString trExceptions() + + QCString trExceptions() { return "Undantag"; } - QString trGeneratedBy() + + QCString trGeneratedBy() { return "Skapad av"; } + +// new since 0.49-990307 + + virtual QCString trNamespaceList() + { return "Namespacelista"; } + + virtual QCString trNamespaceListDescription(bool extractAll) + { + QCString result="Här är en lista över alla "; + if (!extractAll) result+="dokumenterade "; + result+="namespaces med en kort förklaring:"; + return result; + } + + virtual QCString trFriends() + { return "Vänner"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990405 +////////////////////////////////////////////////////////////////////////// + + virtual QCString trRelatedFunctionDocumentation() + { return "Vänners och besläktade funktioners dokumentation"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990425 +////////////////////////////////////////////////////////////////////////// + + virtual QCString trCompoundReference(const char *clName, + ClassDef::CompoundType compType) + { + QCString result=(QCString)clName+" "; + switch(compType) + { + case ClassDef::Class: result+=" Klass"; break; + case ClassDef::Struct: result+=" Strukt"; break; + case ClassDef::Union: result+=" Union"; break; + } + result+="referens"; + return result; + } + + virtual QCString trFileReference(const char *fileName) + { + QCString result=fileName; + result+=" filreferens"; + return result; + } + + virtual QCString trNamespaceReference(const char *namespaceName) + { + QCString result=namespaceName; + result+=" namespacereferens"; + return result; + } + + virtual QCString trPublicMembers() + { return "Publika medlemmar"; } + virtual QCString trPublicSlots() + { return "Publika slots"; } + virtual QCString trSignals() + { return "Signaler"; } + virtual QCString trStaticPublicMembers() + { return "Statiska publika medlemmar"; } + virtual QCString trProtectedMembers() + { return "Skyddade medlemmar"; } + virtual QCString trProtectedSlots() + { return "Skyddade slots"; } + virtual QCString trStaticProtectedMembers() + { return "Statiska skyddade medlemmar"; } + virtual QCString trPrivateMembers() + { return "Privata medlemmar"; } + virtual QCString trPrivateSlots() + { return "Privata slots"; } + virtual QCString trStaticPrivateMembers() + { return "Statiska privata medlemmar"; } + // end of member sections + + virtual QCString trWriteList(int numEntries) + { + // this function is used to produce a comma-separated list of items. + // use generateMarker(i) to indicate where item i should be put. + QCString result; + int i; + // the inherits list contain `numEntries' classes + for (i=0;i<numEntries;i++) + { + // use generateMarker to generate placeholders for the class links! + result+=generateMarker(i); // generate marker for entry i in the list + // (order is left to right) + + if (i!=numEntries-1) // not the last entry, so we need a separator + { + if (i<numEntries-2) // not the fore last entry + result+=", "; + else // the fore last entry + result+=", och "; + } + } + return result; + } + + virtual QCString trInheritsList(int numEntries) + // used in class documentation to produce a list of base classes, + // if class diagrams are disabled. + { + return "Ärver "+trWriteList(numEntries)+"."; + } + virtual QCString trInheritedByList(int numEntries) + // used in class documentation to produce a list of super classes, + // if class diagrams are disabled. + { + return "Ärvd av "+trWriteList(numEntries)+"."; + } + virtual QCString trReimplementedFromList(int numEntries) + // used in member documentation blocks to produce a list of + // members that are hidden by this one. + { + return "Återskapad från "+trWriteList(numEntries)+"."; + } + virtual QCString trReimplementedInList(int numEntries) + { + // used in member documentation blocks to produce a list of + // all member that overwrite the implementation of this member. + return "Återskapad i "+trWriteList(numEntries)+"."; + } + + virtual QCString trNamespaceMembers() + { return "Namespacemedlemmar"; } + virtual QCString trNamespaceMemberDescription(bool extractAll) + { + QCString result="Här är en lista över alla "; + if (!extractAll) result+="dokumenterade "; + result+="namespacemedlemmar med länkar till "; + if (extractAll) + result+=" namespace-dokumentationen för varje medlem:"; + else + result+="de namespaces de tillhör:"; + return result; + } + + virtual QCString trNamespaceIndex() + { return "Namespaceindex"; } + + virtual QCString trNamespaceDocumentation() + +{ return "Namespace-dokumentation"; } }; #endif diff --git a/src/util.cpp b/src/util.cpp index 9064b2e..49fdee5 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -15,9 +15,10 @@ */ #include <stdlib.h> -#include <qregexp.h> -#include <qstring.h> #include <ctype.h> + +#include "qtbc.h" +#include <qregexp.h> #include "util.h" #include "message.h" #include "classdef.h" @@ -37,9 +38,22 @@ bool isId(char c) return c=='_' || isalnum(c); } -QString generateMarker(int id) +// strip annonymous part of the scope +QCString stripAnnonymousScope(const QCString &s) +{ + QCString result=s; + int i; + while (!result.isEmpty() && result.at(0)=='@' && (i=result.find("::"))!=-1) + { + result=result.right(result.length()-i-2); + } + return result; +} + + +QCString generateMarker(int id) { - QString result; + QCString result; result.sprintf("@%d\n",id); return result; } @@ -49,7 +63,7 @@ QString generateMarker(int id) // If anyone knows or uses another extension please let me know :-) int guessSection(const char *name) { - QString n=((QString)name).lower(); + QCString n=((QCString)name).lower(); if (n.right(2)==".c" || n.right(3)==".cc" || n.right(4)==".cxx" || @@ -66,7 +80,7 @@ int guessSection(const char *name) } -//QString resolveDefines(const char *n) +//QCString resolveDefines(const char *n) //{ // return n; // if (n) @@ -81,9 +95,9 @@ int guessSection(const char *name) // return 0; //} -QString resolveTypedefs(const QString &n) +QCString resolveTypedefs(const QCString &n) { - QString *subst=typedefDict[n]; + QCString *subst=typedefDict[n]; if (subst && !subst->isNull()) { return *subst; @@ -97,7 +111,7 @@ QString resolveTypedefs(const QString &n) ClassDef *getClass(const char *name) { if (!name) return 0; - //QString key=resolveTypedefs(resolveDefines(name)); + //QCString key=resolveTypedefs(resolveDefines(name)); //Define *def=defineDict[key]; //if (def && def->nargs==0 && def->definition.length()>0) // normal define // key=def->definition; // use substitution @@ -105,10 +119,10 @@ ClassDef *getClass(const char *name) return classDict[resolveTypedefs(name)]; } -QString removeRedundantWhiteSpace(const QString &s) +QCString removeRedundantWhiteSpace(const QCString &s) { if (s.length()==0) return s; - QString result; + QCString result; uint i; for (i=0;i<s.length();i++) { @@ -152,11 +166,11 @@ void writeTemplatePrefix(OutputList &ol,ArgumentList *al) if (manEnabled) ol.enable(OutputGenerator::Man); } -QString addTemplateNames(const QString &s,const QString &n,const QString &t) +QCString addTemplateNames(const QCString &s,const QCString &n,const QCString &t) { //printf("addTemplateNames(%s)\n",s.data()); - QString result; - QString clRealName=n; + QCString result; + QCString clRealName=n; int p=0,i; if ((i=clRealName.find('<'))!=-1) { @@ -183,11 +197,11 @@ QString addTemplateNames(const QString &s,const QString &n,const QString &t) return result; } -static void linkifyText(OutputList &ol,const char *clName,const char *name,const char *text) +static void linkifyText(OutputList &ol,const char *scName,const char *name,const char *text) { - //printf("class %s name %s Text: %s\n",clName,name,text); + //printf("scope=`%s' name=`%s' Text: `%s'\n",scName,name,text); QRegExp regExp("[a-z_A-Z0-9:<>]+"); - QString txtStr=text; + QCString txtStr=text; OutputList result(&ol); int matchLen; int index=0; @@ -199,55 +213,86 @@ static void linkifyText(OutputList &ol,const char *clName,const char *name,const // add non-word part to the result result.docify(txtStr.mid(skipIndex,newIndex-skipIndex)); // get word from string - QString word=txtStr.mid(newIndex,matchLen); + QCString word=txtStr.mid(newIndex,matchLen); ClassDef *cd=0; FileDef *fd=0; MemberDef *md=0; NamespaceDef *nd=0; + QCString scopeName=scName; + QCString searchName=name; + //printf("word=`%s' scopeName=`%s' searchName=`%s'\n", + // word.data(),scopeName.data(),searchName.data()); // check if `word' is a documented class name - if (word.length()>0 && word!=name && word!=clName) + if (word.length()>0 && + word.right(searchName.length())!=searchName && + word!=scopeName.right(word.length()) + ) { - if ((cd=getClass(word))) + //printf("Searching...\n"); + int scopeOffset=scopeName.length(); + bool found=FALSE; + do // for each scope (starting with full scope and going to empty scope) { - // add link to the result - if (cd->isVisible()) + QCString fullName = word.copy(); + if (scopeOffset>0) { - result.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,word); + fullName.prepend(scopeName.left(scopeOffset)+"::"); } - else + //printf("Trying class %s\n",fullName.data()); + + if ((cd=getClass(fullName))) { - result.docify(word); + // add link to the result + if (cd->isVisible()) + { + result.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,word); + found=TRUE; + } } - } - else if (getDefs(word,clName,0,md,cd,fd,nd) && md->hasDocumentation()) + + if (scopeOffset==0) + { + scopeOffset=-1; + } + else if ((scopeOffset=scopeName.findRev("::",scopeOffset-1))==-1) + { + scopeOffset=0; + } + } while (!found && scopeOffset>=0); + + if (!found && + getDefs(scName,word,0,md,cd,fd,nd) && + (md->isTypedef() || md->isEnumerate()) && + md->hasDocumentation() + ) { - if (cd && cd->isVisible() && !md->isFunction()) // word is a member of cd + if (cd && cd->isVisible()) // fullName is a member of cd { result.writeObjectLink(cd->getReference(), - cd->getOutputFileBase(),md->anchor(),word); + cd->getOutputFileBase(),md->anchor(),word); + found=TRUE; } else if (nd && nd->hasDocumentation()) { result.writeObjectLink(nd->getReference(), - nd->getOutputFileBase(),md->anchor(),word); + nd->getOutputFileBase(),md->anchor(),word); + found=TRUE; } - else if (fd && fd->hasDocumentation()) // word is a global in file fd + else if (fd && fd->hasDocumentation()) // fullName is a global in file fd { result.writeObjectLink(fd->getReference(), - fd->getOutputFileBase(),md->anchor(),word); - } - else // add word to the result - { - result.docify(word); + fd->getOutputFileBase(),md->anchor(),word); + found=TRUE; } } - else // add word to the result + + if (!found) // add word to the result { result.docify(word); } } - else // add word to the result + else { result.docify(word); } @@ -261,13 +306,13 @@ static void linkifyText(OutputList &ol,const char *clName,const char *name,const } static void writeDefArgumentList(OutputList &ol,ClassDef *cd, - const QString &scopeName,MemberDef *md) + const QCString &scopeName,MemberDef *md) { ArgumentList *argList=md->argumentList(); if (argList==0) return; // member has no function like argument list ol.docify(" ("); // start argument list Argument *a=argList->first(); - QString cName; + QCString cName; if (cd && cd->templateArguments()) { cName=cd->getTemplateNameString(); @@ -278,13 +323,13 @@ static void writeDefArgumentList(OutputList &ol,ClassDef *cd, int vp; if ((vp=a->type.find(re))!=-1) // argument type is a function pointer { - QString n=a->type.left(vp); + QCString n=a->type.left(vp); if (cName.length()>0) n=addTemplateNames(n,cd->name(),cName); linkifyText(ol,scopeName,md->name(),n); } else // non-function pointer type { - QString n=a->type; + QCString n=a->type; if (cName.length()>0) n=addTemplateNames(n,cd->name(),cName); linkifyText(ol,scopeName,md->name(),n); } @@ -306,7 +351,7 @@ static void writeDefArgumentList(OutputList &ol,ClassDef *cd, } if (a->defval.length()>0) // write the default value { - QString n=a->defval; + QCString n=a->defval; if (cName.length()>0) n=addTemplateNames(n,cd->name(),cName); ol.docify(" = "); linkifyText(ol,scopeName,md->name(),n); @@ -327,7 +372,7 @@ static void writeDefArgumentList(OutputList &ol,ClassDef *cd, void writeExample(OutputList &ol,ExampleList *el) { - QString exampleLine=theTranslator->trWriteList(el->count()); + QCString exampleLine=theTranslator->trWriteList(el->count()); QRegExp marker("@[0-9]+"); int index=0,newIndex,matchLen; @@ -347,9 +392,9 @@ void writeExample(OutputList &ol,ExampleList *el) -QString argListToString(ArgumentList *al) +QCString argListToString(ArgumentList *al) { - QString result; + QCString result; if (al==0) return result; Argument *a=al->first(); result+="("; @@ -416,7 +461,7 @@ void writeQuickLinks(OutputList &ol,bool compact,bool ext) { bool manEnabled = ol.isEnabled(OutputGenerator::Man); bool texEnabled = ol.isEnabled(OutputGenerator::Latex); - QString extLink,absPath; + QCString extLink,absPath; if (ext) { extLink="_doc:"; absPath="/"; } if (manEnabled) ol.disable(OutputGenerator::Man); if (texEnabled) ol.disable(OutputGenerator::Latex); @@ -456,7 +501,7 @@ void writeQuickLinks(OutputList &ol,bool compact,bool ext) parseText(ol,theTranslator->trFileList()); ol.endQuickIndexItem(); } - if (includeFiles.count()>0 && verbatimHeaderFlag) + if (includeFiles.count()>0 && Config::verbatimHeaderFlag) { if (!compact) ol.writeListItem(); ol.startQuickIndexItem(extLink,absPath+"headers.html"); @@ -498,7 +543,7 @@ void writeQuickLinks(OutputList &ol,bool compact,bool ext) parseText(ol,theTranslator->trExamples()); ol.endQuickIndexItem(); } - if (searchEngineFlag) + if (Config::searchEngineFlag) { if (!compact) ol.writeListItem(); ol.startQuickIndexItem("_cgi:",""); @@ -521,7 +566,7 @@ void writeQuickLinks(OutputList &ol,bool compact,bool ext) void startFile(OutputList &ol,const char *name,const char *title,bool external) { ol.startFile(name,title,external); - if (!noIndexFlag) writeQuickLinks(ol,TRUE,external); + if (!Config::noIndexFlag) writeQuickLinks(ol,TRUE,external); } void endFile(OutputList &ol,bool external) @@ -531,15 +576,15 @@ void endFile(OutputList &ol,bool external) if (latexEnabled) ol.disable(OutputGenerator::Latex); if (manEnabled) ol.disable(OutputGenerator::Man); ol.writeFooter(0,external); // write the footer - if (footerFile.length()==0) + if (Config::footerFile.length()==0) { parseText(ol,theTranslator->trGeneratedAt( dateToString(TRUE), - projectName + Config::projectName )); } ol.writeFooter(1,external); // write the link to the picture - if (footerFile.length()==0) + if (Config::footerFile.length()==0) { parseText(ol,theTranslator->trWrittenBy()); } @@ -555,14 +600,14 @@ static void writeMemberDef(OutputList &ol, ClassDef *cd, NamespaceDef *nd, { int i,l; bool hasDocs=md->hasDocumentation(); - if ((!hasDocs && hideMemberFlag) || - (hideMemberFlag && + if ((!hasDocs && Config::hideMemberFlag) || + (Config::hideMemberFlag && md->documentation().isEmpty() && - !briefMemDescFlag && - !repeatBriefFlag + !Config::briefMemDescFlag && + !Config::repeatBriefFlag ) ) return; - QString type=md->typeString(); + QCString type=md->typeString(); QRegExp r("@[0-9]+"); if ((i=r.match(type,0,&l))==-1 || !md->enumUsed()) { @@ -571,22 +616,23 @@ static void writeMemberDef(OutputList &ol, ClassDef *cd, NamespaceDef *nd, // strip `friend' keyword from type if (type.left(7)=="friend ") type=type.right(type.length()-7); - if (genTagFile.length()>0) + if (Config::genTagFile.length()>0) { tagFile << md->name() << " " << md->anchor() << " \"" << md->argsString() << "\"\n"; } - QString cname; + QCString cname; if (cd) cname=cd->name(); else if (nd) cname=nd->name(); else if (fd) cname=fd->name(); + ol.startMemberItem(); // If there is no detailed description we need to write the anchor here. bool detailsVisible = md->detailsAreVisible(); - if (!detailsVisible && !extractAllFlag) + if (!detailsVisible && !Config::extractAllFlag) { - QString doxyName=md->name().copy(); + QCString doxyName=md->name().copy(); if (!cname.isEmpty()) doxyName.prepend(cname+"::"); ol.writeDoxyAnchor(cname,md->anchor(),doxyName); ol.addToIndex(md->name(),cname); @@ -601,35 +647,37 @@ static void writeMemberDef(OutputList &ol, ClassDef *cd, NamespaceDef *nd, ol.addToIndex(cname,md->name()); ol.writeLatexLabel(cname,md->anchor()); } - ol.startMemberItem(); // write type if (i!=-1) { - QString newType = type.left(i) + " { ... } " + + QCString newType = type.left(i) + " { ... } " + type.right(type.length()-i-l); type = newType; - ol.docify(type); + //ol.docify(type); + linkifyText(ol,cname,md->name(),type); } else { - ol.docify(type); + //ol.docify(type); + linkifyText(ol,cname,md->name(),type); + } + QCString name=md->name().copy(); + bool htmlOn = ol.isEnabled(OutputGenerator::Html); + if (htmlOn && Config::htmlAlignMemberFlag && type.length()>0) + { + ol.disable(OutputGenerator::Html); + } + if (!type.isEmpty()) ol.docify(" "); + if (htmlOn) + { + ol.enable(OutputGenerator::Html); } - QString name=md->name().copy(); - if (type.length()>0) ol.writeString(" "); ol.insertMemberAlign(); // write name - if ( extractAllFlag || - (md->briefDescription().isEmpty() || !briefMemDescFlag) && - (!md->documentation().isEmpty() || - (!md->briefDescription().isEmpty() && - !briefMemDescFlag && - repeatBriefFlag - ) - ) - ) + if (md->hasDocumentation()) { //printf("writeLink %s->%d\n",name.data(),md->hasDocumentation()); writeLink(ol,cd,nd,fd,md,name); @@ -643,7 +691,8 @@ static void writeMemberDef(OutputList &ol, ClassDef *cd, NamespaceDef *nd, if (md->argsString()) { ol.writeString(" "); - ol.docify(md->argsString()); + //ol.docify(md->argsString()); + linkifyText(ol,cname,md->name(),md->argsString()); } if (md->excpString()) @@ -655,22 +704,21 @@ static void writeMemberDef(OutputList &ol, ClassDef *cd, NamespaceDef *nd, ol.endMemberItem(); // write brief description - if (!md->briefDescription().isEmpty() && briefMemDescFlag) + if (!md->briefDescription().isEmpty() && Config::briefMemDescFlag) { ol.startMemberDescription(); parseDoc(ol,cname,md->name(),md->briefDescription()); - if (!md->documentation().isEmpty()) - { - ol.disableAllBut(OutputGenerator::Html); - ol.endEmphasis(); - ol.docify(" "); - ol.startTextLink(0,md->anchor()); - //ol.writeObjectLink(0,0,md->anchor()," More..."); - parseText(ol,theTranslator->trMore()); - ol.endTextLink(); - ol.startEmphasis(); - ol.enableAll(); - } + //if (!md->documentation().isEmpty()) + //{ + // ol.disableAllBut(OutputGenerator::Html); + // ol.endEmphasis(); + // ol.docify(" "); + // ol.startTextLink(0,md->anchor()); + // parseText(ol,theTranslator->trMore()); + // ol.endTextLink(); + // ol.startEmphasis(); + // ol.enableAll(); + //} ol.endMemberDescription(); ol.newParagraph(); } @@ -695,7 +743,9 @@ void writeMemberDecs(OutputList &ol,ClassDef *cd,NamespaceDef *nd, FileDef *fd, } if (subtitle) { + ol.startMemberSubtitle(); parseText(ol,subtitle); + ol.endMemberSubtitle(); } if (!fd && !nd) ol.startMemberList(); @@ -711,7 +761,7 @@ void writeMemberDecs(OutputList &ol,ClassDef *cd,NamespaceDef *nd, FileDef *fd, for ( ; (md=mli.current()); ++mli ) { if (md->isDefine() && - (md->argsString() || md->hasDocumentation() || extractAllFlag) + (md->argsString() || md->hasDocumentation() || Config::extractAllFlag) ) writeMemberDef(ol,cd,nd,fd,md); } @@ -763,34 +813,35 @@ void writeMemberDecs(OutputList &ol,ClassDef *cd,NamespaceDef *nd, FileDef *fd, for ( ; (md=mli.current()) ; ++mli ) { /*bool hasDocs=md->hasDocumentation();*/ - QString type=md->typeString(); + QCString type=md->typeString(); type=type.stripWhiteSpace(); - if (md->isEnumerate() /*&& (hasDocs || !hideMemberFlag)*/) + if (md->isEnumerate() /*&& (hasDocs || !Config::hideMemberFlag)*/) { - if (!hideMemberFlag || // do not hide undocumented members or + if (!Config::hideMemberFlag || // do not hide undocumented members or !md->documentation().isEmpty() || // member has detailed descr. or md->hasDocumentedEnumValues() || // member has documented enum vales. - briefMemDescFlag || // brief descr. is shown or - repeatBriefFlag // brief descr. is repeated. + Config::briefMemDescFlag || // brief descr. is shown or + Config::repeatBriefFlag // brief descr. is repeated. ) { OutputList typeDecl(&ol); - QString name=md->name().copy(); + QCString name=md->name().copy(); int i=name.findRev("::"); if (i!=-1) name=name.right(name.length()-i-2); // strip scope if (name[0]!='@') // not an anonymous enum { - if (extractAllFlag || - (md->briefDescription().isEmpty() || !briefMemDescFlag) && - (!md->documentation().isEmpty() || md->hasDocumentedEnumValues() || - (!md->briefDescription().isEmpty() && - !briefMemDescFlag && - repeatBriefFlag - ) - ) - ) + //if (Config::extractAllFlag || + // (md->briefDescription().isEmpty() || !Config::briefMemDescFlag) && + // (!md->documentation().isEmpty() || md->hasDocumentedEnumValues() || + // (!md->briefDescription().isEmpty() && + // !Config::briefMemDescFlag && + // Config::repeatBriefFlag + // ) + // ) + // ) + if (md->hasDocumentation() || md->hasDocumentedEnumValues()) { - if (genTagFile.length()>0) + if (Config::genTagFile.length()>0) tagFile << md->name() << " " << md->anchor() << " \"" << md->argsString() << "\""; writeLink(typeDecl,cd,nd,fd,md,name); @@ -811,7 +862,7 @@ void writeMemberDecs(OutputList &ol,ClassDef *cd,NamespaceDef *nd, FileDef *fd, { if (fmd->hasDocumentation()) { - if (genTagFile.length()>0) + if (Config::genTagFile.length()>0) tagFile << fmd->name() << " " << fmd->anchor() << " \"" << fmd->argsString() << "\""; writeLink(typeDecl,cd,nd,fd,fmd,fmd->name()); @@ -834,7 +885,7 @@ void writeMemberDecs(OutputList &ol,ClassDef *cd,NamespaceDef *nd, FileDef *fd, { for ( ; (vmd=vmli.current()) ; ++vmli) { - QString vtype=vmd->typeString(); + QCString vtype=vmd->typeString(); if ((vtype.find(name))!=-1) enumVars++; } } @@ -845,25 +896,25 @@ void writeMemberDecs(OutputList &ol,ClassDef *cd,NamespaceDef *nd, FileDef *fd, ol.insertMemberAlign(); ol+=typeDecl; ol.endMemberItem(); - //QString brief=md->briefDescription(); + //QCString brief=md->briefDescription(); //brief=brief.stripWhiteSpace(); - if (!md->briefDescription().isEmpty() && briefMemDescFlag) + if (!md->briefDescription().isEmpty() && Config::briefMemDescFlag) { ol.startMemberDescription(); parseDoc(ol,cd?cd->name().data():0, md->name().data(),md->briefDescription()); - if (!md->documentation().isEmpty() || md->hasDocumentedEnumValues()) - { - ol.disableAllBut(OutputGenerator::Html); - ol.endEmphasis(); - ol.docify(" "); - ol.startTextLink(0,md->anchor()); - //ol.writeObjectLink(0,0,md->anchor()," More..."); - parseText(ol,theTranslator->trMore()); - ol.endTextLink(); - ol.startEmphasis(); - ol.enableAll(); - } + //if (!md->documentation().isEmpty() || md->hasDocumentedEnumValues()) + //{ + // ol.disableAllBut(OutputGenerator::Html); + // ol.endEmphasis(); + // ol.docify(" "); + // ol.startTextLink(0,md->anchor()); + // //ol.writeObjectLink(0,0,md->anchor()," More..."); + // parseText(ol,theTranslator->trMore()); + // ol.endTextLink(); + // ol.startEmphasis(); + // ol.enableAll(); + //} ol.endMemberDescription(); ol.disable(OutputGenerator::Man); ol.newParagraph(); @@ -904,7 +955,7 @@ void writeMemberDecs(OutputList &ol,ClassDef *cd,NamespaceDef *nd, FileDef *fd, { if ( md->isFriend()) { - QString type=md->typeString(); + QCString type=md->typeString(); //printf("Friend: type=%s name=%s\n",type.data(),md->name().data()); if (md->hasDocumentation() && type!="friend class") { @@ -930,7 +981,7 @@ void writeMemberDecs(OutputList &ol,ClassDef *cd,NamespaceDef *nd, FileDef *fd, ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,cd->name()); ol.endMemberItem(); } - else if (!hideMemberFlag) // no documentation + else if (!Config::hideMemberFlag) // no documentation { ol.startMemberItem(); ol.docify("class "); @@ -971,7 +1022,7 @@ void setAnchors(char id,MemberList *ml) MemberDef *md=ml->first(); while (md) { - QString anchor; + QCString anchor; anchor.sprintf("%c%d",id,count++); //printf("Member %s anchor %s\n",md->name(),anchor.data()); md->setAnchor(anchor); @@ -992,21 +1043,21 @@ void writeMemberDocs(OutputList &ol,MemberList *ml,const char *scopeName, // md->hasDocumentedEnumValues() // one of its values is documented // ) || // or // (!md->briefDescription().isEmpty() && // member has brief description and - // !briefMemDescFlag && // brief description not shown earlier and - // repeatBriefFlag // brief description should be repeated. + // !Config::briefMemDescFlag && // brief description not shown earlier and + // Config::repeatBriefFlag // brief description should be repeated. // ); if (md->memberType()==m && // filter member type - (extractAllFlag || hasDocs) + (Config::extractAllFlag || hasDocs) ) { - if (extractAllFlag && !hasDocs) + if (Config::extractAllFlag && !hasDocs) { ol.disable(OutputGenerator::Latex); // Latex cannot insert a pagebreak // if there are a lot of empty sections, // so we disable LaTeX for all empty - // sections even if extractAllFlag is enabled + // sections even if Config::extractAllFlag is enabled } - QString cname; + QCString cname; NamespaceDef *nd=md->getNamespace(); ClassDef *cd=md->memberClass(); FileDef *fd=md->getFileDef(); @@ -1014,11 +1065,11 @@ void writeMemberDocs(OutputList &ol,MemberList *ml,const char *scopeName, else if (nd) cname=nd->name(); else if (fd) cname=fd->name(); // get member name - QString doxyName=md->name().copy(); - // prepend scope if there is any (TODO: prepend namespace scope as well) - if (scopeName) doxyName.prepend((QString)scopeName+"::"); + QCString doxyName=md->name().copy(); + // prepend scope if there is any + if (scopeName) doxyName.prepend((QCString)scopeName+"::"); - QString def = md->definition(); + QCString def = md->definition(); if (md->isEnumerate()) def.prepend("enum "); MemberDef *smd; if (md->isEnumValue() && def[0]=='@') def = def.right(def.length()-2); @@ -1060,7 +1111,8 @@ void writeMemberDocs(OutputList &ol,MemberList *ml,const char *scopeName, ol.writeDoxyAnchor(cname,md->anchor(),doxyName); ArgumentList *al=0; if (cd && (!md->isRelated() || !md->templateArguments()) && - (al=cd->templateArguments())) // class template prefix + ((al=md->scopeTemplateArguments()) || (al=cd->templateArguments())) + ) // class template prefix { writeTemplatePrefix(ol,al); } @@ -1070,7 +1122,11 @@ void writeMemberDocs(OutputList &ol,MemberList *ml,const char *scopeName, { writeTemplatePrefix(ol,al); } - if (cd && cd->templateArguments()) + if (cd && md->scopeTemplateArguments()) + { + def=addTemplateNames(def,cd->name(),md->getScopeTemplateNameString()); + } + else if (cd && cd->templateArguments()) { // add template name lists to all occurrences of the class name. def=addTemplateNames(def,cd->name(),cd->getTemplateNameString()); @@ -1129,8 +1185,8 @@ void writeMemberDocs(OutputList &ol,MemberList *ml,const char *scopeName, ol.newParagraph(); if (!md->briefDescription().isEmpty() && - (repeatBriefFlag || - (!briefMemDescFlag && md->documentation().isEmpty()) + (Config::repeatBriefFlag || + (!Config::briefMemDescFlag && md->documentation().isEmpty()) ) ) { @@ -1141,6 +1197,12 @@ void writeMemberDocs(OutputList &ol,MemberList *ml,const char *scopeName, { parseDoc(ol,scopeName,md->name(),md->documentation()+"\n"); } + if (!md->bodyCode().isEmpty()) + { + ol.startCodeFragment(); + parseCode(ol,scopeName,md->bodyCode(),FALSE,0); + ol.endCodeFragment(); + } if (md->isEnumerate()) { @@ -1193,149 +1255,149 @@ void writeMemberDocs(OutputList &ol,MemberList *ml,const char *scopeName, } MemberDef *bmd=md->reimplements(); - if (bmd) + ClassDef *bcd=0; + if (bmd && (bcd=bmd->memberClass())) { if (virt!=Normal) // search for virtual member of the deepest base class { MemberDef *lastBmd=bmd; while (lastBmd) { - if (lastBmd->virtualness()!=Normal) bmd=lastBmd; + ClassDef *lastBcd = lastBmd->memberClass(); + if (lastBmd->virtualness()!=Normal && + lastBmd->hasDocumentation() && + (lastBmd->protection()!=Private || Config::extractPrivateFlag) && + lastBcd->hasDocumentation() && + (lastBcd->protection()!=Private || Config::extractPrivateFlag) + ) { bmd=lastBmd; bcd=lastBcd; } lastBmd=lastBmd->reimplements(); } } // write class that contains a member that is reimplemented by this one - ClassDef *bcd = bmd->memberClass(); - ol.newParagraph(); - //parseText(ol,theTranslator->trReimplementedFrom()); - //ol.docify(" "); - - QString reimplFromLine = theTranslator->trReimplementedFromList(1); - int markerPos = reimplFromLine.find("@0"); - if (markerPos!=-1) // should always pass this. + if (bcd->hasDocumentation() || bcd->isReference()) { - parseText(ol,reimplFromLine.left(markerPos)); //text left from marker - if (bmd->hasDocumentation() && - (bmd->protection()!=Private || extractPrivateFlag) - ) // replace marker with link + ol.newParagraph(); + + QCString reimplFromLine = theTranslator->trReimplementedFromList(1); + int markerPos = reimplFromLine.find("@0"); + if (markerPos!=-1) // should always pass this. { - ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(), - bmd->anchor(),bcd->name()); - if ( - !bcd->isReference() && - //(bcd->hasDocumentation() || !hideClassFlag) && - //(bcd->protection()!=Private || extractPrivateFlag) - bcd->isVisible() - /*&& bmd->detailsAreVisible()*/ - ) ol.writePageRef(bcd->name(),bmd->anchor()); + parseText(ol,reimplFromLine.left(markerPos)); //text left from marker + if (bmd->hasDocumentation() && + (bmd->protection()!=Private || Config::extractPrivateFlag) + ) // replace marker with link + { + ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(), + bmd->anchor(),bcd->name()); + if ( + !bcd->isReference() && + //(bcd->hasDocumentation() || !Config::hideClassFlag) && + //(bcd->protection()!=Private || Config::extractPrivateFlag) + bcd->isVisible() + /*&& bmd->detailsAreVisible()*/ + ) ol.writePageRef(bcd->name(),bmd->anchor()); + } + else + { + ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(), + 0,bcd->name()); + if ( + !bcd->isReference() && + //(bcd->hasDocumentation() || !Config::hideClassFlag) && + //(bcd->protection()!=Private || Config::extractPrivateFlag) + bcd->isVisible() + ) ol.writePageRef(bcd->name(),0); + } + parseText(ol,reimplFromLine.right( + reimplFromLine.length()-markerPos-2)); // text right from marker + } else { - ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(), - 0,bcd->name()); - if ( - !bcd->isReference() && - //(bcd->hasDocumentation() || !hideClassFlag) && - //(bcd->protection()!=Private || extractPrivateFlag) - bcd->isVisible() - ) ol.writePageRef(bcd->name(),0); + err("Error: translation error: no marker in trReimplementsFromList()\n"); } - parseText(ol,reimplFromLine.right( - reimplFromLine.length()-markerPos-2)); // text right from marker - - } - else - { - err("Error: translation error: no marker in trReimplementsFromList()\n"); } //ol.writeString("."); } MemberList *bml=md->reimplementedBy(); - int count; - if (bml && (count=bml->count())>0) + if (bml) { - // write the list of classes that overwrite this member - ol.newParagraph(); - //parseText(ol,theTranslator->trReimplementedIn()); - //ol.writeString("Reimplemented in "); - //ol.docify(" "); - - QString reimplInLine = - theTranslator->trReimplementedInList(bml->count()); - QRegExp marker("@[0-9]+"); - int index=0,newIndex,matchLen; - // now replace all markers in reimplInLine with links to the classes - while ((newIndex=marker.match(reimplInLine,index,&matchLen))!=-1) + MemberListIterator mli(*bml); + MemberDef *bmd=0; + uint count=0; + ClassDef *bcd=0; + for (mli.toFirst();(bmd=mli.current()) && (bcd=bmd->memberClass());++mli) + { + // count the members that directly inherit from md and for + // which the member and class are visible in the docs. + if (bmd->hasDocumentation() && + (bmd->protection()!=Private || Config::extractPrivateFlag) && + bcd->hasDocumentation() && + (bcd->protection()!=Private || Config::extractPrivateFlag) + ) count++; + } + if (count>0) { - parseText(ol,reimplInLine.mid(index,newIndex-index)); - bool ok; - uint entryIndex = reimplInLine.mid(newIndex+1,matchLen-1).toUInt(&ok); - bmd=bml->at(entryIndex); - if (ok && bmd) // write link for marker + mli.toFirst(); + // write the list of classes that overwrite this member + ol.newParagraph(); + //parseText(ol,theTranslator->trReimplementedIn()); + //ol.writeString("Reimplemented in "); + //ol.docify(" "); + + QCString reimplInLine = + theTranslator->trReimplementedInList(count); + QRegExp marker("@[0-9]+"); + int index=0,newIndex,matchLen; + // now replace all markers in reimplInLine with links to the classes + while ((newIndex=marker.match(reimplInLine,index,&matchLen))!=-1) { - ClassDef *bcd = bmd->memberClass(); - if (bmd->hasDocumentation() && - (bmd->protection()!=Private || extractPrivateFlag) - ) + parseText(ol,reimplInLine.mid(index,newIndex-index)); + bool ok; + uint entryIndex = reimplInLine.mid(newIndex+1,matchLen-1).toUInt(&ok); + //bmd=bml->at(entryIndex); + + count=0; + // find the entryIndex-th documented entry in the inheritance list. + for (mli.toFirst();(bmd=mli.current()) && (bcd=bmd->memberClass());++mli) { - ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(), - bmd->anchor(),bcd->name()); - if (!bcd->isReference() && bcd->isVisible()) - ol.writePageRef(bcd->name(),bmd->anchor()); + if (bmd->hasDocumentation() && + (bmd->protection()!=Private || Config::extractPrivateFlag) && + bcd->hasDocumentation() && + (bcd->protection()!=Private || Config::extractPrivateFlag) + ) + { + if (count==entryIndex) break; + count++; + } } - else + + if (ok && bcd && bmd) // write link for marker { + //if (bmd->hasDocumentation() && + // (bmd->protection()!=Private || Config::extractPrivateFlag) + // ) + //{ ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(), - 0,bcd->name()); + bmd->anchor(),bcd->name()); if (!bcd->isReference() && bcd->isVisible()) - ol.writePageRef(bcd->name(),0); + ol.writePageRef(bcd->name(),bmd->anchor()); + //} + //else + //{ + // ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(), + // 0,bcd->name()); + // if (!bcd->isReference() && bcd->isVisible()) + // ol.writePageRef(bcd->name(),0); + //} } - } - index=newIndex+matchLen; - } - parseText(ol,reimplInLine.right(reimplInLine.length()-index)); + ++mli; + index=newIndex+matchLen; + } + parseText(ol,reimplInLine.right(reimplInLine.length()-index)); -#if 0 - bmd=bml->first(); - while (bmd) - { - ClassDef *bcd = bmd->memberClass(); - if (bmd->hasDocumentation()) - { - ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(), - bmd->anchor(),bcd->name()); - if ( - !bcd->isReference() && - //(bcd->hasDocumentation() || !hideClassFlag) && - //(bcd->protection()!=Private || extractPrivateFlag) - bcd->isVisible() - /*&& bmd->detailsAreVisible()*/ - ) ol.writePageRef(bcd->name(),bmd->anchor()); - } - else - { - ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(), - 0,bcd->name()); - if ( - !bcd->isReference() && - //(bcd->hasDocumentation() || !hideClassFlag) && - //(bcd->protection()!=Private || extractPrivateFlag) - bcd->isVisible() - ) ol.writePageRef(bcd->name(),0); - } - bmd=bml->next(); - if (bmd) - { - if (bml->at()==count-1) - //ol.writeString(" and "); - parseText(ol," "+theTranslator->trAnd()+" "); - else - ol.writeString(", "); - } } - ol.writeString("."); -#endif } // write the list of examples that use this member if (md->hasExamples()) @@ -1353,7 +1415,7 @@ void writeMemberDocs(OutputList &ol,MemberList *ml,const char *scopeName, } ol.endIndent(); // enable LaTeX again - if (extractAllFlag && !hasDocs) ol.enable(OutputGenerator::Latex); + if (Config::extractAllFlag && !hasDocs) ol.enable(OutputGenerator::Latex); } } @@ -1362,7 +1424,7 @@ void writeMemberDocs(OutputList &ol,MemberList *ml,const char *scopeName, //---------------------------------------------------------------------------- // read a file with `name' to a string. -QString fileToString(const char *name) +QCString fileToString(const char *name) { if (name==0 || name[0]==0) return 0; QFileInfo fi(name); @@ -1378,32 +1440,32 @@ QString fileToString(const char *name) exit(1); } int fsize=fi.size(); - QString contents(fsize+1); + QCString contents(fsize+1); f.readBlock(contents.data(),fsize); contents[fsize]='\0'; f.close(); return contents; } -QString dateToString(bool includeTime) +QCString dateToString(bool includeTime) { if (includeTime) { - return QDateTime::currentDateTime().toString(); + return convertToQCString(QDateTime::currentDateTime().toString()); } else { const QDate &d=QDate::currentDate(); - QString result; + QCString result; result.sprintf("%d %s %d", d.day(), - d.monthName(d.month()), + convertToQCString(d.monthName(d.month())).data(), d.year()); return result; } //QDate date=dt.date(); //QTime time=dt.time(); - //QString dtString; + //QCString dtString; //dtString.sprintf("%02d:%02d, %04d/%02d/%02d", // time.hour(),time.minute(),date.year(),date.month(),date.day()); //return dtString; @@ -1440,11 +1502,11 @@ static int minClassDistance(ClassDef *cd,ClassDef *bcd,int level=0) //} // strip any template specifiers that follow className in string s -static QString trimTemplateSpecifiers(const QString &className,const QString &s) +static QCString trimTemplateSpecifiers(const QCString &className,const QCString &s) { // first we resolve any defines //int i=0,p,l; - //QString result; + //QCString result; //QRegExp r("[A-Z_a-z][A-Z_a-z0-9]*"); //while ((p=r.match(s,i,&l))!=-1) //{ @@ -1455,7 +1517,7 @@ static QString trimTemplateSpecifiers(const QString &className,const QString &s) //if (i<(int)s.length()) result+=s.mid(i,s.length()-i); // We strip the template arguments following className (if any) - QString result=s.copy(); + QCString result=s.copy(); int l=className.length(); if (l>0) // there is a class name { @@ -1488,17 +1550,31 @@ static QString trimTemplateSpecifiers(const QString &className,const QString &s) } // removes the (one and only) occurrence of name:: from s. -static QString trimScope(const QString &name,const QString &s) +static QCString trimScope(const QCString &name,const QCString &s) { - int spos=s.find(name+"::"); - if (spos!=-1) + int scopeOffset=name.length(); + QCString result=s; + do // for each scope { - return s.left(spos)+s.right(s.length()-spos-name.length()-2); - } - return s; + QCString tmp; + QCString scope=name.left(scopeOffset)+"::"; + //printf("Trying with scope=`%s'\n",scope.data()); + + int i,p=0; + while ((i=result.find(scope,p))!=-1) // for each occurrence + { + tmp+=result.mid(p,i-p); // add part before pattern + p=i+scope.length(); + } + tmp+=result.right(result.length()-p); // add trailing part + + scopeOffset=name.findRev("::",scopeOffset-1); + result = tmp; + } while (scopeOffset>0); + return result; } -static QString trimBaseClassScope(BaseClassList *bcl,const QString &s) +static QCString trimBaseClassScope(BaseClassList *bcl,const QCString &s) { BaseClassListIterator bcli(*bcl); BaseClassDef *bcd; @@ -1528,12 +1604,14 @@ static QString trimBaseClassScope(BaseClassList *bcl,const QString &s) bool matchArguments(ArgumentList *srcAl,ArgumentList *dstAl, const char *cl,const char *ns) { - QString className=cl; - QString namespaceName=ns; + QCString className=cl; + QCString namespaceName=ns; + //printf("matchArguments(%s,%s) className=%s namespaceName=%s\n", // srcAl ? argListToString(srcAl).data() : "", // dstAl ? argListToString(dstAl).data() : "", // cl,ns); + if (srcAl==0 || dstAl==0) { return srcAl==dstAl; // at least one of the members is not a function @@ -1544,6 +1622,7 @@ bool matchArguments(ArgumentList *srcAl,ArgumentList *dstAl, Argument *a=new Argument; a->type = "void"; srcAl->append(a); + return TRUE; } if ( dstAl->count()==0 && srcAl->count()==1 && srcAl->getFirst()->type=="void" ) @@ -1555,6 +1634,7 @@ bool matchArguments(ArgumentList *srcAl,ArgumentList *dstAl, } if (srcAl->count() != dstAl->count()) { + //printf("Different number of arguments!\n"); return FALSE; // different number of arguments -> no match } if (srcAl->constSpecifier != dstAl->constSpecifier) @@ -1572,15 +1652,15 @@ bool matchArguments(ArgumentList *srcAl,ArgumentList *dstAl, Argument *srcA,*dstA; for (;(srcA=srcAli.current(),dstA=dstAli.current());++srcAli,++dstAli) { - QString srcAType=trimTemplateSpecifiers(className,srcA->type); - QString dstAType=trimTemplateSpecifiers(className,dstA->type); + QCString srcAType=trimTemplateSpecifiers(className,srcA->type); + QCString dstAType=trimTemplateSpecifiers(className,dstA->type); if (srcAType!=dstAType) // check if the argument only differs on name { - //printf("`%s' <=> `%s'\n",srcAType.data(),dstAType.data()); + //printf("scope=`%s': `%s' <=> `%s'\n",className.data(),srcAType.data(),dstAType.data()); - QString srcScope; - QString dstScope; + QCString srcScope; + QCString dstScope; // strip redundant scope specifiers if (!className.isEmpty()) @@ -1778,6 +1858,10 @@ void mergeArguments(ArgumentList *srcAl,ArgumentList *dstAl) dstA->type = srcA->type.copy(); dstA->name = dstA->name.copy(); } + else if (!srcA->name.isEmpty() && !dstA->name.isEmpty()) + { + srcA->name = dstA->name.copy(); + } int i1=srcA->type.find("::"), i2=dstA->type.find("::"), j1=srcA->type.length()-i1-2, @@ -1801,335 +1885,523 @@ void mergeArguments(ArgumentList *srcAl,ArgumentList *dstAl) // argListToString(srcAl).data(),argListToString(dstAl).data()); } -//---------------------------------------------------------------------- -// searches for the class and member definitions corresponding with -// memberName and className. -// These classes are returned using `md' and `cd'. -// returns TRUE if the class and member both could be found - -bool getDefs(const QString &memberName,const QString &className, +/*! + * Searches for a member definition given its name `memberName' as a string. + * memberName may also include a (partial) scope to indicate the scope + * in which the member is located. + * + * The parameter `scName' is a string representing the name of the scope in + * which the link was found. + * + * In case of a function args contains a string representation of the + * argument list. Passing 0 means the member has no arguments. + * Passing "()" means any argument list will do, but "()" is preferred. + * + * The function returns TRUE if the member is known and documented or + * FALSE if it is not. + * If TRUE is returned parameter `md' contains a pointer to the member + * definition. Furthermore exactly one of the parameter `cd', `nd', or `fd' + * will be non-zero: + * - if `cd' is non zero, the member was found in a class pointed to by cd. + * - if `nd' is non zero, the member was found in a namespace pointed to by nd. + * - if `fd' is non zero, the member was found in the global namespace of + * file fd. + */ +bool getDefs(const QCString &scName,const QCString &memberName, const char *args, MemberDef *&md, ClassDef *&cd, FileDef *&fd,NamespaceDef *&nd) { - //printf("Search for %s::%s %s\n",className.data(),memberName.data(),args); fd=0, md=0, cd=0, nd=0; - if (memberName.length()==0) return FALSE; - MemberName *mn; - if ((mn=memberNameDict[memberName]) && className.length()>0) + if (memberName.length()==0) return FALSE; /* empty name => nothing to link */ + + QCString scopeName=scName.copy(); + //printf("Search for name=%s args=%s in scope=%s\n", + // memberName.data(),args,scopeName.data()); + + int is,im,pm=0; + // strip common part of the scope from the scopeName + while ((is=scopeName.findRev("::"))!=-1 && + (im=memberName.find("::",pm))!=-1 && + (scopeName.right(scopeName.length()-is-2)==memberName.mid(pm,im-pm)) + ) + { + scopeName=scopeName.left(is); + pm=im+2; + } + //printf("result after scope corrections scope=%s name=%s\n", + // scopeName.data(),memberName.data()); + + QCString mName=memberName; + QCString mScope; + if ((im=memberName.findRev("::"))!=-1) + { + mScope=memberName.left(im); + mName=memberName.right(memberName.length()-im-2); + } + + // handle special the case where both scope name and member scope are equal + if (mScope==scopeName) scopeName.resize(0); + + //printf("mScope=`%s' mName=`%s'\n",mScope.data(),mName.data()); + + MemberName *mn = memberNameDict[mName]; + if (mn && scopeName.length()+mScope.length()>0) { //printf(" >member name found\n"); - ClassDef *fcd=0; - //printf("className=%s\n",className.data()); - if ((fcd=getClass(className)) && fcd->hasDocumentation()) - { - //printf(" >member class found\n"); - MemberDef *mmd=mn->first(); - int mdist=maxInheritanceDepth; - while (mmd) + int scopeOffset=scopeName.length(); + do + { + QCString className = scopeName.left(scopeOffset); + if (!className.isEmpty() && !mScope.isEmpty()) { - if ((mmd->protection()!=Private || extractPrivateFlag) && - mmd->hasDocumentation() - /*mmd->detailsAreVisible()*/ - /* && (args==0 || matchArgumentsOld(mmd->argsString(),args)) */ - ) + className.append("::"+mScope); + } + else if (!mScope.isEmpty()) + { + className=mScope.copy(); + } + //printf("Trying class scope %s\n",className.data()); + + ClassDef *fcd=0; + if ((fcd=getClass(className)) && // is it a documented class + fcd->isVisibleExt() + ) + { + //printf(" Found fcd=%p\n",fcd); + MemberDef *mmd=mn->first(); + int mdist=maxInheritanceDepth; + while (mmd) { - bool match=TRUE; - ArgumentList *argList=0; - if (args) - { - match=FALSE; - argList=new ArgumentList; - stringToArgumentList(args,argList); - match=matchArguments(mmd->argumentList(),argList); - } - if (match) + if ((mmd->protection()!=Private || Config::extractPrivateFlag) && + mmd->hasDocumentation() + /*mmd->detailsAreVisible()*/ + /* && (args==0 || matchArgumentsOld(mmd->argsString(),args)) */ + ) { - ClassDef *mcd=mmd->memberClass(); - int m=minClassDistance(fcd,mcd); - if (m<mdist && mcd->isVisible()) + bool match=TRUE; + ArgumentList *argList=0; + if (args) { - mdist=m; - cd=mcd; - md=mmd; + argList=new ArgumentList; + stringToArgumentList(args,argList); + match=matchArguments(mmd->argumentList(),argList); + } + if (match) + { + ClassDef *mcd=mmd->memberClass(); + int m=minClassDistance(fcd,mcd); + if (m<mdist && mcd->isVisible()) + { + mdist=m; + cd=mcd; + md=mmd; + } + } + if (argList) + { + delete argList; } } - if (argList) - { - delete argList; - } + mmd=mn->next(); } - mmd=mn->next(); - } - if (mdist==maxInheritanceDepth && !strcmp(args,"()")) - // no exact match found, but if args="()" an arbitrary member will do - { - //printf(" >Searching for arbitrary member\n"); - mmd=mn->first(); - while (mmd) + if (mdist==maxInheritanceDepth && !strcmp(args,"()")) + // no exact match found, but if args="()" an arbitrary member will do { - if ((mmd->protection()!=Private || extractPrivateFlag) && - ( - mmd->hasDocumentation() - /*mmd->detailsAreVisible()*/ - || mmd->isReference() - ) - ) + //printf(" >Searching for arbitrary member\n"); + mmd=mn->last(); + while (mmd) { - ClassDef *mcd=mmd->memberClass(); - //printf(" >Class %s found\n",mcd->name().data()); - int m=minClassDistance(fcd,mcd); - if (m<mdist && mcd->isVisible()) + if ((mmd->protection()!=Private || Config::extractPrivateFlag) && + ( + mmd->hasDocumentation() + /*mmd->detailsAreVisible()*/ + || mmd->isReference() + ) + ) { - //printf("Class distance %d\n",m); - mdist=m; - cd=mcd; - md=mmd; + ClassDef *mcd=mmd->memberClass(); + //printf(" >Class %s found\n",mcd->name().data()); + int m=minClassDistance(fcd,mcd); + if (m<mdist && mcd->isVisible()) + { + //printf("Class distance %d\n",m); + mdist=m; + cd=mcd; + md=mmd; + } } + mmd=mn->prev(); } - mmd=mn->next(); } + //printf(" >Succes=%d\n",mdist<maxInheritanceDepth); + if (mdist<maxInheritanceDepth) return TRUE; /* found match */ + } + /* goto the parent scope */ + + if (scopeOffset==0) + { + scopeOffset=-1; } - //printf(" >Succes=%d\n",mdist<maxInheritanceDepth); - return mdist<maxInheritanceDepth; - } + else if ((scopeOffset=scopeName.findRev("::",scopeOffset-1))==-1) + { + scopeOffset=0; + } + } while (scopeOffset>=0); + + // unknown or undocumented scope } else // maybe an namespace or file member ? { - MemberName *mn; - if ((mn=functionNameDict[memberName])) // name is known + //printf("Testing for global function scopeName=`%s' mScope=`%s' :: mName=`%s'\n", + // scopeName.data(),mScope.data(),mName.data()); + //printf(" >member name found\n"); + if ((mn=functionNameDict[mName])) // name is known { NamespaceDef *fnd=0; - if (className.length()>0 && (fnd=namespaceDict[className]) && - fnd->hasDocumentation()) - { // inside a namespace - MemberDef *mmd=mn->first(); - while (mmd) + int scopeOffset=scopeName.length(); + do + { + QCString namespaceName = scopeName.left(scopeOffset); + if (!namespaceName.isEmpty() && !mScope.isEmpty()) + { + namespaceName.append("::"+mScope); + } + else if (!mScope.isEmpty()) { - if (mmd->getNamespace()==fnd && mmd->hasDocumentation()) - { // namespace is found - nd=fnd; - md=mmd; - return TRUE; + namespaceName=mScope.copy(); + } + if (namespaceName.length()>0 && + (fnd=namespaceDict[namespaceName]) && + fnd->isVisibleExt() + ) + { + //printf("Function inside existing namespace `%s'\n",namespaceName.data()); + bool found=FALSE; + MemberDef *mmd=mn->first(); + while (mmd && !found) + { + //printf("mmd->getNamespace()=%p fnd=%p\n", + // mmd->getNamespace(),fnd); + if (mmd->getNamespace()==fnd && + (mmd->isReference() || mmd->hasDocumentation()) + ) + { // namespace is found + bool match=TRUE; + ArgumentList *argList=0; + if (args) + { + argList=new ArgumentList; + stringToArgumentList(args,argList); + match=matchArguments(mmd->argumentList(),argList); + } + if (match) + { + nd=fnd; + md=mmd; + found=TRUE; + } + if (args) + { + delete argList; + } + } + mmd=mn->next(); } - mmd=mn->next(); + if (!found && !strcmp(args,"()")) + // no exact match found, but if args="()" an arbitrary + // member will do + { + MemberDef *mmd=mn->last(); // searching backward will get + // the first defined! + while (mmd && !found) + { + if (mmd->getNamespace()==fnd && + (mmd->isReference() || mmd->hasDocumentation()) + ) + { + nd=fnd; + md=mmd; + found=TRUE; + } + mmd=mn->prev(); + } + } + if (found) return TRUE; } - } - // maybe a file member (e.g. global function or variable) - md=mn->first(); - while (md) - { - if (/*md->detailsAreVisible()*/ md->hasDocumentation()) + else // no scope => global function { - fd=md->getFileDef(); - if (fd && fd->hasDocumentation()) + //printf("Function with global scope `%s'\n",namespaceName.data()); + md=mn->first(); + while (md) + { + if (md->isReference() || md->hasDocumentation()) + { + //printf("md->name()=`%s'\n",md->name().data()); + fd=md->getFileDef(); + if (fd && (fd->isReference() || fd->hasDocumentation())) + { + //printf("fd->name()=`%s'\n",fd->name().data()); + bool match=TRUE; + ArgumentList *argList=0; + if (args) + { + argList=new ArgumentList; + stringToArgumentList(args,argList); + match=matchArguments(md->argumentList(),argList); + delete argList; + } + if (match) return TRUE; + } + } + md=mn->next(); + } + if (!strcmp(args,"()")) { - return TRUE; + // no exact match found, but if args="()" an arbitrary + // member will do + md=mn->last(); + while (md) + { + if (md->isReference() || md->hasDocumentation()) + { + //printf("md->name()=`%s'\n",md->name().data()); + fd=md->getFileDef(); + if (fd && (fd->isReference() || fd->hasDocumentation())) + { + return TRUE; + } + } + md=mn->prev(); + } } } - md=mn->next(); - } + if (scopeOffset==0) + { + scopeOffset=-1; + } + else if ((scopeOffset=scopeName.findRev("::",scopeOffset-1))==-1) + { + scopeOffset=0; + } + } while (scopeOffset>=0); + } + else + { + //printf("Unknown function `%s'\n",mName.data()); } } return FALSE; } -//---------------------------------------------------------------------- -// Generate a hypertext link to the class with name `clName'. -// If linkTxt is not null this text is used as the link, otherwise -// the name of the class will be used. If the class could be found a -// hypertext link (in HTML) is written, otherwise the text of the link will -// be written. - -void generateClassRef(OutputList &ol,const char *clName,const char *linkTxt) +/*! + * Searches for a scope definition given its name as a string via parameter + * `scope'. + * + * The parameter `docScope' is a string representing the name of the scope in + * which the `scope' string was found. + * + * The function returns TRUE if the scope is known and documented or + * FALSE if it is not. + * If TRUE is returned exactly one of the parameter `cd', `nd' + * will be non-zero: + * - if `cd' is non zero, the scope was a class pointed to by cd. + * - if `nd' is non zero, the scope was a namespace pointed to by nd. + */ +bool getScopeDefs(const char *docScope,const char *scope, + ClassDef *&cd, NamespaceDef *&nd) { - QString className=clName; - QString linkText=linkTxt ? linkTxt : (const char *)className; - if (className.length()==0) - { - ol.docify(linkText); - return; - } - ClassDef *cd=0; - NamespaceDef *nd=0; - if ((cd=getClass(className)) && cd->isVisible()) - { - ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,linkText); - if (!cd->isReference()) ol.writePageRef(cd->name(),0); - } - else if ((nd=namespaceDict[className]) && nd->hasDocumentation()) + cd=0;nd=0; + + QCString scopeName=scope; + //printf("getScopeDefs: docScope=`%s' scope=`%s'\n",docScope,scope); + if (scopeName.length()==0) return FALSE; + + QCString docScopeName=docScope; + int scopeOffset=docScopeName.length(); + + do // for each possible docScope (from largest to and including empty) { - ol.writeObjectLink(nd->getReference(),nd->getOutputFileBase(),0,linkText); - ol.writePageRef(nd->name(),0); - } - else - ol.docify(linkText); + QCString fullName=scopeName.copy(); + if (scopeOffset>0) fullName.prepend(docScopeName.left(scopeOffset)+"::"); + + if ((cd=getClass(fullName)) && cd->isVisibleExt()) + { + return TRUE; // class link written => quit + } + else if ((nd=namespaceDict[fullName]) && nd->isVisibleExt()) + { + return TRUE; // namespace link written => quit + } + if (scopeOffset==0) + { + scopeOffset=-1; + } + else if ((scopeOffset=docScopeName.findRev("::",scopeOffset-1))==-1) + { + scopeOffset=0; + } + } while (scopeOffset>=0); + + return FALSE; } -//---------------------------------------------------------------------- -// generate a reference to a class or member. -// `clName' is the name of the class that contains the documentation -// string that is returned. -// `name' is the name of the member or class that we want to link to. -// `name' may have five formats: -// 1) "ClassName" -// 2) "memberName()" one of the (overloaded) function or define -// with name memberName. -// 3) "memberName(...)" a specific (overloaded) function or define -// with name memberName -// 4) "::memberName a non-function member or define -// 5) ("ClassName::")+"memberName()" -// 6) ("ClassName::")+"memberName(...)" -// 7) ("ClassName::")+"memberName" - -void generateRef(OutputList &ol,const char *clName, +/*! + * generate a reference to a class, namespace or member. + * `scName' is the name of the scope that contains the documentation + * string that is returned. + * `name' is the name that we want to link to. + * `name' may have five formats: + * 1) "ScopeName" + * 2) "memberName()" one of the (overloaded) function or define + * with name memberName. + * 3) "memberName(...)" a specific (overloaded) function or define + * with name memberName + * 4) "::memberName a non-function member or define + * 5) ("ScopeName::")+"memberName()" + * 6) ("ScopeName::")+"memberName(...)" + * 7) ("ScopeName::")+"memberName" + * instead of :: the # symbol may also be used. + */ + +void generateRef(OutputList &ol,const char *scName, const char *name,bool inSeeBlock,const char *rt) { - //printf("generateRef(clName=%s,name=%s,rt=%s)\n",clName,name,rt); + //printf("generateRef(scName=%s,name=%s,rt=%s)\n",scName,name,rt); - // check if we have a plane name - QString tmpName = substitute(name,"#","::"); - QString linkText = rt; + QCString tmpName = substitute(name,"#","::"); + QCString linkText = rt; int scopePos=tmpName.findRev("::"); - int bracePos=tmpName.find('('); - if (scopePos==-1 && bracePos==-1) + int bracePos=tmpName.findRev('('); // reverse is needed for operator()(...) + if (bracePos==-1) // simple name { - if (!inSeeBlock) /* check for class link */ + ClassDef *cd=0; + NamespaceDef *nd=0; + if (linkText.isNull()) linkText=tmpName; + // check if this is a class or namespace reference + if (scName!=tmpName && getScopeDefs(scName,name,cd,nd)) { - if (linkText.isNull()) linkText=tmpName; - // check if this is a class reference - if (clName!=tmpName) - generateClassRef(ol,name,linkText); - else - ol.docify(linkText); + if (cd) // scope matches that of a class + { + ol.writeObjectLink(cd->getReference(), + cd->getOutputFileBase(),0,linkText); + if (!cd->isReference()) + ol.writePageRef(cd->name(),0); + } + else // scope matches that of a namespace + { + ol.writeObjectLink(nd->getReference(), + nd->getOutputFileBase(),0,linkText); + if (!nd->getReference()) + ol.writePageRef(nd->name(),0); + } + // link has been written, stop now. return; } - else /* check if it is a class, if not continue to search */ + else if (scName==tmpName || (!inSeeBlock && scopePos==-1)) // nothing to link => output plain text { - if (clName!=tmpName && getClass(tmpName)!=0) - { - generateClassRef(ol,tmpName,linkText); - return; - } + ol.docify(linkText); + // text has been written, stop now. + return; } + // continue search... + linkText = rt; } // extract scope - QString scopeContext=clName; - QString scopeUser; - if (scopePos>0) scopeUser=tmpName.left(scopePos); - + QCString scopeStr=scName; + //printf("scopeContext=%s scopeUser=%s\n",scopeContext.data(),scopeUser.data()); - // extract name - int startNamePos=scopePos!=-1 ? scopePos+2 : 0; + // extract userscope+name int endNamePos=bracePos!=-1 ? bracePos : tmpName.length(); - QString nameStr=tmpName.mid(startNamePos,endNamePos-startNamePos); + QCString nameStr=tmpName.left(endNamePos); // extract arguments - QString argsStr; + QCString argsStr; if (bracePos!=-1) argsStr=tmpName.right(tmpName.length()-bracePos); // create a default link text if none was explicitly given bool explicitLink=TRUE; if (linkText.isNull()) { - if (!scopeUser.isEmpty()) linkText=scopeUser+"::"; - linkText+=nameStr; + //if (!scopeUser.isEmpty()) linkText=scopeUser+"::"; + linkText=nameStr; + if (linkText.left(2)=="::") linkText=linkText.right(linkText.length()-2); explicitLink=FALSE; } //printf("scope=`%s' name=`%s' arg=`%s' linkText=`%s'\n", // scopeStr.data(),nameStr.data(),argsStr.data(),linkText.data()); - //Define *d=0; MemberDef *md = 0; ClassDef *cd = 0; FileDef *fd = 0; NamespaceDef *nd = 0; - int scopeOffset=scopeContext.length(); - do + + //printf("Try with scName=`%s' nameStr=`%s' argsStr=`%s'\n", + // scopeStr.data(),nameStr.data(),argsStr.data()); + + // check if nameStr is a member or global. + if (getDefs(scopeStr,nameStr,argsStr,md,cd,fd,nd)) { - QString totalScope=scopeUser.copy(); - if (scopeOffset>0) + //printf("after getDefs nd=%p\n",nd); + QCString anchor = (md->isReference() || md->hasDocumentation()) ? md->anchor() : 0; + QCString cName,aName; + if (cd) // nameStr is a member of cd { - if (!totalScope.isEmpty()) totalScope.prepend("::"); - totalScope.prepend(scopeContext.left(scopeOffset)); + //printf("addObjectLink(%s,%s,%s,%s)\n",cd->getReference(), + // cd->getOutputFileBase(),anchor.data(),resultName.stripWhiteSpace().data()); + ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(), + anchor,linkText.stripWhiteSpace()); + cName=cd->name(); + aName=md->anchor(); } - //printf("Try with totalScope=`%s'\n",totalScope.data()); - // check if nameStr is a member or global. - if (getDefs(nameStr,totalScope,argsStr,md,cd,fd,nd)) + else if (nd) // nameStr is a member of nd { - QString anchor = md->hasDocumentation() ? md->anchor() : 0; - QString cName,aName; - if (cd) // nameStr is a member of cd - { - //printf("addObjectLink(%s,%s,%s,%s)\n",cd->getReference(), - // cd->getOutputFileBase(),anchor.data(),resultName.stripWhiteSpace().data()); - ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(), - anchor,linkText.stripWhiteSpace()); - cName=cd->name(); - aName=md->anchor(); - } - else if (nd) // nameStr is a member of nd - { - ol.writeObjectLink(nd->getReference(),nd->getOutputFileBase(), - anchor,linkText.stripWhiteSpace()); - cName=nd->name(); - aName=md->anchor(); - } - else if (fd) // nameStr is a global in file fd - { - //printf("addFileLink(%s,%s,%s)\n",fd->getOutputFileBase(),anchor.data(), - // resultName.stripWhiteSpace().data()); - ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(), - anchor,linkText.stripWhiteSpace()); - cName=fd->name(); - aName=md->anchor(); - } - else // should not be reached - { - //printf("add no link fd=cd=0\n"); - ol.docify(linkText); - } + //printf("writing namespace link\n"); + ol.writeObjectLink(nd->getReference(),nd->getOutputFileBase(), + anchor,linkText.stripWhiteSpace()); + cName=nd->name(); + aName=md->anchor(); + } + else if (fd) // nameStr is a global in file fd + { + //printf("addFileLink(%s,%s,%s)\n",fd->getOutputFileBase(),anchor.data(), + // resultName.stripWhiteSpace().data()); + ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(), + anchor,linkText.stripWhiteSpace()); + cName=fd->name(); + aName=md->anchor(); + } + else // should not be reached + { + //printf("add no link fd=cd=0\n"); + ol.docify(linkText); + } - // for functions we add the arguments if explicitly specified or else "()" - if (!rt && (md->isFunction() || md->isPrototype() || md->isSignal() || md->isSlot())) - { - if (argsStr.isNull()) - ol.writeString("()"); - else - ol.docify(argsStr); - } + // for functions we add the arguments if explicitly specified or else "()" + if (!rt && (md->isFunction() || md->isPrototype() || md->isSignal() || md->isSlot())) + { + if (argsStr.isNull()) + ol.writeString("()"); + else + ol.docify(argsStr); + } - // generate the page reference (for LaTeX) - if (cName.length()>0 || aName.length()>0) + // generate the page reference (for LaTeX) + if (cName.length()>0 || aName.length()>0) + { + if ( + (cd && !cd->isReference() && cd->isVisible()) || + (fd && !fd->isReference()) || + (nd /* TODO: && !nd->isReference() */) + ) { - if ( - (cd && !cd->isReference() && cd->isVisible()) || - (fd && !fd->isReference()) || - (nd /* TODO: && !nd->isReference() */) - ) - { - ol.writePageRef(cName,aName); - } + ol.writePageRef(cName,aName); } - return; } - // else if (!nameStr.isNull() && (d=defineDict[nameStr])) - // // check if nameStr is perhaps a define - // { - // if (d->hasDocumentation() && d->fileDef) - // { - // ol.writeObjectLink(0,d->fileDef->getOutputFileBase(),d->anchor, - // linkText.stripWhiteSpace()); - // if (!explicitLink) ol.docify(argsStr); - // } - // } - if (scopeOffset==0) - scopeOffset=-1; - else if ((scopeOffset=scopeContext.findRev("::",scopeOffset-1))==-1) - scopeOffset=0; - } while (scopeOffset>=0); - + return; + } + // nothing found if (rt) ol.docify(rt); @@ -2150,9 +2422,9 @@ void generateRef(OutputList &ol,const char *clName, void generateLink(OutputList &ol,const char *clName, const char *lr,bool inSeeBlock,const char *lt) { - QString linkRef=lr; + QCString linkRef=lr; //PageInfo *pi=0; - //printf("generateLink(%s,%s)\n",lr,lt); + //printf("generateLink(%s,%s,%s) inSeeBlock=%d\n",clName,lr,lt,inSeeBlock); //FileInfo *fi=0; FileDef *fd; bool ambig; @@ -2172,7 +2444,7 @@ void generateLink(OutputList &ol,const char *clName, void generateFileRef(OutputList &ol,const char *name,const char *text) { - QString linkText = text ? text : name; + QCString linkText = text ? text : name; //FileInfo *fi; FileDef *fd; bool ambig; @@ -2186,14 +2458,14 @@ void generateFileRef(OutputList &ol,const char *name,const char *text) //---------------------------------------------------------------------- -QString substituteClassNames(const QString &s) +QCString substituteClassNames(const QCString &s) { int i=0,l,p; - QString result; + QCString result; QRegExp r("[a-z_A-Z][a-z_A-Z0-9]*"); while ((p=r.match(s,i,&l))!=-1) { - QString *subst; + QCString *subst; if (p>i) result+=s.mid(i,p-i); if ((subst=substituteDict[s.mid(p,l)])) { @@ -2211,14 +2483,14 @@ QString substituteClassNames(const QString &s) //---------------------------------------------------------------------- -QString convertSlashes(const QString &s,bool dots) +QCString convertSlashes(const QCString &s,bool dots) { - QString result; + QCString result; int i,l=s.length(); for (i=0;i<l;i++) if (s.at(i)!='/' && (!dots || s.at(i)!='.')) { - if (caseSensitiveNames) + if (Config::caseSensitiveNames) { result+=s[i]; } @@ -2235,10 +2507,10 @@ QString convertSlashes(const QString &s,bool dots) //---------------------------------------------------------------------- // substitute all occurences of `src' in `s' by `dst' -QString substitute(const char *s,const char *src,const char *dst) +QCString substitute(const char *s,const char *src,const char *dst) { - QString input=s; - QString output; + QCString input=s; + QCString output; int i=0,p; while ((p=input.find(src,i))!=-1) { @@ -2255,8 +2527,8 @@ QString substitute(const char *s,const char *src,const char *dst) FileDef *findFileDef(const FileNameDict *fnDict,const char *n,bool &ambig) { ambig=FALSE; - QString name=n; - QString path; + QCString name=n; + QCString path; if (name.isNull()) return 0; int slashPos=QMAX(name.findRev('/'),name.findRev('\\')); if (slashPos!=-1) @@ -2298,8 +2570,8 @@ FileDef *findFileDef(const FileNameDict *fnDict,const char *n,bool &ambig) void showFileDefMatches(const FileNameDict *fnDict,const char *n) { - QString name=n; - QString path; + QCString name=n; + QCString path; int slashPos=QMAX(name.findRev('/'),name.findRev('\\')); if (slashPos!=-1) { @@ -2323,10 +2595,10 @@ void showFileDefMatches(const FileNameDict *fnDict,const char *n) //---------------------------------------------------------------------- -void setFileNameForSections(QList<QString> *anchorList,const char *fileName) +void setFileNameForSections(QList<QCString> *anchorList,const char *fileName) { if (!anchorList) return; - QString *s=anchorList->first(); + QCString *s=anchorList->first(); while (s) { SectionInfo *si; @@ -41,46 +41,47 @@ extern void writeMemberDocs(OutputList &ol, MemberList *ml,const char *scopeName,MemberDef::MemberType m); extern void setAnchors(char id,MemberList *ml); //extern int countMemberDocs(MemberList *ml,MemberDef::MemberType m); -extern QString fileToString(const char *name); -extern QString dateToString(bool); +extern QCString fileToString(const char *name); +extern QCString dateToString(bool); //extern OutputList linkifyText(const char *clName,const char *name, // const char *text); -extern bool getDefs(const QString &memberName,const QString &className, +extern bool getDefs(const QCString &scopeName,const QCString &memberName, const char *, MemberDef *&md, ClassDef *&cd,FileDef *&fd, NamespaceDef *&nd); extern void generateRef(OutputList &ol,const char *, const char *,bool inSeeBlock,const char * =0); extern void generateLink(OutputList &ol,const char *, const char *,bool inSeeBlock,const char *); -extern void generateClassRef(OutputList &ol,const char *clName, - const char *linkTxt=0); +//extern void generateClassRef(OutputList &ol,const char *clName, +// const char *linkTxt=0); extern void generateFileRef(OutputList &ol,const char *, const char *linkTxt=0); extern bool matchArguments(ArgumentList *,ArgumentList *, const char *cl=0,const char *ns=0); extern void mergeArguments(ArgumentList *,ArgumentList *); -extern QString substituteClassNames(const QString &s); -extern QString convertSlashes(const QString &s,bool dots=FALSE); -extern QString substitute(const char *s,const char *src,const char *dst); -extern QString resolveDefines(const char *n); +extern QCString substituteClassNames(const QCString &s); +extern QCString convertSlashes(const QCString &s,bool dots=FALSE); +extern QCString substitute(const char *s,const char *src,const char *dst); +extern QCString resolveDefines(const char *n); extern ClassDef *getClass(const char *key); //extern int strcscmp(const char *s1,const char *s2); extern FileDef *findFileDef(const FileNameDict *fnDict,const char *n, bool &ambig); extern void showFileDefMatches(const FileNameDict *fnDict,const char *n); extern int guessSection(const char *name); -//extern QString nameToFile(const char *name); +//extern QCString nameToFile(const char *name); extern bool isId(char c); -extern QString removeRedundantWhiteSpace(const QString &s); +extern QCString removeRedundantWhiteSpace(const QCString &s); extern void startTitle(OutputList &ol); extern void endTitle(OutputList &ol,const char *name); void startFile(OutputList &ol,const char *name, const char *title,bool external=FALSE); void endFile(OutputList &ol,bool external=FALSE); void writeQuickLinks(OutputList &ol,bool compact,bool external=FALSE); -QString argListToString(ArgumentList *al); -QString generateMarker(int id); +QCString argListToString(ArgumentList *al); +QCString generateMarker(int id); void writeExample(OutputList &ol,ExampleList *el); -void setFileNameForSections(QList<QString> *anchorList,const char *fileName); +void setFileNameForSections(QList<QCString> *anchorList,const char *fileName); +QCString stripAnnonymousScope(const QCString &s); #endif |