diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2001-07-23 14:06:43 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2001-07-23 14:06:43 (GMT) |
commit | ea8a1bc7ccbd7b64a31c293caa31240bde7397cf (patch) | |
tree | 8bdbe4421ef1ea29861efd26ccfc83849a184148 /src | |
parent | 5346e18047c0e047db2f1b13dc2c767a73c5c305 (diff) | |
download | Doxygen-ea8a1bc7ccbd7b64a31c293caa31240bde7397cf.zip Doxygen-ea8a1bc7ccbd7b64a31c293caa31240bde7397cf.tar.gz Doxygen-ea8a1bc7ccbd7b64a31c293caa31240bde7397cf.tar.bz2 |
Release-1.2.8-20010723
Diffstat (limited to 'src')
-rw-r--r-- | src/classdef.cpp | 166 | ||||
-rw-r--r-- | src/classdef.h | 10 | ||||
-rw-r--r-- | src/config.h | 31 | ||||
-rw-r--r-- | src/config.l | 231 | ||||
-rw-r--r-- | src/declinfo.l | 34 | ||||
-rw-r--r-- | src/definition.h | 2 | ||||
-rw-r--r-- | src/doxygen.cpp | 500 | ||||
-rw-r--r-- | src/doxygen.pro.in | 2 | ||||
-rw-r--r-- | src/doxytag.pro.in | 2 | ||||
-rw-r--r-- | src/entry.cpp | 103 | ||||
-rw-r--r-- | src/entry.h | 5 | ||||
-rw-r--r-- | src/htmlgen.cpp | 1 | ||||
-rw-r--r-- | src/index.cpp | 3 | ||||
-rw-r--r-- | src/language.cpp | 5 | ||||
-rw-r--r-- | src/latexgen.cpp | 11 | ||||
-rw-r--r-- | src/libdoxygen.pro.in | 9 | ||||
-rw-r--r-- | src/main.cpp | 1 | ||||
-rw-r--r-- | src/memberdef.cpp | 139 | ||||
-rw-r--r-- | src/memberdef.h | 17 | ||||
-rw-r--r-- | src/pre.l | 3 | ||||
-rw-r--r-- | src/rtfgen.cpp | 10 | ||||
-rw-r--r-- | src/scanner.l | 160 | ||||
-rw-r--r-- | src/tagreader.cpp | 131 | ||||
-rw-r--r-- | src/translator.cpp | 117 | ||||
-rw-r--r-- | src/translator.h | 124 | ||||
-rw-r--r-- | src/translator_cz.h | 15 | ||||
-rw-r--r-- | src/translator_pt.h | 587 | ||||
-rw-r--r-- | src/translator_ua.h | 1329 | ||||
-rw-r--r-- | src/util.cpp | 98 | ||||
-rw-r--r-- | src/util.h | 5 | ||||
-rw-r--r-- | src/xmlgen.cpp | 500 | ||||
-rw-r--r-- | src/xmlgen.h | 20 |
32 files changed, 3499 insertions, 872 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp index f7c0550..6dbc086 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -127,15 +127,11 @@ QCString ClassDef::displayName() const QCString n; if (Config_getBool("HIDE_SCOPE_NAMES")) { - n=stripScope(name()); + n=localName(); } else { - n=name(); - } - if (m_tempArgs) - { - n+=tempArgListToString(m_tempArgs); + n=qualifiedNameWithTemplateParameters(); } return n; } @@ -603,32 +599,70 @@ ArgumentList *ClassDef::outerTemplateArguments() const return 0; } +static void searchTemplateSpecs(/*in*/ Definition *d, + /*out*/ QList<ArgumentList> &result, + /*out*/ QCString &name) +{ + if (d->definitionType()==Definition::TypeClass) + { + if (d->getOuterScope()) + { + searchTemplateSpecs(d->getOuterScope(),result,name); + } + ClassDef *cd=(ClassDef *)d; + if (!name.isEmpty()) name+="::"; + name+=d->localName(); + bool isSpecialization = d->localName().find('<')!=-1; + if (cd->templateArguments()) + { + result.append(cd->templateArguments()); + if (!isSpecialization) + { + name+=tempArgListToString(cd->templateArguments()); + } + } + } + else + { + name+=d->qualifiedName(); + } +} -static void writeTemplateSpec(OutputList &ol,ArgumentList *al, - const QCString &pageType,const QCString &name) +static void writeTemplateSpec(OutputList &ol,Definition *d, + const QCString &type) { - if (al) // class is a template + QList<ArgumentList> specs; + QCString name; + searchTemplateSpecs(d,specs,name); + if (specs.count()>0) // class has template scope specifiers { ol.startSubsubsection(); - ol.docify("template<"); - Argument *a=al->first(); - while (a) + QListIterator<ArgumentList> spi(specs); + ArgumentList *al; + for (spi.toFirst();(al=spi.current());++spi) { - ol.docify(a->type); - if (!a->name.isEmpty()) + ol.docify("template<"); + Argument *a=al->first(); + while (a) { - ol.docify(" "); - ol.docify(a->name); + ol.docify(a->type); + if (!a->name.isEmpty()) + { + ol.docify(" "); + ol.docify(a->name); + } + if (a->defval.length()!=0) + { + ol.docify(" = "); + ol.docify(a->defval); + } + a=al->next(); + if (a) ol.docify(", "); } - if (a->defval.length()!=0) - { - ol.docify(" = "); - ol.docify(a->defval); - } - a=al->next(); - if (a) ol.docify(", "); + ol.docify(">"); + ol.lineBreak(); } - ol.docify("> "+pageType.lower()+" "+name); + ol.docify(type.lower()+" "+name); ol.endSubsubsection(); ol.writeString("\n"); } @@ -735,7 +769,7 @@ void ClassDef::writeDocumentation(OutputList &ol) if (Config_getBool("CLASS_DIAGRAMS")) ol.disableAllBut(OutputGenerator::Man); - // write subclasses + // write super classes int count; if ((count=m_inherits->count())>0) { @@ -1005,7 +1039,7 @@ void ClassDef::writeDocumentation(OutputList &ol) ol.endGroupHeader(); ol.startTextBlock(); - writeTemplateSpec(ol,outerTempArgList,pageType,name()); + writeTemplateSpec(ol,this,pageType); // repeat brief description if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) @@ -1046,8 +1080,10 @@ void ClassDef::writeDocumentation(OutputList &ol) } else { - writeTemplateSpec(ol,outerTempArgList,pageType,name()); + writeTemplateSpec(ol,this,pageType); } + + typedefMembers.writeDocumentation(ol,name(),this, theTranslator->trMemberTypedefDocumentation()); @@ -1140,6 +1176,20 @@ void ClassDef::writeDocumentation(OutputList &ol) } endFile(ol); + + + // write inner classes after the parent, so the tag files contain + // the definition in proper order! + if (m_innerClasses) + { + ClassSDict::Iterator cli(*m_innerClasses); + ClassDef *innerCd; + for (cli.toFirst();(innerCd=cli.current());++cli) + { + msg("Generating docs for nested compound %s...\n",innerCd->name().data()); + innerCd->writeDocumentation(ol); + } + } } // write the list of all (inherited) members for this class @@ -2062,6 +2112,7 @@ ClassDef *ClassDef::insertTemplateInstance(const QCString &fileName, //templateClass->setBriefDescription(briefDescription()); //templateClass->setDocumentation(documentation()); templateClass->setTemplateMaster(this); + templateClass->setOuterScope(getOuterScope()); m_templateInstances->insert(templSpec,templateClass); freshInstance=TRUE; } @@ -2149,3 +2200,64 @@ QCString ClassDef::getReference() const } } +void ClassDef::getTemplateParameterLists(QList<ArgumentList> &lists) const +{ + Definition *d=getOuterScope(); + if (d) + { + if (d->definitionType()==Definition::TypeClass) + { + ClassDef *cd=(ClassDef *)d; + cd->getTemplateParameterLists(lists); + } + } + if (templateArguments()) + { + lists.append(templateArguments()); + } +} + +QCString ClassDef::qualifiedNameWithTemplateParameters( + QList<ArgumentList> *actualParams) const +{ + QCString scName; + Definition *d=getOuterScope(); + if (d) + { + if (d->definitionType()==Definition::TypeClass) + { + ClassDef *cd=(ClassDef *)d; + scName = cd->qualifiedNameWithTemplateParameters(actualParams); + } + else + { + scName = d->qualifiedName(); + } + } + if (!scName.isEmpty()) scName+="::"; + scName+=localName(); + ArgumentList *al=0; + bool isSpecialization = localName().find('<')!=-1; + if (templateArguments()) + { + if (actualParams && (al=actualParams->current())) + { + if (!isSpecialization) + { + scName+=tempArgListToString(al); + } + actualParams->next(); + } + else + { + if (!isSpecialization) + { + scName+=tempArgListToString(templateArguments()); + } + } + } + //printf("scope=%s qualifiedName=%s\n",name().data(),scName.data()); + return scName; +} + + diff --git a/src/classdef.h b/src/classdef.h index 323b7bd..e662152 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -184,6 +184,16 @@ class ClassDef : public Definition */ virtual Definition *findInnerCompound(const char *name); + /*! Returns the template parameter lists that form the template + * declaration of this class. + * + * Example: <code>template<class T> class TC {};</code> + * will return a list with one ArgumentList containing one argument + * with type="class" and name="T". + */ + void getTemplateParameterLists(QList<ArgumentList> &lists) const; + QCString qualifiedNameWithTemplateParameters( + QList<ArgumentList> *actualParams=0) const; /* member lists by protection */ MemberList pubMembers; diff --git a/src/config.h b/src/config.h index 02a3389..4b00d22 100644 --- a/src/config.h +++ b/src/config.h @@ -307,6 +307,7 @@ class ConfigBool : public ConfigOption QCString m_valueString; }; +// some convenience macros #define Config_getString(val) Config::instance()->getString(__FILE__,__LINE__,val) #define Config_getInt(val) Config::instance()->getInt(__FILE__,__LINE__,val) #define Config_getList(val) Config::instance()->getList(__FILE__,__LINE__,val) @@ -319,6 +320,10 @@ class ConfigBool : public ConfigOption * read from a user-supplied configuration file. * The static member instance() can be used to get * a pointer to the one and only instance. + * + * Set all variables to their default values by + * calling Config::instance()->init() + * */ class Config { @@ -479,11 +484,34 @@ class Config // internal API ///////////////////////////// + /*! Converts the string values read from the configuration file + * to real values for non-string type options (like int, and bools) + */ void convertStrToVal(); + + /*! Replaces references to environment variable by the actual value + * of the environment variable. + */ void substituteEnvironmentVars(); + + /*! Checks if the values of the variable are correct, adjusts them + * if needed, and report any errors. + */ void check(); + + /*! Initialize config variables to their default value */ void init(); - void parse(const QCString &config,const char *fn); + + /*! Parse a configuration file with name \a fn. + * \returns TRUE if successful, FALSE if the file could not be + * opened or read. + */ + bool parse(const char *fn); + + /*! Called from the constructor, will add doxygen's default options + * to the configuration object + */ + void create(); protected: Config() { @@ -498,7 +526,6 @@ class Config delete m_options; delete m_dict; } - void create(); private: QList<ConfigOption> *m_options; diff --git a/src/config.l b/src/config.l index 9ffdf55..583195c 100644 --- a/src/config.l +++ b/src/config.l @@ -22,6 +22,7 @@ //#include <iostream.h> #include <assert.h> #include <ctype.h> +#include <stdarg.h> #include <qfileinfo.h> #include <qdir.h> @@ -31,33 +32,34 @@ #include "config.h" #include "version.h" + +#undef Config_getString +#undef Config_getInt +#undef Config_getList +#undef Config_getEnum +#undef Config_getBool + +// use in-class definitions +#define Config_getString(val) getString(__FILE__,__LINE__,val) +#define Config_getInt(val) getInt(__FILE__,__LINE__,val) +#define Config_getList(val) getList(__FILE__,__LINE__,val) +#define Config_getEnum(val) getEnum(__FILE__,__LINE__,val) +#define Config_getBool(val) getBool(__FILE__,__LINE__,val) -#ifdef DOXYWIZARD -#include <stdarg.h> -void err(const char *fmt, ...) +void config_err(const char *fmt, ...) { va_list args; va_start(args, fmt); vfprintf(stderr, fmt, args); va_end(args); } -void warn_cont(const char *fmt, ...) +void config_warn(const char *fmt, ...) { va_list args; va_start(args, fmt); vfprintf(stderr, fmt, args); va_end(args); } -void initWarningFormat() -{ -} -#else -#include "doxygen.h" -#include "message.h" -#include "pre.h" -#include "version.h" -#include "language.h" -#endif #define MAX_INCLUDE_DEPTH 10 #define YY_NEVER_INTERACTIVE 1 @@ -142,7 +144,7 @@ void ConfigInt::convertStrToVal() int val = m_valueString.toInt(&ok); if (!ok || val<m_minVal || val>m_maxVal) { - warn_cont("Warning: argument `%s' for option %s is not a valid number in the range [%d..%d]!\n" + config_warn("Warning: argument `%s' for option %s is not a valid number in the range [%d..%d]!\n" "Using the default: %d!\n",m_valueString.data(),m_name.data(),m_minVal,m_maxVal,m_value); } m_value=val; @@ -164,7 +166,7 @@ void ConfigBool::convertStrToVal() } else { - warn_cont("Warning: argument `%s' for option %s is not a valid boolean value\n" + config_warn("Warning: argument `%s' for option %s is not a valid boolean value\n" "Using the default: %s!\n",m_valueString.data(),m_name.data(),m_value?"YES":"NO"); } } @@ -175,12 +177,12 @@ QCString &Config::getString(const char *fileName,int num,const char *name) const ConfigOption *opt = m_dict->find(name); if (opt==0) { - err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name); + config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name); exit(1); } else if (opt->kind()!=ConfigOption::O_String) { - err("%s<%d>: Internal error: Requested option %s not of string type!\n",fileName,num,name); + config_err("%s<%d>: Internal error: Requested option %s not of string type!\n",fileName,num,name); exit(1); } return *((ConfigString *)opt)->valueRef(); @@ -191,12 +193,12 @@ QStrList &Config::getList(const char *fileName,int num,const char *name) const ConfigOption *opt = m_dict->find(name); if (opt==0) { - err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name); + config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name); exit(1); } else if (opt->kind()!=ConfigOption::O_List) { - err("%d<%d>: Internal error: Requested option %s not of list type!\n",fileName,num,name); + config_err("%d<%d>: Internal error: Requested option %s not of list type!\n",fileName,num,name); exit(1); } return *((ConfigList *)opt)->valueRef(); @@ -207,12 +209,12 @@ QCString &Config::getEnum(const char *fileName,int num,const char *name) const ConfigOption *opt = m_dict->find(name); if (opt==0) { - err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name); + config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name); exit(1); } else if (opt->kind()!=ConfigOption::O_Enum) { - err("%s<%d>: Internal error: Requested option %s not of enum type!\n",fileName,num,name); + config_err("%s<%d>: Internal error: Requested option %s not of enum type!\n",fileName,num,name); exit(1); } return *((ConfigEnum *)opt)->valueRef(); @@ -223,12 +225,12 @@ int &Config::getInt(const char *fileName,int num,const char *name) const ConfigOption *opt = m_dict->find(name); if (opt==0) { - err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name); + config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name); exit(1); } else if (opt->kind()!=ConfigOption::O_Int) { - err("%s<%d>: Internal error: Requested option %s not of integer type!\n",fileName,num,name); + config_err("%s<%d>: Internal error: Requested option %s not of integer type!\n",fileName,num,name); exit(1); } return *((ConfigInt *)opt)->valueRef(); @@ -239,12 +241,12 @@ bool &Config::getBool(const char *fileName,int num,const char *name) const ConfigOption *opt = m_dict->find(name); if (opt==0) { - err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name); + config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name); exit(1); } else if (opt->kind()!=ConfigOption::O_Bool) { - err("%s<%d>: Internal error: Requested option %s not of integer type!\n",fileName,num,name); + config_err("%s<%d>: Internal error: Requested option %s not of integer type!\n",fileName,num,name); exit(1); } return *((ConfigBool *)opt)->valueRef(); @@ -322,7 +324,7 @@ static FILE *tryPath(const char *path,const char *fileName) if (fi.exists() && fi.isFile()) { FILE *f=fopen(absName,"r"); - if (!f) err("Error: could not open file %s for reading\n",absName.data()); + if (!f) config_err("Error: could not open file %s for reading\n",absName.data()); return f; } return 0; @@ -348,7 +350,7 @@ static FILE *findFile(const char *fileName) static void readIncludeFile(const char *incName) { if (includeDepth==MAX_INCLUDE_DEPTH) { - err("Error: maximum include depth (%d) reached, %s is not included. Aborting...\n", + config_err("Error: maximum include depth (%d) reached, %s is not included. Aborting...\n", MAX_INCLUDE_DEPTH,incName); exit(1); } @@ -389,7 +391,7 @@ static void readIncludeFile(const char *incName) } else { - err("Error: @INCLUDE = %s: not found!\n",inc.data()); + config_err("Error: @INCLUDE = %s: not found!\n",inc.data()); exit(1); } } @@ -418,7 +420,7 @@ static void readIncludeFile(const char *incName) ConfigOption *option = config->get(cmd); if (option==0) // oops not known { - err("Warning: ignoring unsupported tag `%s' at line %d, file %s\n", + config_err("Warning: ignoring unsupported tag `%s' at line %d, file %s\n", yytext,yyLineNr,yyFileName.data()); BEGIN(SkipInvalid); } @@ -464,7 +466,7 @@ static void readIncludeFile(const char *incName) ConfigOption *option = config->get(cmd); if (option==0) // oops not known { - err("Warning: ignoring unsupported tag `%s' at line %d, file %s\n", + config_err("Warning: ignoring unsupported tag `%s' at line %d, file %s\n", yytext,yyLineNr,yyFileName.data()); BEGIN(SkipInvalid); } @@ -485,7 +487,7 @@ static void readIncludeFile(const char *incName) case ConfigOption::O_String: case ConfigOption::O_Int: case ConfigOption::O_Bool: - err("Warning: operator += not supported for `%s'. Ignoring line at line %d, file %s\n", + config_err("Warning: operator += not supported for `%s'. Ignoring line at line %d, file %s\n", yytext,yyLineNr,yyFileName.data()); BEGIN(SkipInvalid); break; @@ -521,7 +523,7 @@ static void readIncludeFile(const char *incName) } } -<Start>[a-z_A-Z0-9]+ { err("Warning: ignoring unknown tag `%s' at line %d, file %s\n",yytext,yyLineNr,yyFileName.data()); } +<Start>[a-z_A-Z0-9]+ { config_err("Warning: ignoring unknown tag `%s' at line %d, file %s\n",yytext,yyLineNr,yyFileName.data()); } <GetString,GetBool,SkipInvalid>\n { yyLineNr++; BEGIN(Start); } <GetStrList>\n { yyLineNr++; @@ -553,7 +555,7 @@ static void readIncludeFile(const char *incName) elemStr+=tmpString; if (*yytext=='\n') { - err("Warning: Missing end quote (\") on line %d, file %s\n",yyLineNr,yyFileName.data()); + config_err("Warning: Missing end quote (\") on line %d, file %s\n",yyLineNr,yyFileName.data()); yyLineNr++; } BEGIN(lastState); @@ -572,7 +574,7 @@ static void readIncludeFile(const char *incName) else { *b=FALSE; - warn_cont("Warning: Invalid value `%s' for " + config_warn("Warning: Invalid value `%s' for " "boolean tag in line %d, file %s; use YES or NO\n", bs.data(),yyLineNr,yyFileName.data()); } @@ -639,11 +641,7 @@ static void writeStringList(QTextStream &t,QStrList &l) void Config::writeTemplate(QFile *f,bool sl,bool upd) { QTextStream t(f); -#ifdef DOXYWIZARD - t << "# Doxygen configuration generated by Doxywizard version " << versionString << endl; -#else t << "# Doxyfile " << versionString << endl << endl; -#endif if (!sl) { t << "# This file describes the settings to be used by the documentation system\n"; @@ -814,7 +812,7 @@ void Config::check() // projectName[0]=toupper(projectName[0]); //} - QCString &warnFormat = getString(__FILE__,__LINE__,"WARN_FORMAT"); + QCString &warnFormat = Config_getString("WARN_FORMAT"); if (warnFormat.isEmpty()) { warnFormat="$file:$line $text"; @@ -823,23 +821,22 @@ void Config::check() { if (warnFormat.find("$file")==-1) { - err("Error: warning format does not contain a $file tag!\n"); + config_err("Error: warning format does not contain a $file tag!\n"); exit(1); } if (warnFormat.find("$line")==-1) { - err("Error: warning format does not contain a $line tag!\n"); + config_err("Error: warning format does not contain a $line tag!\n"); exit(1); } if (warnFormat.find("$text")==-1) { - err("Error: wanring format foes not contain a $text tag!\n"); + config_err("Error: wanring format foes not contain a $text tag!\n"); exit(1); } } - initWarningFormat(); - QCString &manExtension = getString(__FILE__,__LINE__,"MAN_EXTENSION"); + QCString &manExtension = Config_getString("MAN_EXTENSION"); // set default man page extension if non is given by the user if (manExtension.isEmpty()) @@ -847,7 +844,7 @@ void Config::check() manExtension=".3"; } - QCString &paperType = getEnum(__FILE__,__LINE__,"PAPER_TYPE"); + QCString &paperType = Config_getEnum("PAPER_TYPE"); paperType=paperType.lower().stripWhiteSpace(); if (paperType.isEmpty()) { @@ -856,31 +853,18 @@ void Config::check() if (paperType!="a4" && paperType!="a4wide" && paperType!="letter" && paperType!="legal" && paperType!="executive") { - err("Error: Unknown page type specified"); + config_err("Error: Unknown page type specified"); } - QCString &outputLanguage=getEnum(__FILE__,__LINE__,"OUTPUT_LANGUAGE"); + QCString &outputLanguage=Config_getEnum("OUTPUT_LANGUAGE"); outputLanguage=outputLanguage.stripWhiteSpace(); if (outputLanguage.isEmpty()) { outputLanguage = "English"; -#ifndef DOXYWIZARD - setTranslator("English"); -#endif - } - else - { -#ifndef DOXYWIZARD - if (!setTranslator(outputLanguage)) - { - err("Error: Output language %s not supported! Using English instead.\n", - outputLanguage.data()); - } -#endif } // expand the relative stripFromPath values - QStrList &stripFromPath = getList(__FILE__,__LINE__,"STRIP_FROM_PATH"); + QStrList &stripFromPath = Config_getList("STRIP_FROM_PATH"); char *sfp = stripFromPath.first(); while (sfp) { @@ -903,57 +887,54 @@ void Config::check() // Test to see if HTML header is valid - QCString &headerFile = getString(__FILE__,__LINE__,"HTML_HEADER"); + QCString &headerFile = Config_getString("HTML_HEADER"); if (!headerFile.isEmpty()) { QFileInfo fi(headerFile); if (!fi.exists()) { - err("Error: tag HTML_HEADER: header file `%s' " + config_err("Error: tag HTML_HEADER: header file `%s' " "does not exist\n",headerFile.data()); exit(1); } } // Test to see if HTML footer is valid - QCString &footerFile = getString(__FILE__,__LINE__,"HTML_FOOTER"); + QCString &footerFile = Config_getString("HTML_FOOTER"); if (!footerFile.isEmpty()) { QFileInfo fi(footerFile); if (!fi.exists()) { - err("Error: tag HTML_FOOTER: footer file `%s' " + config_err("Error: tag HTML_FOOTER: footer file `%s' " "does not exist\n",footerFile.data()); exit(1); } } // Test to see if LaTeX header is valid - QCString &latexHeaderFile = getString(__FILE__,__LINE__,"LATEX_HEADER"); + QCString &latexHeaderFile = Config_getString("LATEX_HEADER"); if (!latexHeaderFile.isEmpty()) { QFileInfo fi(latexHeaderFile); if (!fi.exists()) { - err("Error: tag LATEX_HEADER: header file `%s' " + config_err("Error: tag LATEX_HEADER: header file `%s' " "does not exist\n",latexHeaderFile.data()); exit(1); } } // check include path - QStrList &includePath = getList(__FILE__,__LINE__,"INCLUDE_PATH"); + QStrList &includePath = Config_getList("INCLUDE_PATH"); char *s=includePath.first(); while (s) { QFileInfo fi(s); - if (!fi.exists()) err("Warning: tag INCLUDE_PATH: include path `%s' " + if (!fi.exists()) config_err("Warning: tag INCLUDE_PATH: include path `%s' " "does not exist\n",s); -#ifndef DOXYWIZARD - addSearchDir(fi.absFilePath()); -#endif s=includePath.next(); } // check aliases - QStrList &aliasList = getList(__FILE__,__LINE__,"ALIASES"); + QStrList &aliasList = Config_getList("ALIASES"); s=aliasList.first(); while (s) { @@ -962,13 +943,13 @@ void Config::check() alias=alias.stripWhiteSpace(); if (alias.find(re)!=0) { - err("Illegal alias format `%s'. Use \"name=value\"\n",alias.data()); + config_err("Illegal alias format `%s'. Use \"name=value\"\n",alias.data()); } s=aliasList.next(); } // check dot path - QCString &dotPath = getString(__FILE__,__LINE__,"DOT_PATH"); + QCString &dotPath = Config_getString("DOT_PATH"); if (!dotPath.isEmpty()) { if (dotPath.find('\\')!=-1) @@ -992,7 +973,7 @@ void Config::check() #endif if (!dp.exists() || !dp.isFile()) { - err("Warning: the dot tool could not be found at %s\n",dotPath.data()); + config_err("Warning: the dot tool could not be found at %s\n",dotPath.data()); dotPath=""; } else @@ -1010,10 +991,10 @@ void Config::check() } // check input - QStrList &inputSources=getList(__FILE__,__LINE__,"INPUT"); + QStrList &inputSources=Config_getList("INPUT"); if (inputSources.count()==0) { - err("Error: tag INPUT: no input files specified after the INPUT tag.\n"); + config_err("Error: tag INPUT: no input files specified after the INPUT tag.\n"); exit(1); } else @@ -1024,7 +1005,7 @@ void Config::check() QFileInfo fi(s); if (!fi.exists()) { - err("Error: tag INPUT: input source `%s' does not exist\n",s); + config_err("Error: tag INPUT: input source `%s' does not exist\n",s); exit(1); } s=inputSources.next(); @@ -1032,94 +1013,94 @@ void Config::check() } // add default pattern if needed - QStrList &filePatternList = getList(__FILE__,__LINE__,"FILE_PATTERNS"); + QStrList &filePatternList = Config_getList("FILE_PATTERNS"); if (filePatternList.isEmpty()) { filePatternList.append("*"); } // add default pattern if needed - QStrList &examplePatternList = getList(__FILE__,__LINE__,"EXAMPLE_PATTERNS"); + QStrList &examplePatternList = Config_getList("EXAMPLE_PATTERNS"); if (examplePatternList.isEmpty()) { examplePatternList.append("*"); } // add default pattern if needed - //QStrList &imagePatternList = getList(__FILE__,__LINE__,"IMAGE_PATTERNS"); + //QStrList &imagePatternList = Config_getList("IMAGE_PATTERNS"); //if (imagePatternList.isEmpty()) //{ // imagePatternList.append("*"); //} // more checks needed if and only if the search engine is enabled. - if (getBool(__FILE__,__LINE__,"SEARCHENGINE")) + if (Config_getBool("SEARCHENGINE")) { // check cgi name - QCString &cgiName = getString(__FILE__,__LINE__,"CGI_NAME"); + QCString &cgiName = Config_getString("CGI_NAME"); if (cgiName.isEmpty()) { - err("Error: tag CGI_NAME: no cgi script name after the CGI_NAME tag.\n"); + config_err("Error: tag CGI_NAME: no cgi script name after the CGI_NAME tag.\n"); exit(1); } // check cgi URL - QCString &cgiURL = getString(__FILE__,__LINE__,"CGI_URL"); + QCString &cgiURL = Config_getString("CGI_URL"); if (cgiURL.isEmpty()) { - err("Error: tag CGI_URL: no URL to cgi directory specified.\n"); + config_err("Error: tag CGI_URL: no URL to cgi directory specified.\n"); exit(1); } else if (cgiURL.left(7)!="http://" && cgiURL.left(8)!="https://" ) { - err("Error: tag CGI_URL: URL to cgi directory is invalid (must " + config_err("Error: tag CGI_URL: URL to cgi directory is invalid (must " "start with http:// or https://).\n"); exit(1); } // check documentation URL - QCString &docURL = getString(__FILE__,__LINE__,"DOC_URL"); + QCString &docURL = Config_getString("DOC_URL"); if (docURL.isEmpty()) { - docURL = getString(__FILE__,__LINE__,"OUTPUT_DIRECTORY").copy().prepend("file://").append("html"); + docURL = Config_getString("OUTPUT_DIRECTORY").copy().prepend("file://").append("html"); } else if (docURL.left(7)!="http://" && docURL.left(8)!="https://" && docURL.left(7)!="file://" ) { - err("Error: tag DOC_URL: URL to documentation is invalid or " + config_err("Error: tag DOC_URL: URL to documentation is invalid or " "not absolute.\n"); exit(1); } // check absolute documentation path - QCString &docAbsPath = getString(__FILE__,__LINE__,"DOC_ABSPATH"); + QCString &docAbsPath = Config_getString("DOC_ABSPATH"); if (docAbsPath.isEmpty()) { - docAbsPath = getString(__FILE__,__LINE__,"OUTPUT_DIRECTORY")+"/html"; + docAbsPath = Config_getString("OUTPUT_DIRECTORY")+"/html"; } else if (docAbsPath[0]!='/' && docAbsPath[1]!=':') { - err("Error: tag DOC_ABSPATH: path is not absolute!\n"); + config_err("Error: tag DOC_ABSPATH: path is not absolute!\n"); exit(1); } // check path to doxysearch - QCString &binAbsPath = getString(__FILE__,__LINE__,"BIN_ABSPATH"); + QCString &binAbsPath = Config_getString("BIN_ABSPATH"); if (binAbsPath.isEmpty()) { - err("Error: tag BIN_ABSPATH: no absolute path to doxysearch " + config_err("Error: tag BIN_ABSPATH: no absolute path to doxysearch " "specified.\n"); exit(1); } else if (binAbsPath[0]!='/' && binAbsPath[1]!=':') { - err("Error: tag BIN_ABSPATH: path is not absolute!\n"); + config_err("Error: tag BIN_ABSPATH: path is not absolute!\n"); exit(1); } // check perl path bool found=FALSE; - QCString &perlPath = getString(__FILE__,__LINE__,"PERL_PATH"); + QCString &perlPath = Config_getString("PERL_PATH"); if (perlPath.isEmpty()) { QFileInfo fi; @@ -1144,7 +1125,7 @@ void Config::check() QFileInfo fi(perlPath); if (!fi.exists()) { - warn_cont("Warning: tag PERL_PATH: perl interpreter not found at default or" + config_warn("Warning: tag PERL_PATH: perl interpreter not found at default or" "user specified (%s) location\n", perlPath.data()); } @@ -1152,12 +1133,12 @@ void Config::check() } #undef PUTENV -#if defined(_WIN32) && !defined(__GNUC__) +#if defined(_WIN32) && !defined(__GNUC__) && (__BORLANDC__ < 0x0550) #define PUTENV _putenv #else #define PUTENV putenv #endif - if (getBool(__FILE__,__LINE__,"HAVE_DOT")) PUTENV("DOTFONTPATH=."); + if (Config_getBool("HAVE_DOT")) PUTENV("DOTFONTPATH=."); } @@ -1241,6 +1222,7 @@ void Config::create() ce->addValue("Slovene"); ce->addValue("Spanish"); ce->addValue("Swedish"); + ce->addValue("Ukrainian"); cb = addBool( "EXTRACT_ALL", "If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in \n" @@ -1919,17 +1901,17 @@ void Config::create() ); cb->addDependency("GENERATE_MAN"); //----------------------------------------------------------------------------------------------- - //addInfo( "XML","configuration options related to the XML output"); + addInfo( "XML","configuration options related to the XML output"); //----------------------------------------------------------------------------------------------- - //addBool( "generateXML", - // "GENERATE_XML", - // "FALSE", - // "generate XML output", - // "If the GENERATE_XML tag is set to YES Doxygen will \n" - // "generate an XML file that captures the structure of \n" - // "the code including all documentation. Warning: This feature \n" - // "is still experimental and very incomplete.\n" - // ); + cb = addBool( + "GENERATE_XML", + "If the GENERATE_XML tag is set to YES Doxygen will \n" + "generate an XML file that captures the structure of \n" + "the code including all documentation. Note that this \n" + "feature is still experimental and incomplete at the \n" + "moment. \n", + FALSE + ); //----------------------------------------------------------------------------------------------- addInfo( "Preprocessor","Configuration options related to the preprocessor "); //----------------------------------------------------------------------------------------------- @@ -2184,10 +2166,29 @@ void Config::create() } -void Config::parse(const QCString &s,const char *fn) +bool Config::parse(const char *fn) { + QFileInfo fi( fn ); + if (!fi.exists()) + { + return FALSE; + } + QFile f( fn ); + if (!f.open(IO_ReadOnly)) + { + return FALSE; + } + // read file into a string buffer + int fsize = fi.size(); + QCString contents(fsize+1); // add room for \0 terminator + if (f.readBlock(contents.data(),fsize)!=fsize) + { + return FALSE; + } + contents[fsize]='\0'; + config = Config::instance(); - inputString = s; + inputString = contents.data(); inputPosition = 0; yyLineNr = 1; yyFileName=fn; @@ -2197,6 +2198,8 @@ void Config::parse(const QCString &s,const char *fn) configYYrestart( configYYin ); BEGIN( Start ); configYYlex(); + inputString = 0; + return TRUE; } //extern "C" { // some bogus code to keep the compiler happy diff --git a/src/declinfo.l b/src/declinfo.l index 18e39d8..5548b56 100644 --- a/src/declinfo.l +++ b/src/declinfo.l @@ -27,6 +27,7 @@ #include "declinfo.h" #include "util.h" +#include "message.h" #define YY_NO_UNPUT @@ -157,6 +158,8 @@ ID ([a-z_A-Z][a-z_A-Z0-9]*)|(@[0-9]+) sharpCount=0; BEGIN(Template); } +<Template>"<<" { name+="<<"; } +<Template>">>" { name+=">>"; } <Template>"<" { name+="<"; sharpCount++; @@ -235,16 +238,29 @@ void parseFuncDecl(const QCString &decl,QCString &cl,QCString &ctl,QCString &t, name=name.left(nb); } - cl=scope.copy(); - //printf("scope=`%s'\n",scope.data()); - int il=0,ir=0; - if ((il=cl.find('<'))!=-1 && (ir=cl.findRev('>'))!=-1) // split up scope and template arguments +#if 0 { - ctl=removeRedundantWhiteSpace(cl.mid(il,ir-il+1)); - cl=cl.left(il)+cl.right(cl.length()-ir-1); + int l=scope.length(); + int i=0; + int skipCount=0; + cl.resize(0); + ctl.resize(0); + for (i=0;i<l;i++) + { + char c=scope.at(i); + if (c=='<') + skipCount++; + else if (c=='>') + skipCount--; + else if (skipCount==0) + cl+=c; + } } - //printf("cl=`%s' ctl=`%s'\n",cl.data(),ctl.data()); +#endif + cl=stripTemplateSpecifiersFromScope(removeRedundantWhiteSpace(scope),FALSE); + ctl.resize(0); n=removeRedundantWhiteSpace(name); + int il,ir; if ((il=n.find('<'))!=-1 && (ir=n.findRev('>'))!=-1) // TODO: handle cases like where n="operator<< <T>" { @@ -285,9 +301,9 @@ void dumpDecl(const char *s) QCString name; QCString args; QCString funcTNames; - printf("-----------------------------------------\n"); + msg("-----------------------------------------\n"); parseFuncDecl(s,className,classTNames,type,name,args,funcTNames); - printf("type=`%s' class=`%s' classTempl=`%s' name=`%s' " + msg("type=`%s' class=`%s' classTempl=`%s' name=`%s' " "funcTemplateNames=`%s' args=`%s'\n", type.data(),className.data(),classTNames.data(), name.data(),funcTNames.data(),args.data() diff --git a/src/definition.h b/src/definition.h index e881e43..c4ab29a 100644 --- a/src/definition.h +++ b/src/definition.h @@ -120,7 +120,7 @@ class Definition int getDefLine() const { return m_defLine; } virtual Definition *findInnerCompound(const char *name); - virtual Definition *getOuterScope() { return m_outerScope; } + virtual Definition *getOuterScope() const { return m_outerScope; } virtual void addInnerCompound(Definition *d); virtual void setOuterScope(Definition *d) { m_outerScope = d; } diff --git a/src/doxygen.cpp b/src/doxygen.cpp index c7a64eb..01a22f2 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -54,7 +54,7 @@ #include "ftvhelp.h" #include "defargs.h" #include "rtfgen.h" -//#include "xml.h" +#include "xmlgen.h" #include "reflist.h" #include "page.h" #include "packagedef.h" @@ -394,8 +394,7 @@ static void addRefItem(int todoId,int testId,int bugId,const char *prefix, static void buildGroupList(Entry *root) { - if (root->section==Entry::GROUPDOC_SEC && !root->name.isEmpty() && - (Config_getBool("EXTRACT_ALL") || root->tagInfo)) + if (root->section==Entry::GROUPDOC_SEC && !root->name.isEmpty()) { //printf("Found group %s title=`%s'\n",root->name.data(),root->type.data()); @@ -675,7 +674,7 @@ static Definition *findScope(Entry *root,int level=0) static Definition *findScopeFromQualifiedName(Definition *startScope,const QCString &n) { - //printf("findScopeFromName(%s,%s)\n",startScope ? startScope->name().data() : 0, n.data()); + //printf("findScopeFromQualifiedName(%s,%s)\n",startScope ? startScope->name().data() : 0, n.data()); QCString name(n); if (startScope==0) startScope=Doxygen::globalScope; int i = name.find("::"); @@ -684,25 +683,58 @@ static Definition *findScopeFromQualifiedName(Definition *startScope,const QCStr return startScope; } - QCString scope; - while ((i = name.find("::"))!=-1) + QCString scope=stripTemplateSpecifiersFromScope(name,FALSE); + //printf("name=%s -> scope=%s\n",name.data(),scope.data()); + while ((i = scope.find("::"))!=-1) { - int ti = name.find('<'); - if (ti!=-1 && ti<i) i=ti; // strip template specifiers - QCString nestedNameSpecifier = name.left(i); + //int ti = name.find('<'); + //if (ti!=-1 && ti<i) i=ti; // strip template specifiers + QCString nestedNameSpecifier = scope.left(i); //Definition *oldScope = startScope; startScope = startScope->findInnerCompound(nestedNameSpecifier); + //printf("Trying %s result=%p\n",nestedNameSpecifier.data(),startScope); if (startScope==0) { //printf("name %s not found in scope %s\n",nestedNameSpecifier.data(),oldScope->name().data()); return 0; } - name = name.right(name.length()-i-2); + scope = scope.right(scope.length()-i-2); + //printf("scope=%s\n",scope.data()); } - //printf("findScopeFromName() result=%s\n",startScope ? startScope->name().data() : 0); + //printf("findScopeFromQualifiedName() result=%s\n",startScope ? startScope->name().data() : 0); return startScope; } +ArgumentList *getTemplateArgumentsFromName( + const QCString &name, + const QList<ArgumentList> *tArgLists) +{ + if (tArgLists==0) return 0; + + QListIterator<ArgumentList> ali(*tArgLists); + // for each scope fragment, check if it is a template and advance through + // the list if so. + int i,p=0; + while ((i=name.find("::",p))!=-1) + { + NamespaceDef *nd = Doxygen::namespaceDict[name.left(i)]; + if (nd==0) + { + ClassDef *cd = getClass(name.left(i)); + if (cd) + { + if (cd->templateArguments()) + { + ++ali; + } + } + } + p=i+2; + } + return ali.current(); +} + + //---------------------------------------------------------------------- // build a list of all classes mentioned in the documentation // and all classes that have a documentation block before their definition. @@ -725,7 +757,11 @@ static void buildClassList(Entry *root) } else { + Debug::print(Debug::Classes,0," Found class with raw name %s\n",fullName.data()); + fullName=stripAnonymousNamespaceScope(fullName); + fullName=stripTemplateSpecifiersFromScope(fullName); + Debug::print(Debug::Classes,0," Found class with name %s\n",fullName.data()); bool ambig; @@ -736,11 +772,11 @@ static void buildClassList(Entry *root) if ((cd=getClass(fullName))) { Debug::print(Debug::Classes,0," Existing class!\n",fullName.data()); - if (cd->templateArguments()==0) - { - //printf("existing ClassDef tempArgList=%p specScope=%s\n",root->tArgList,root->scopeSpec.data()); - cd->setTemplateArguments(root->tArgList); - } + //if (cd->templateArguments()==0) + //{ + // //printf("existing ClassDef tempArgList=%p specScope=%s\n",root->tArgList,root->scopeSpec.data()); + // cd->setTemplateArguments(tArgList); + //} if (!root->doc.isEmpty() || !root->brief.isEmpty() || (root->bodyLine!=-1 && Config_getBool("SOURCE_BROWSER")) ) @@ -818,7 +854,8 @@ static void buildClassList(Entry *root) case Entry::EXCEPTIONDOC_SEC: sec=ClassDef::Exception; break; } - Debug::print(Debug::Classes,0," New class `%s' (sec=0x%08x)!\n",fullName.data(),root->section); + Debug::print(Debug::Classes,0," New class `%s' (sec=0x%08x)! #tArgLists=%d\n", + fullName.data(),root->section,root->tArgLists ? (int)root->tArgLists->count() : -1); QCString className; QCString namespaceName; extractNamespaceName(fullName,className,namespaceName); @@ -837,7 +874,13 @@ static void buildClassList(Entry *root) cd->setDocumentation(root->doc); // copy docs to definition cd->setBriefDescription(root->brief); //printf("new ClassDef %s tempArgList=%p specScope=%s\n",fullName.data(),root->tArgList,root->scopeSpec.data()); - cd->setTemplateArguments(root->tArgList); + + + ArgumentList *tArgList = + getTemplateArgumentsFromName(fullName,root->tArgLists); + //printf("class %s template args=%s\n",fullName.data(), + // tArgList ? tempArgListToString(tArgList).data() : "<none>"); + cd->setTemplateArguments(tArgList); cd->setProtection(root->protection); cd->addSectionsToDefinition(root->anchors); @@ -1663,6 +1706,7 @@ void buildVarList(Entry *root) mtype=MemberDef::Variable; QCString classScope=stripAnonymousNamespaceScope(scope); + classScope=stripTemplateSpecifiersFromScope(classScope,FALSE); QCString annScopePrefix=scope.left(scope.length()-classScope.length()); scope=classScope; if (!scope.isEmpty() && !name.isEmpty() && (cd=getClass(scope))) @@ -1739,7 +1783,7 @@ static void buildMemberList(Entry *root) { Debug::print(Debug::Functions,0, "FUNCTION_SEC:\n" - " `%s' `%s'::`%s' `%s' relates=`%s' file=`%s' line=`%d' bodyLine=`%d' #targs=%d #mtargs=%d mGrpId=%d memSpec=%d\n", + " `%s' `%s'::`%s' `%s' relates=`%s' file=`%s' line=`%d' bodyLine=`%d' #tArgLists=%d mGrpId=%d memSpec=%d\n", root->type.data(), root->parent->name.data(), root->name.data(), @@ -1748,8 +1792,9 @@ static void buildMemberList(Entry *root) root->fileName.data(), root->startLine, root->bodyLine, - root->tArgList ? (int)root->tArgList->count() : -1, - root->mtArgList ? (int)root->mtArgList->count() : -1, + root->tArgLists ? (int)root->tArgLists->count() : -1, + //root->tArgList ? (int)root->tArgList->count() : -1, + //root->mtArgList ? (int)root->mtArgList->count() : -1, root->mGrpId, root->memSpec ); @@ -1767,6 +1812,7 @@ static void buildMemberList(Entry *root) // root->parent->name.data(),getClass(root->parent->name), // root->type.find(re,0)); QCString scope=stripAnonymousNamespaceScope(root->parent->name.copy()); + scope=stripTemplateSpecifiersFromScope(scope,FALSE); bool isMember=FALSE; int memIndex=rname.find("::"); @@ -1828,11 +1874,12 @@ static void buildMemberList(Entry *root) //printf("new member: %s member template args=`%s'\n", // root->args.data(), // argListToString(root->mtArgList).data()); + MemberDef *md=new MemberDef( root->fileName,root->startLine, root->type,name,root->args,root->exception, root->protection,root->virt,root->stat,!root->relates.isEmpty(), - mtype,root->mtArgList,root->argList); + mtype,root->tArgLists ? root->tArgLists->last() : 0,root->argList); if (root->tagInfo) { md->setAnchor(root->tagInfo->anchor); @@ -1876,26 +1923,27 @@ static void buildMemberList(Entry *root) } else { + QCString qualScope = cd->qualifiedNameWithTemplateParameters(); if (!root->type.isEmpty()) { if (root->argList) { - def=root->type+" "+scope+"::"+name; + def=root->type+" "+qualScope+"::"+name; } else { - def=root->type+" "+scope+"::"+name+root->args; + def=root->type+" "+qualScope+"::"+name+root->args; } } else { if (root->argList) { - def=scope+"::"+name; + def=qualScope+"::"+name; } else { - def=scope+"::"+name+root->args; + def=qualScope+"::"+name+root->args; } } } @@ -1907,7 +1955,7 @@ static void buildMemberList(Entry *root) " `%s' `%s'::`%s' `%s' proto=%d\n" " def=`%s'\n", root->type.data(), - root->parent->name.data(), + scope.data(), rname.data(), root->args.data(), root->proto, @@ -2023,12 +2071,13 @@ static void buildMemberList(Entry *root) // root->type.data(),rname.data(),root->args.data(),root->bodyLine); // new global function + ArgumentList *tArgList = root->tArgLists ? root->tArgLists->last() : 0; QCString name=removeRedundantWhiteSpace(rname); MemberDef *md=new MemberDef( root->fileName,root->startLine, root->type,name,root->args,root->exception, root->protection,root->virt,root->stat,FALSE, - MemberDef::Function,root->tArgList,root->argList); + MemberDef::Function,tArgList,root->argList); if (root->tagInfo) { md->setAnchor(root->tagInfo->anchor); @@ -2686,7 +2735,8 @@ static bool findClassRelation( //printf("scopePrefix=`%s' bi->name=`%s'\n", // scopeName.left(scopeOffset).data(),bi->name.data()); - QCString baseClassName=removeRedundantWhiteSpace(bi->name); + QCString baseClassName=stripTemplateSpecifiersFromScope + (removeRedundantWhiteSpace(bi->name)); if (scopeOffset>0) { baseClassName.prepend(scopeName.left(scopeOffset)+"::"); @@ -3002,6 +3052,7 @@ static void findInheritedTemplateInstances() ClassDef *cd; // strip any annonymous scopes first QCString bName=stripAnonymousNamespaceScope(root->name); + bName=stripTemplateSpecifiersFromScope(bName); Debug::print(Debug::Classes,0," Class %s : \n",bName.data()); if ((cd=getClass(bName))) { @@ -3022,6 +3073,7 @@ static void findUsedTemplateInstances() ClassDef *cd; // strip any annonymous scopes first QCString bName=stripAnonymousNamespaceScope(root->name); + bName=stripTemplateSpecifiersFromScope(bName); Debug::print(Debug::Classes,0," Class %s : \n",bName.data()); if ((cd=getClass(bName))) { @@ -3041,6 +3093,7 @@ static void computeClassRelations() ClassDef *cd; // strip any annonymous scopes first QCString bName=stripAnonymousNamespaceScope(root->name); + bName=stripTemplateSpecifiersFromScope(bName); Debug::print(Debug::Classes,0," Class %s : \n",bName.data()); if ((cd=getClass(bName))) { @@ -3065,6 +3118,7 @@ static void computeTemplateClassRelations() for (;(root=edi.current());++edi) { QCString bName=stripAnonymousNamespaceScope(root->name); + bName=stripTemplateSpecifiersFromScope(bName); ClassDef *cd=getClass(bName); // strip any annonymous scopes first QDict<ClassDef> *templInstances = 0; @@ -3607,92 +3661,74 @@ static bool findGlobalMember(Entry *root, return TRUE; } -static void substituteTemplateArgNames(ArgumentList *src, - const QCString &s, - ArgumentList *tempArgs, +static void substituteTemplatesInArgList( + const QList<ArgumentList> &srcTempArgLists, + const QList<ArgumentList> &dstTempArgLists, + ArgumentList *src, ArgumentList *dst) { - ArgumentListIterator ali(*src); - Argument *a=0; - for (ali.toFirst();(a=ali.current());++ali) // for each member argument + ArgumentListIterator sali(*src); + Argument *sa=0; + Argument *da=dst->first(); + + for (sali.toFirst();(sa=sali.current());++sali) // for each member argument { - QCString type=a->type.copy(); - bool isReplaced=FALSE; + QCString srcType = sa->type; QRegExp re(idMask); - int i,p=0,l,c=0; - while (!s.isEmpty() && (i=re.match(s,p,&l))!=-1) // for each template name found at the - // member definition + //printf("type=%s\n",sa->type.data()); + + int i,p=0,l; + QCString dstType; + while ((i=re.match(srcType,p,&l))!=-1) // for each word in srcType { - Argument *ta = c<(int)tempArgs->count() ? tempArgs->at(c) : 0; - if (ta) // get matching template argument of the class + bool found=FALSE; + dstType+=srcType.mid(p,i-p); + QCString name=srcType.mid(i,l); + + QListIterator<ArgumentList> srclali(srcTempArgLists); + QListIterator<ArgumentList> dstlali(dstTempArgLists); + for (;srclali.current() && !found;++srclali,++dstlali) { - QCString dstName=s.mid(i,l); - QCString srcName=ta->name.copy(); - if (srcName.isEmpty()) srcName=ta->type.copy(); - //printf("1.Template Name = `%s' -> `%s'\n",srcName.data(),dstName.data()); - int bi; - if ((bi=srcName.findRev(' '))!=-1) // search for separator - { - // strip the type specifier (usually class or typename) - srcName=srcName.right(srcName.length()-bi-1); - } + ArgumentListIterator tsali(*srclali.current()); + ArgumentListIterator tdali(*dstlali.current()); + Argument *tsa =0,*tda=0; - //if (srcName.left(6)=="class ") srcName=srcName.right(srcName.length()-6); - //if (srcName.left(9)=="typename ") srcName=srcName.right(srcName.length()-9); - //printf("2.Template Name = `%s' -> `%s'\n",srcName.data(),dstName.data()); - if (srcName!=dstName) /* we need to substitute */ + for (tsali.toFirst();(tsa=tsali.current()) && !found;++tsali) { - int ti,tp=0; - QCString result; - int sl=srcName.length(); - while ((ti=type.find(srcName,tp))!=-1) + tda = tdali.current(); + if (tda && name==tsa->name) { - 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; + name=tda->name; // substitute + found=TRUE; } - result+=type.right(type.length()-tp); - type=result; - isReplaced = TRUE; + if (tda) ++tdali; } } + dstType+=name; p=i+l; - c++; } - Argument *na = new Argument(*a); - if (isReplaced) + dstType+=srcType.right(srcType.length()-p); + if (da==0) { - //printf("Template Arg: `%s' -> `%s'\n",na->type.data(),type.data()); - na->type=type; + da=new Argument(*sa); + dst->append(da); + da->type=dstType; + da=0; } else { - //printf("Template Arg `%s' not changed\n",a->type.data()); + da->type=dstType; + da=dst->next(); } - dst->append(na); } - //printf("substituteTemplateArgNames(\nsrc=`%s',\ntempNameStr=`%s',\ntempArgs=`%s',\ndest=`%s'\n)\n", - // argListToString(src).data(), - // s.data(), - // argListToString(tempArgs).data(), - // argListToString(dst).data() - // ); dst->constSpecifier = src->constSpecifier; dst->volatileSpecifier = src->volatileSpecifier; dst->pureSpecifier = src->pureSpecifier; - + //printf("substituteTemplatesInArgList: replacing %s with %s\n", + // argListToString(src).data(),argListToString(dst).data()); } + static QCString mergeScopes(const QCString &leftScope,const QCString &rightScope) { // case leftScope=="A" rightScope=="A::B" => result = "A::B" @@ -3744,11 +3780,10 @@ static void findMember(Entry *root, { Debug::print(Debug::FindMembers,0, "findMember(root=%p,funcDecl=`%s',related=`%s',overload=%d," - "isFunc=%d mGrpId=%d tArgList=%p=\"%s\" mtArgList=%p=\"%s\" " + "isFunc=%d mGrpId=%d tArgList=%p (#=%d) " "scopeSpec=%s memberSpec=%s memSpec=%d\n", root,funcDecl.data(),related.data(),overloaded,isFunc,root->mGrpId, - root->tArgList,tempArgListToString(root->tArgList).data(), - root->mtArgList,tempArgListToString(root->mtArgList).data(), + root->tArgLists,root->tArgLists ? root->tArgLists->count() : 0, root->scopeSpec.data(),root->memberSpec.data(),root->memSpec ); //if (Config::instance()->get("") && !root->body.isEmpty()) @@ -3829,18 +3864,6 @@ static void findMember(Entry *root, //printf("scopeName=`%s' funcType=`%s' funcName=`%s'\n", // scopeName.data(),funcType.data(),funcName.data()); - //bool isSpecialization = !root->scopeSpec.isEmpty() && - // root->scopeSpec != tempArgListToString(root->tArgList); - - // if this is a member template inside non template class, the parser puts - // template specifier in scopeSepc, so we copy it to the right location here - if (scopeName.isEmpty() && !root->scopeSpec.isEmpty() && - root->memberSpec.isEmpty() && funcTempList.isEmpty() - ) // template specifier that was found is for a function - { - funcTempList = root->scopeSpec; - } - // the class name can also be a namespace name, we decide this later. // if a related class name is specified and the class name could // not be derived from the function declaration, then use the @@ -3862,6 +3885,7 @@ static void findMember(Entry *root, !root->parent->name.isEmpty()) { scopeName = mergeScopes(root->parent->name,scopeName); + scopeName = stripTemplateSpecifiersFromScope(scopeName); } // split scope into a namespace and a class part @@ -3869,61 +3893,6 @@ static void findMember(Entry *root, //printf("scopeName=`%s' className=`%s' namespaceName=`%s'\n", // scopeName.data(),className.data(),namespaceName.data()); -#if 0 - if (related.isEmpty() && - root->parent && - !root->parent->name.isEmpty() - ) // prefix scope in which the member was found - { - Entry *p=root->parent; - while (p) // get full scope as class name - { - QCString sc = stripAnonymousNamespaceScope(p->name); - if ((p->section & Entry::SCOPE_MASK) - && !sc.isEmpty() && sc[0]!='@' - ) - { - QCString cn; - QCString nn; - extractNamespaceName(sc,cn,nn); - if (leftScopeMatch(nn,namespaceName) || namespaceName.isEmpty()) - { - namespaceName=nn.copy(); - } - if (leftScopeMatch(cn,className) || className.isEmpty()) - { - className=cn.copy(); - } - - //printf("sc=`%s' cn=`%s' nn=`%s'\n",sc.data(),cn.data(),nn.data()); - - //printf("p->name=`%s' scopeName=`%s' classTempList=%s\n", - // p->name.data(),scopeName.data(),classTempList.data()); - - QCString tryClass; - - if (className.find('<')==-1 && !classTempList.isEmpty()) - tryClass=insertTemplateSpecifierInScope(className,classTempList); - else - tryClass=className.copy(); - - //printf("tryClass=%s\n",tryClass.data()); - - if (leftScopeMatch(tryClass,cn)) - break; // scope already present, so stop now - - // prepend name to scope - if (!scopeName.isEmpty()) scopeName.prepend("::"); - scopeName.prepend(sc); - break; - } - p=p->parent; - } - //printf("3. scopeName=`%s'\n",scopeName.data()); - //printf("result: scope=%s\n",scopeName.data()); - } -#endif - namespaceName=removeAnonymousScopes(namespaceName); //printf("namespaceName=`%s' className=`%s'\n",namespaceName.data(),className.data()); // merge class and namespace scopes again @@ -3945,54 +3914,15 @@ static void findMember(Entry *root, } //printf("new scope=`%s'\n",scopeName.data()); - if (!scopeName.isEmpty() && - scopeName.find('<')==-1 && - classTempList.isEmpty() - ) - { - ClassDef *cd=getClass(scopeName); - // class is a template, but no template name list found - if (root->tArgList && cd && cd->templateArguments()) - { - classTempList = tempArgListToString(root->tArgList); - } - } - - QCString tempScopeName=scopeName.copy(); - int ti=tempScopeName.find('<'); - if (ti==-1) + ClassDef *cd=getClass(scopeName); + if (cd) { - 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 && root->mtArgList==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. - //printf("Building template list from `%s'\n",classTempList.data()); - 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; - } + if (root->tArgLists) root->tArgLists->first(); + tempScopeName=cd->qualifiedNameWithTemplateParameters(root->tArgLists); } + //printf("scopeName=%s cd=%p root->tArgLists=%p result=%s\n", + // scopeName.data(),cd,root->tArgLists,tempScopeName.data()); //printf("scopeName=`%s' className=`%s'\n",scopeName.data(),className.data()); // rebuild the function declaration (needed to get the scope right). @@ -4100,58 +4030,69 @@ static void findMember(Entry *root, { ClassDef *cd=md->getClassDef(); Debug::print(Debug::FindMembers,0, - "3. member definition found scope needed=`%s' scope=`%s' args=`%s'\n", + "3. member definition found, " + "scope needed=`%s' scope=`%s' args=`%s'\n", scopeName.data(),cd ? cd->name().data() : "<none>", md->argsString()); //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; - bool ambig; FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); NamespaceDef *nd=0; if (!namespaceName.isEmpty()) nd=getResolvedNamespace(namespaceName); - tcd = findClassDefinition(fd,nd,scopeName,classTempList); + + ClassDef *tcd=findClassDefinition(fd,nd,scopeName,classTempList); if (cd && tcd==cd) // member's classes match { Debug::print(Debug::FindMembers,0, "4. class definition %s found\n",cd->name().data()); - int ci; - ArgumentList *classTemplArgs = cd->templateArguments(); - ArgumentList *funcTemplArgs = md->memberDefTemplateArguments(); - if ((ci=cd->name().find("::"))!=-1) // nested class + //int ci; + //ArgumentList *classTemplArgs = cd->templateArguments(); + //ArgumentList *funcTemplArgs = md->memberDefTemplateArguments(); + //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()); + + + // get the template parameter lists found at the member declaration + QList<ArgumentList> declTemplArgs; + cd->getTemplateParameterLists(declTemplArgs); + if (md->templateArguments()) { - ClassDef *parentClass = getClass(cd->name().left(ci)); - if (parentClass) - classTemplArgs = parentClass->templateArguments(); + declTemplArgs.append(md->templateArguments()); } - //printf("cd->name=%s classTemplArgs=%s\n",cd->name().data(), - // argListToString(classTemplArgs).data()); - ArgumentList *argList = 0; + // get the template parameter lists found at the member definition + QList<ArgumentList> *defTemplArgs = root->tArgLists; + //printf("defTemplArgs=%p\n",defTemplArgs); + + // do we replace the decl argument lists with the def argument lists? bool substDone=FALSE; + ArgumentList *argList=0; /* substitute the occurrences of class template names in the * argument list before matching */ - if (!classTempList.isEmpty() && - classTemplArgs && + if (declTemplArgs.count()>0 && defTemplArgs && + declTemplArgs.count()==defTemplArgs->count() && 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 + * and the class definition also has template arguments, so + * we must substitute the template names of the class by that + * of the function definition before matching. */ argList = new ArgumentList; argList->setAutoDelete(TRUE); - substituteTemplateArgNames( - md->argumentList(), /* source argument list */ - classTempList, /* template names source */ - classTemplArgs, /* template names dest */ - argList /* dest argument list */ - ); + substituteTemplatesInArgList(declTemplArgs,*defTemplArgs, + md->argumentList(),argList); + substDone=TRUE; } else /* no template arguments, compare argument lists directly */ @@ -4159,29 +4100,6 @@ static void findMember(Entry *root, argList = md->argumentList(); } - /* substitute the occurrences of member template names in the - * argument list before matching - */ - if (!funcTempList.isEmpty() && - funcTemplArgs && - md->argumentList() - ) - { - ArgumentList *oldArgList = argList; - argList = new ArgumentList; - substituteTemplateArgNames( - oldArgList, /* source argument list */ - funcTempList, /* template names source */ - funcTemplArgs, /* template names dest */ - argList /* dest argument list */ - ); - if (substDone) // delete old argument list - { - delete oldArgList; - } - substDone=TRUE; - } - Debug::print(Debug::FindMembers,0, "5. matching `%s'<=>`%s' className=%s namespaceName=%s\n", argListToString(argList).data(),argListToString(root->argList).data(), @@ -4221,8 +4139,9 @@ static void findMember(Entry *root, //printf("Setting member template argument of member %s to %s\n", // md->name().data(), argListToString(root->mtArgList).data() // ); - md->setScopeDefTemplateArguments(root->tArgList); - md->setMemberDefTemplateArguments(root->mtArgList); + + md->setDefinitionTemplateParameterLists(root->tArgLists); + //md->setMemberDefTemplateArguments(root->mtArgList); md->setArgumentList(argList); } else // no match -> delete argument list @@ -4296,11 +4215,13 @@ static void findMember(Entry *root, else mtype=MemberDef::Function; // new overloaded member function + ArgumentList *tArgList = + getTemplateArgumentsFromName(cd->name()+"::"+funcName,root->tArgLists); MemberDef *md=new MemberDef( root->fileName,root->startLine, funcType,funcName,funcArgs,exceptions, root->protection,root->virt,root->stat,TRUE, - mtype,root->tArgList,root->argList); + mtype,tArgList,root->argList); if (root->tagInfo) { md->setAnchor(root->tagInfo->anchor); @@ -4362,7 +4283,7 @@ static void findMember(Entry *root, if (!newMember && rmd) // member already exists as rmd -> add docs { //printf("addMemberDocs for related member %s\n",root->name.data()); - rmd->setMemberDefTemplateArguments(root->mtArgList); + //rmd->setMemberDefTemplateArguments(root->mtArgList); addMemberDocs(root,rmd,funcDecl,0,overloaded); } } @@ -4380,11 +4301,13 @@ static void findMember(Entry *root, mtype=MemberDef::Function; // new related (member) function + ArgumentList *tArgList = + getTemplateArgumentsFromName(scopeName+"::"+funcName,root->tArgLists); MemberDef *md=new MemberDef( root->fileName,root->startLine, funcType,funcName,funcArgs,exceptions, root->protection,root->virt,root->stat,TRUE, - mtype,root->tArgList,root->argList); + mtype,tArgList,root->argList); if (root->tagInfo) { md->setAnchor(root->tagInfo->anchor); @@ -4443,7 +4366,7 @@ static void findMember(Entry *root, md->setBriefDescription(root->brief); md->addSectionsToDefinition(root->anchors); md->setMemberGroupId(root->mGrpId); - md->setMemberDefTemplateArguments(root->mtArgList); + //md->setMemberDefTemplateArguments(root->mtArgList); mn->append(md); cd->insertMember(md); cd->insertUsedFile(root->fileName); @@ -5229,8 +5152,12 @@ static void generateClassDocs() for ( ; cli.current() ; ++cli ) { ClassDef *cd=cli.current(); - if ( cd->isLinkableInProject() && cd->templateMaster()==0 ) - // skip external references, anonymous compounds and template instances + if ( cd->isLinkableInProject() && cd->templateMaster()==0 && + (cd->getOuterScope()==0 || + cd->getOuterScope()->definitionType()!=Definition::TypeClass + ) + ) // skip external references, anonymous compounds and + // template instances and nested classes { msg("Generating docs for compound %s...\n",cd->name().data()); @@ -6573,9 +6500,11 @@ void readConfiguration(int argc, char **argv) { if (optind+4<argc) { - QCString configFile=fileToString(argv[optind+4]); - if (configFile.isEmpty()) exit(1); - Config::instance()->parse(fileToString(argv[optind+4]),argv[optind+4]); + if (!Config::instance()->parse(argv[optind+4])) + { + err("Error opening or reading configuration file %s!\n",argv[optind+4]); + exit(1); + } Config::instance()->substituteEnvironmentVars(); Config::instance()->convertStrToVal(); Config::instance()->check(); @@ -6611,9 +6540,11 @@ void readConfiguration(int argc, char **argv) { if (optind+3<argc) // use config file to get settings { - QCString configFile=fileToString(argv[optind+3]); - if (configFile.isEmpty()) exit(1); - Config::instance()->parse(fileToString(argv[optind+3]),argv[optind+3]); + if (!Config::instance()->parse(argv[optind+3])) + { + err("Error opening or reading configuration file %s!\n",argv[optind+3]); + exit(1); + } Config::instance()->substituteEnvironmentVars(); Config::instance()->convertStrToVal(); Config::instance()->check(); @@ -6679,17 +6610,14 @@ void readConfiguration(int argc, char **argv) } QFileInfo configFileInfo1("Doxyfile"),configFileInfo2("doxyfile"); - QCString config; if (optind>=argc) { if (configFileInfo1.exists()) { - config=fileToString("Doxyfile"); configName="Doxyfile"; } else if (configFileInfo2.exists()) { - config=fileToString("doxyfile"); configName="doxyfile"; } else @@ -6703,7 +6631,6 @@ void readConfiguration(int argc, char **argv) QFileInfo fi(argv[optind]); if (fi.exists() || strcmp(argv[optind],"-")==0) { - config=fileToString(argv[optind]); configName=argv[optind]; } else @@ -6713,7 +6640,11 @@ void readConfiguration(int argc, char **argv) } } - Config::instance()->parse(config,configName); + if (!Config::instance()->parse(configName)) + { + err("Error: could not open or read configuration file %s!\n",configName); + exit(1); + } if (updateConfig) { @@ -6724,6 +6655,22 @@ void readConfiguration(int argc, char **argv) Config::instance()->substituteEnvironmentVars(); Config::instance()->convertStrToVal(); Config::instance()->check(); + initWarningFormat(); + QCString outputLanguage=Config_getEnum("OUTPUT_LANGUAGE"); + if (!outputLanguage.isEmpty() && !setTranslator(outputLanguage)) + { + err("Error: Output language %s not supported! Using English instead.\n", + outputLanguage.data()); + } + QStrList &includePath = Config_getList("INCLUDE_PATH"); + char *s=includePath.first(); + while (s) + { + QFileInfo fi(s); + addSearchDir(fi.absFilePath()); + s=includePath.next(); + } + } void parseInput() @@ -7075,7 +7022,7 @@ void parseInput() msg("Searching for documented defines...\n"); findDefineDocumentation(root); - msg("Computing template instances..."); + msg("Computing template instances...\n"); findClassEntries(root); findInheritedTemplateInstances(); findUsedTemplateInstances(); @@ -7089,7 +7036,7 @@ void parseInput() // computeClassImplUsageRelations(); //} - msg("Computing class relations..."); + msg("Computing class relations...\n"); computeTemplateClassRelations(); computeClassRelations(); classEntries.clear(); @@ -7342,5 +7289,10 @@ void generateOutput() if (Config_getBool("GENERATE_HTML") && Config_getBool("DOT_CLEANUP")) removeDoxFont(Config_getString("HTML_OUTPUT")); if (Config_getBool("GENERATE_RTF") && Config_getBool("DOT_CLEANUP")) removeDoxFont(Config_getString("RTF_OUTPUT")); + if (Config_getBool("GENERATE_XML")) + { + msg("Generating XML output...\n"); + generateXML(); + } } diff --git a/src/doxygen.pro.in b/src/doxygen.pro.in index 3183de8..30e8ace 100644 --- a/src/doxygen.pro.in +++ b/src/doxygen.pro.in @@ -24,7 +24,7 @@ win32-mingw:LIBS += -L../lib -ldoxygen -ldoxycfg -lqtools win32-msvc:LIBS += qtools.lib doxygen.lib doxycfg.lib shell32.lib win32-msvc:TMAKE_LFLAGS += /LIBPATH:..\lib win32-borland:LIBS += qtools.lib doxygen.lib doxycfg.lib shell32.lib -win32-borland:TMAKE_LFLAGS += -L..\lib +win32-borland:TMAKE_LFLAGS += -L..\lib -L$(BCB)\lib\psdk win32:TMAKE_CXXFLAGS += -DQT_NODLL INCLUDEPATH += ../qtools . DESTDIR = ../bin diff --git a/src/doxytag.pro.in b/src/doxytag.pro.in index 0eab64b..090ec81 100644 --- a/src/doxytag.pro.in +++ b/src/doxytag.pro.in @@ -25,7 +25,7 @@ win32-mingw:LIBS += -L../lib -lqtools win32-msvc:LIBS += qtools.lib shell32.lib win32-msvc:TMAKE_LFLAGS += /LIBPATH:..\lib win32-borland:LIBS += qtools.lib shell32.lib -win32-borland:TMAKE_LFLAGS += -L..\lib +win32-borland:TMAKE_LFLAGS += -L..\lib -L$(BCB)\lib\psdk win32:TMAKE_CXXFLAGS += -DQT_NODLL INCLUDEPATH += ../qtools OBJECTS_DIR = ../objects diff --git a/src/entry.cpp b/src/entry.cpp index bbea6ef..44081c2 100644 --- a/src/entry.cpp +++ b/src/entry.cpp @@ -16,6 +16,7 @@ */ #include "entry.h" +#include "util.h" int Entry::num=0; @@ -36,8 +37,8 @@ Entry::Entry() argList = new ArgumentList; argList->setAutoDelete(TRUE); //printf("Entry::Entry() tArgList=0\n"); - tArgList = 0; - mtArgList = 0; + tArgLists = 0; + //mtArgList = 0; mGrpId = -1; tagInfo = 0; groupdoctype = GROUPDOC_NORMAL; @@ -90,8 +91,8 @@ Entry::Entry(const Entry &e) argList = new ArgumentList; argList->setAutoDelete(TRUE); //printf("Entry::Entry(copy) tArgList=0\n"); - tArgList = 0; - mtArgList = 0; + tArgLists = 0; + //mtArgList = 0; groupdoctype = e.groupdoctype; // deep copy of the child entry list @@ -136,33 +137,25 @@ Entry::Entry(const Entry &e) argList->volatileSpecifier = e.argList->volatileSpecifier; argList->pureSpecifier = e.argList->pureSpecifier; - // deep copy template argument list - if (e.tArgList) + // deep copy template argument lists + if (e.tArgLists) { - tArgList = new ArgumentList; - tArgList->setAutoDelete(TRUE); - //printf("Entry::Entry(copy) new tArgList=%p\n",tArgList); - QListIterator<Argument> tali(*e.tArgList); - for (;(a=tali.current());++tali) - { - tArgList->append(new Argument(*a)); - //printf("appending argument %s %s\n",a->type.data(),a->name.data()); - } + tArgLists = copyArgumentLists(e.tArgLists); } // deep copy template argument list - if (e.mtArgList) - { - mtArgList = new ArgumentList; - mtArgList->setAutoDelete(TRUE); - //printf("Entry::Entry(copy) new tArgList=%p\n",tArgList); - QListIterator<Argument> mtali(*e.mtArgList); - for (;(a=mtali.current());++mtali) - { - mtArgList->append(new Argument(*a)); - //printf("appending argument %s %s\n",a->type.data(),a->name.data()); - } - } + //if (e.mtArgList) + //{ + // mtArgList = new ArgumentList; + // mtArgList->setAutoDelete(TRUE); + // //printf("Entry::Entry(copy) new tArgList=%p\n",tArgList); + // QListIterator<Argument> mtali(*e.mtArgList); + // for (;(a=mtali.current());++mtali) + // { + // mtArgList->append(new Argument(*a)); + // //printf("appending argument %s %s\n",a->type.data(),a->name.data()); + // } + //} } @@ -175,8 +168,8 @@ Entry::~Entry() delete groups; delete anchors; delete argList; - delete tArgList; - delete mtArgList; + delete tArgLists; + //delete mtArgList; delete tagInfo; num--; } @@ -244,8 +237,8 @@ void Entry::reset() anchors->clear(); argList->clear(); if (tagInfo) { delete tagInfo; tagInfo=0; } - if (tArgList) { delete tArgList; tArgList=0; } - if (mtArgList) { delete mtArgList; mtArgList=0; } + if (tArgLists) { delete tArgLists; tArgLists=0; } + //if (mtArgList) { delete mtArgList; mtArgList=0; } } @@ -296,7 +289,7 @@ int Entry::getSize() e=sublist->next(); } Argument *a=argList->first(); - while (e) + while (a) { size+=sizeof(Argument); size+=a->type.length()+1 @@ -304,30 +297,36 @@ int Entry::getSize() +a->defval.length()+1; a=argList->next(); } - if (tArgList) - { - a=tArgList->first(); - while (e) - { - size+=sizeof(Argument); - size+=a->type.length()+1 - +a->name.length()+1 - +a->defval.length()+1; - a=tArgList->next(); - } - } - if (mtArgList) + if (tArgLists) { - a=mtArgList->first(); - while (e) + ArgumentList *al=tArgLists->first(); + while (al) { - size+=sizeof(Argument); - size+=a->type.length()+1 - +a->name.length()+1 - +a->defval.length()+1; - a=mtArgList->next(); + size+=sizeof(ArgumentList); + a=al->first(); + while (a) + { + size+=sizeof(Argument); + size+=a->type.length()+1 + +a->name.length()+1 + +a->defval.length()+1; + a=al->next(); + } + al=tArgLists->next(); } } + //if (mtArgList) + //{ + // a=mtArgList->first(); + // while (e) + // { + // size+=sizeof(Argument); + // size+=a->type.length()+1 + // +a->name.length()+1 + // +a->defval.length()+1; + // a=mtArgList->next(); + // } + //} return size; } diff --git a/src/entry.h b/src/entry.h index 7717eb9..476fea5 100644 --- a/src/entry.h +++ b/src/entry.h @@ -252,8 +252,9 @@ class Entry QCString args; //!< member argument string QCString bitfields; //!< member's bit fields ArgumentList *argList; //!< member arguments as a list - ArgumentList *tArgList; //!< template argument list - ArgumentList *mtArgList; //!< member template argument list + QList<ArgumentList> *tArgLists; //!< template argument declarations + //ArgumentList *tArgList; //!< template argument lists (for each scope) + //ArgumentList *mtArgList; //!< member template argument list QCString scopeSpec; //!< template specialization of the scope QCString memberSpec; //!< template specialization of the member QCString program; //!< the program text diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index 57ce664..117b8ac 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -44,6 +44,7 @@ static const char *defaultStyleSheet = "A.elRef { font-weight: bold }\n" "A.code { text-decoration: none; font-weight: normal; color: #4444ee }\n" "A.codeRef { font-weight: normal; color: #4444ee }\n" + "A:hover { text-decoration: none; background-color: #f2f2ff }\n" "DL.el { margin-left: -1cm }\n" "DIV.fragment { width: 100%; border: none; background-color: #eeeeee }\n" "DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }\n" diff --git a/src/index.cpp b/src/index.cpp index 97957fe..624e190 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -2703,6 +2703,8 @@ void writeIndex(OutputList &ol) ol.startIndexSection(isTitlePageAuthor); parseText(ol,theTranslator->trGeneratedBy()); ol.endIndexSection(isTitlePageAuthor); + ol.enable(OutputGenerator::Latex); + if (Doxygen::mainPage) { ol.startIndexSection(isMainPage); @@ -2716,7 +2718,6 @@ void writeIndex(OutputList &ol) } ol.endIndexSection(isMainPage); } - ol.enable(OutputGenerator::Latex); if (documentedPackages>0) diff --git a/src/language.cpp b/src/language.cpp index 87e4c13..4f804f2 100644 --- a/src/language.cpp +++ b/src/language.cpp @@ -43,6 +43,7 @@ #include "translator_br.h" #include "translator_dk.h" #include "translator_sk.h" +#include "translator_ua.h" #endif #define L_EQUAL(a) !stricmp(langName,a) @@ -144,6 +145,10 @@ bool setTranslator(const char *langName) { theTranslator=new TranslatorSlovak; } + else if (L_EQUAL("ukrainian")) + { + theTranslator=new TranslatorUkrainian; + } #endif else // use the default language (i.e. english) { diff --git a/src/latexgen.cpp b/src/latexgen.cpp index e21e7d8..3031384 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -1235,10 +1235,11 @@ void LatexGenerator::writeSectionRefItem(const char *,const char *lab, //void LatexGenerator::docifyStatic(QTextStream &t,const char *str) void LatexGenerator::docify(const char *str) { - static bool isCzech = theTranslator->idLanguage()=="czech"; - static bool isJapanese = theTranslator->idLanguage()=="japanese"; - static bool isKorean = theTranslator->idLanguage()=="korean"; - static bool isRussian = theTranslator->idLanguage()=="russian"; + static bool isCzech = theTranslator->idLanguage()=="czech"; + static bool isJapanese = theTranslator->idLanguage()=="japanese"; + static bool isKorean = theTranslator->idLanguage()=="korean"; + static bool isRussian = theTranslator->idLanguage()=="russian"; + static bool isUkrainian = theTranslator->idLanguage()=="ukrainian"; if (str) { const unsigned char *p=(const unsigned char *)str; @@ -1321,7 +1322,7 @@ void LatexGenerator::docify(const char *str) t << (char)c; } } - else if (isCzech || isRussian) + else if (isCzech || isRussian || isUkrainian) { if (c>=128) { diff --git a/src/libdoxygen.pro.in b/src/libdoxygen.pro.in index c86e343..1a6de48 100644 --- a/src/libdoxygen.pro.in +++ b/src/libdoxygen.pro.in @@ -91,7 +91,8 @@ HEADERS = bufstr.h \ treeview.h \ unistd.h \ util.h \ - version.h + version.h \ + xmlgen.h SOURCES = ce_lex.cpp \ ce_parse.cpp \ classdef.cpp \ @@ -141,9 +142,11 @@ SOURCES = ce_lex.cpp \ tagreader.cpp \ translator.cpp \ util.cpp \ - version.cpp + version.cpp \ + xmlgen.cpp -win32:TMAKE_CXXFLAGS += -DQT_NODLL -Zm200 +win32:TMAKE_CXXFLAGS += -DQT_NODLL +win32-msvc:TMAKE_CXXFLAGS += -Zm200 INCLUDEPATH += ../qtools win32:INCLUDEPATH += . DESTDIR = ../lib diff --git a/src/main.cpp b/src/main.cpp index 0406802..1c33296 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -31,6 +31,7 @@ int main(int argc,char **argv) { initDoxygen(); + readConfiguration(argc,argv); parseInput(); generateOutput(); diff --git a/src/memberdef.cpp b/src/memberdef.cpp index bcefdf7..a91f821 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -79,10 +79,10 @@ static void writeDefArgumentList(OutputList &ol,ClassDef *cd, ol.endMemberDocName(); Argument *a=argList->first(); QCString cName; - if (md->scopeDefTemplateArguments()) - { - cName=tempArgListToString(md->scopeDefTemplateArguments()); - } + //if (md->scopeDefTemplateArguments()) + //{ + // cName=tempArgListToString(md->scopeDefTemplateArguments()); + //} if (cd) { cName=cd->name(); @@ -245,8 +245,9 @@ MemberDef::MemberDef(const char *df,int dl, enumFields=0; enumScope=0; enumDeclList=0; - scopeTAL=0; - membTAL=0; + //scopeTAL=0; + //membTAL=0; + m_defTmpArgLists=0; initLines=0; type=t; args=a; @@ -320,6 +321,7 @@ MemberDef::~MemberDef() delete enumFields; delete argList; delete tArgList; + delete m_defTmpArgLists; } void MemberDef::insertReimplementedBy(MemberDef *md) @@ -385,38 +387,34 @@ QCString MemberDef::getOutputFileBase() const return "dummy"; } -static void copyArgumentList(const ArgumentList *src,ArgumentList *dst) -{ - ArgumentListIterator tali(*src); - Argument *a; - for (;(a=tali.current());++tali) - { - dst->append(new Argument(*a)); - } - dst->constSpecifier = src->constSpecifier; - dst->volatileSpecifier = src->volatileSpecifier; - dst->pureSpecifier = src->pureSpecifier; -} +//void MemberDef::setScopeDefTemplateArguments(ArgumentList *tal) +//{ +// // copy function arguments (if any) +// if (tal) +// { +// scopeTAL = new ArgumentList; +// scopeTAL->setAutoDelete(TRUE); +// copyArgumentList(tal,scopeTAL); +// } +//} +// +//void MemberDef::setMemberDefTemplateArguments(ArgumentList *tal) +//{ +// // copy function arguments (if any) +// if (tal) +// { +// membTAL = new ArgumentList; +// membTAL->setAutoDelete(TRUE); +// copyArgumentList(tal,membTAL); +// } +//} -void MemberDef::setScopeDefTemplateArguments(ArgumentList *tal) +void MemberDef::setDefinitionTemplateParameterLists(QList<ArgumentList> *lists) { - // copy function arguments (if any) - if (tal) + if (lists) { - scopeTAL = new ArgumentList; - scopeTAL->setAutoDelete(TRUE); - copyArgumentList(tal,scopeTAL); - } -} - -void MemberDef::setMemberDefTemplateArguments(ArgumentList *tal) -{ - // copy function arguments (if any) - if (tal) - { - membTAL = new ArgumentList; - membTAL->setAutoDelete(TRUE); - copyArgumentList(tal,membTAL); + if (m_defTmpArgLists) delete m_defTmpArgLists; + m_defTmpArgLists = copyArgumentLists(lists); } } @@ -633,10 +631,7 @@ void MemberDef::writeDeclaration(OutputList &ol, if (tArgList) { writeTemplatePrefix(ol,tArgList); - } - else if (membTAL) - { - writeTemplatePrefix(ol,membTAL); + ol.lineBreak(); } QCString ltype(type); @@ -979,43 +974,50 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, } ClassDef *cd=getClassDef(); - ArgumentList *scopeAl=scopeDefTemplateArguments(); - if (scopeAl==0 && cd) scopeAl=cd->templateArguments(); - - ArgumentList *membAl=memberDefTemplateArguments(); - if (membAl==0) membAl=templateArguments(); - if (!Config_getBool("HIDE_SCOPE_NAMES")) { - if (scopeAl && !related) // class template prefix - { - ol.startMemberDocPrefixItem(); - writeTemplatePrefix(ol,scopeAl); - ol.endMemberDocPrefixItem(); - } - if (scopeAl && membAl) ol.docify(" "); - - if (membAl) // function template prefix + bool first=TRUE; + if (m_defTmpArgLists) + // definition has explicate template parameter declarations { - ol.startMemberDocPrefixItem(); - writeTemplatePrefix(ol,membAl); - ol.endMemberDocPrefixItem(); + QListIterator<ArgumentList> ali(*m_defTmpArgLists); + ArgumentList *tal; + for (ali.toFirst();(tal=ali.current());++ali) + { + if (tal->count()>0) + { + if (!first) ol.docify(" "); + ol.startMemberDocPrefixItem(); + writeTemplatePrefix(ol,tal); + ol.endMemberDocPrefixItem(); + } + } } - if (cd) + else { - QCString cName=cd->name(); - int il=cName.find('<'); - int ir=cName.findRev('>'); - if (il!=-1 && ir!=-1 && ir>il) + if (cd) { - ldef=addTemplateNames(ldef, - cName.left(il), /* class without template spec */ - cName.mid(il,ir-il+1) /* templ spec */ - ); + QList<ArgumentList> tempParamLists; + cd->getTemplateParameterLists(tempParamLists); + //printf("#tempParamLists=%d\n",tempParamLists.count()); + QListIterator<ArgumentList> ali(tempParamLists); + ArgumentList *tal; + for (ali.toFirst();(tal=ali.current());++ali) + { + if (tal->count()>0) + { + if (!first) ol.docify(" "); + ol.startMemberDocPrefixItem(); + writeTemplatePrefix(ol,tal); + ol.endMemberDocPrefixItem(); + } + } } - else if (scopeAl) + if (tArgList) // function template prefix { - ldef=addTemplateNames(ldef,cName,tempArgListToString(scopeAl)); + ol.startMemberDocPrefixItem(); + writeTemplatePrefix(ol,tArgList); + ol.endMemberDocPrefixItem(); } } } @@ -1492,6 +1494,7 @@ QCString MemberDef::getScopeString() const QCString MemberDef::anchor() const { + if (m_templateMaster) return m_templateMaster->anchor(); if (enumScope) return enumScope->anchor()+anc; return anc; } diff --git a/src/memberdef.h b/src/memberdef.h index 5a2e279..6fa3b37 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -101,7 +101,6 @@ class MemberDef : public Definition Specifier virtualness() const { return virt; } MemberType memberType() const { return mtype; } - // convenience methods bool isSignal() const { return mtype==Signal; } bool isSlot() const { return mtype==Slot; } @@ -197,10 +196,13 @@ class MemberDef : public Definition argList = al; } ArgumentList *templateArguments() const { return tArgList; } - void setScopeDefTemplateArguments(ArgumentList *t); - ArgumentList *scopeDefTemplateArguments() const { return scopeTAL; } - void setMemberDefTemplateArguments(ArgumentList *t); - ArgumentList *memberDefTemplateArguments() const { return membTAL; } + //void setScopeDefTemplateArguments(ArgumentList *t); + //ArgumentList *scopeDefTemplateArguments() const { return scopeTAL; } + //void setMemberDefTemplateArguments(ArgumentList *t); + //ArgumentList *memberDefTemplateArguments() const { return membTAL; } + void setDefinitionTemplateParameterLists(QList<ArgumentList> *lists); + QList<ArgumentList> *definitionTemplateParameterLists() const + { return m_defTmpArgLists; } // namespace related members void setNamespace(NamespaceDef *nd); @@ -275,8 +277,9 @@ class MemberDef : public Definition MemberDef *annMemb; ArgumentList *argList; // argument list of this member ArgumentList *tArgList; // template argument list of function template - ArgumentList *scopeTAL; // template argument list of class template - ArgumentList *membTAL; // template argument list of class template + //ArgumentList *scopeTAL; // template argument list of class template + //ArgumentList *membTAL; // template argument list of class template + QList<ArgumentList> *m_defTmpArgLists; int grpId; // group id MemberGroup *memberGroup; // group's member definition @@ -1519,8 +1519,9 @@ BN [ \t\r\n] g_defVarArgs = yytext[yyleng-1]=='.'; if (g_defVarArgs) // strip ellipsis { - argName=argName.left(argName.length()-3).stripWhiteSpace(); + argName=argName.left(argName.length()-3); } + argName = argName.stripWhiteSpace(); g_defArgsStr+=yytext; g_argDict->insert(argName,new int(g_defArgs)); g_defArgs++; diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index e3345ca..4605ae6 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -1085,7 +1085,7 @@ void RTFGenerator::endIndexSection(IndexSections is) if (logoFilename) { t << "{\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE " << logoFilename; - t << " \\\\*MERGEFORMAT} {\\fldrslt IMAGE }}\\par\\par\n"; + t << " \\\\d \\\\*MERGEFORMAT} {\\fldrslt IMAGE }}\\par\\par\n"; } if (company) { @@ -2110,7 +2110,7 @@ void RTFGenerator::endClassDiagram(ClassDiagram &d, t << Rtf_Style_Reset << endl; t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE "; t << fileName << ".gif"; - t << " \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl; + t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl; t << "}" << endl; } @@ -2200,7 +2200,7 @@ void RTFGenerator::startImage(const char *name,const char *,bool) t << Rtf_Style_Reset << endl; t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE "; t << name; - t << " \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl; + t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl; t << "}" << endl; } @@ -2551,7 +2551,7 @@ void RTFGenerator::endDotGraph(DotClassGraph &g) t << Rtf_Style_Reset << endl; t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE "; t << fileName << ".gif"; - t << " \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl; + t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl; t << "}" << endl; } @@ -2570,7 +2570,7 @@ void RTFGenerator::endInclDepGraph(DotInclDepGraph &g) t << Rtf_Style_Reset << endl; t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE "; t << fileName << ".gif"; - t << " \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl; + t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl; t << "}" << endl; } diff --git a/src/scanner.l b/src/scanner.l index eba34de..54128b2 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -362,6 +362,39 @@ static void setContext() insideJava = fileName.right(5)==".java"; } +static void prependScope() +{ + if (current_root->section & Entry::SCOPE_MASK) + { + //printf("--- prependScope %s to %s\n",current_root->name.data(),current->name.data()); + current->name.prepend(current_root->name+"::"); + if (current_root->tArgLists) + { + if (current->tArgLists==0) + { + current->tArgLists = new QList<ArgumentList>; + current->tArgLists->setAutoDelete(TRUE); + } + //printf("prependScope #=%d #current=%d\n",current_root->tArgLists->count(),current->tArgLists->count()); + QListIterator<ArgumentList> talsi(*current_root->tArgLists); + ArgumentList *srcAl=0; + for (talsi.toLast();(srcAl=talsi.current());--talsi) + { + ArgumentList *dstAl = new ArgumentList; + dstAl->setAutoDelete(TRUE); + QListIterator<Argument> tali(*srcAl); + Argument *a; + for (;(a=tali.current());++tali) + { + dstAl->append(new Argument(*a)); + //printf("appending argument %s %s\n",a->type.data(),a->name.data()); + } + current->tArgLists->insert(0,dstAl); + } + } + } +} + /* ----------------------------------------------------------------- */ #undef YY_INPUT #define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size); @@ -793,15 +826,15 @@ TITLE [tT][iI][tT][lL][eE] current->fileName = yyFileName; current->startLine = yyLineNr; current->bodyLine = yyLineNr; - if (current->mtArgList) // transfer template arguments - { - if (current->tArgList) - { - delete current->tArgList; - } - current->tArgList = current->mtArgList; - current->mtArgList = 0; - } + //if (current->mtArgList) // transfer template arguments + //{ + // if (current->tArgList) + // { + // delete current->tArgList; + // } + // current->tArgList = current->mtArgList; + // current->mtArgList = 0; + //} lineCount() ; BEGIN( CompoundName ) ; } @@ -813,15 +846,15 @@ TITLE [tT][iI][tT][lL][eE] current->fileName = yyFileName; current->startLine = yyLineNr; current->bodyLine = yyLineNr; - if (current->mtArgList) // transfer template arguments - { - if (current->tArgList) - { - delete current->tArgList; - } - current->tArgList = current->mtArgList; - current->mtArgList = 0; - } + //if (current->mtArgList) // transfer template arguments + //{ + // if (current->tArgList) + // { + // delete current->tArgList; + // } + // current->tArgList = current->mtArgList; + // current->mtArgList = 0; + //} lineCount() ; BEGIN( CompoundName ) ; } @@ -870,18 +903,27 @@ TITLE [tT][iI][tT][lL][eE] //if (current->tArgList /*|| (current_root->section&Entry::COMPOUND_MASK)*/) //{ // printf("-------> member template \n"); - if (current->mtArgList) - { - if (current->tArgList) - { - delete current->tArgList; - } - current->tArgList = current->mtArgList; - current->mtArgList = 0; - } - current->mtArgList = new ArgumentList; - current->mtArgList->setAutoDelete(TRUE); - currentArgumentList = current->mtArgList; + if (current->tArgLists==0) + { + current->tArgLists = new QList<ArgumentList>; + current->tArgLists->setAutoDelete(TRUE); + } + ArgumentList *al = new ArgumentList; + al->setAutoDelete(TRUE); + current->tArgLists->append(al); + currentArgumentList = al; + //if (current->mtArgList) + // { + // if (current->tArgList) + // { + // delete current->tArgList; + // } + // current->tArgList = current->mtArgList; + // current->mtArgList = 0; + // } + // current->mtArgList = new ArgumentList; + // current->mtArgList->setAutoDelete(TRUE); + // currentArgumentList = current->mtArgList; //} //else // class template specifier //{ @@ -961,11 +1003,11 @@ TITLE [tT][iI][tT][lL][eE] sharpCount=0; lineCount(); addType( current ); - if (current->mtArgList && current->tArgList==0) - { - current->tArgList=current->mtArgList; - current->mtArgList=0; - } + //if (current->mtArgList && current->tArgList==0) + //{ + // current->tArgList=current->mtArgList; + // current->mtArgList=0; + //} current->name=yytext; current->name=current->name.stripWhiteSpace(); current->scopeSpec.resize(0); @@ -1039,12 +1081,12 @@ TITLE [tT][iI][tT][lL][eE] // correct for misinterpreting return type as scope name: example: A<T> func() //printf("YY_START=%d current->tArgList=%p current->mtArgList=%p\n", // YY_START,current->tArgList,current->mtArgList); - if (YY_START==FindMembers /*&& current->tArgList*/ && current->mtArgList==0) - { - current->mtArgList=current->tArgList; - current->tArgList=0; - current->scopeSpec.resize(0); - } + //if (YY_START==FindMembers /*&& current->tArgList*/ && current->mtArgList==0) + //{ + // current->mtArgList=current->tArgList; + // current->tArgList=0; + // current->scopeSpec.resize(0); + //} lineCount(); if (insideIDL && yyleng==9 && strcmp(yytext,"cpp_quote")==0) { @@ -1563,10 +1605,10 @@ TITLE [tT][iI][tT][lL][eE] QCString &cn = current->name; QCString rn = current_root->name.copy(); //printf("cn=`%s' rn=`%s'\n",cn.data(),rn.data()); - if (!cn.isEmpty() && !rn.isEmpty() && - (current_root->section & Entry::SCOPE_MASK)) + if (!cn.isEmpty() && !rn.isEmpty()) { - cn.prepend(rn+"::"); + prependScope(); + //cn.prepend(rn+"::"); } if (isTypedef && cn.isEmpty()) { @@ -1608,10 +1650,7 @@ TITLE [tT][iI][tT][lL][eE] current->program+=","; // add field terminator } current->name=yytext; - if (current_root->section & Entry::SCOPE_MASK) - { - current->name.prepend(current_root->name+"::"); - } + prependScope(); current->args = current->args.simplifyWhiteSpace(); current->type = current->type.simplifyWhiteSpace(); //printf("Adding compound %s %s %s\n",current->type.data(),current->name.data(),current->args.data()); @@ -2934,20 +2973,14 @@ TITLE [tT][iI][tT][lL][eE] <ClassDocArg1>{SCOPENAME}/"<" { current->name = yytext; // prepend outer scope name - if (current_root->section & Entry::SCOPE_MASK) - { - current->name.prepend(current_root->name+"::"); - } + prependScope(); lastClassTemplSpecContext = ClassDocArg2; BEGIN( ClassTemplSpec ); } <ClassDocArg1>{SCOPENAME} { current->name = yytext; // prepend outer scope name - if (current_root->section & Entry::SCOPE_MASK) - { - current->name.prepend(current_root->name+"::"); - } + prependScope(); BEGIN( ClassDocArg2 ); } <ClassDocArg1>"\\"{B}*"\n" { yyLineNr++; } @@ -3045,10 +3078,7 @@ TITLE [tT][iI][tT][lL][eE] } <EnumDocArg1>{SCOPEID} { current->name = yytext; - if (current_root->section & Entry::SCOPE_MASK) - { - current->name.prepend(current_root->name+"::"); - } + prependScope(); newDocState(); } <EnumDocArg1>"\\"{B}*"\n" { yyLineNr++; } @@ -3859,16 +3889,6 @@ static void parseCompounds(Entry *rt) memberGroupId = NOGROUP; - // rebuild compound's group context - //QCString *s = ce->groups->first(); - //if (s) - //{ - // lastDefGroup=*s; - // startGroup(); - //} - - //current->mGrpId = memberGroupId = ce->mGrpId; - scanYYlex() ; delete current; current=0; ce->program.resize(0); diff --git a/src/tagreader.cpp b/src/tagreader.cpp index 26b2b0a..3425132 100644 --- a/src/tagreader.cpp +++ b/src/tagreader.cpp @@ -146,7 +146,8 @@ class TagFileParser : public QXmlDefaultHandler InGroup, InPage, InMember, - InPackage + InPackage, + InTempArgList }; class StartElementHandler { @@ -290,6 +291,7 @@ class TagFileParser : public QXmlDefaultHandler m_stateStack.push(new State(m_state)); m_state = InMember; } + void endMember() { m_state = *m_stateStack.pop(); @@ -303,6 +305,8 @@ class TagFileParser : public QXmlDefaultHandler default: err("Error: Unexpected tag `member' found\n"); break; } } + + void endDocAnchor() { switch(m_state) @@ -531,24 +535,24 @@ class TagFileParser : public QXmlDefaultHandler m_tagFilePages.setAutoDelete(TRUE); m_tagFilePackages.setAutoDelete(TRUE); - m_startElementHandlers.insert("compound", new StartElementHandler(this,&TagFileParser::startCompound)); - m_startElementHandlers.insert("member", new StartElementHandler(this,&TagFileParser::startMember)); - m_startElementHandlers.insert("name", new StartElementHandler(this,&TagFileParser::startStringValue)); - m_startElementHandlers.insert("base", new StartElementHandler(this,&TagFileParser::startBase)); - m_startElementHandlers.insert("filename", new StartElementHandler(this,&TagFileParser::startStringValue)); - m_startElementHandlers.insert("path", new StartElementHandler(this,&TagFileParser::startStringValue)); - m_startElementHandlers.insert("anchor", new StartElementHandler(this,&TagFileParser::startStringValue)); - m_startElementHandlers.insert("arglist", new StartElementHandler(this,&TagFileParser::startStringValue)); - m_startElementHandlers.insert("title", new StartElementHandler(this,&TagFileParser::startStringValue)); - m_startElementHandlers.insert("subgroup", new StartElementHandler(this,&TagFileParser::startStringValue)); - m_startElementHandlers.insert("class", new StartElementHandler(this,&TagFileParser::startStringValue)); - m_startElementHandlers.insert("namespace", new StartElementHandler(this,&TagFileParser::startStringValue)); - m_startElementHandlers.insert("file", new StartElementHandler(this,&TagFileParser::startStringValue)); - m_startElementHandlers.insert("page", new StartElementHandler(this,&TagFileParser::startStringValue)); - m_startElementHandlers.insert("docanchor", new StartElementHandler(this,&TagFileParser::startStringValue)); - m_startElementHandlers.insert("tagfile", new StartElementHandler(this,&TagFileParser::startIgnoreElement)); - m_startElementHandlers.insert("templarg", new StartElementHandler(this,&TagFileParser::startStringValue)); - m_startElementHandlers.insert("type", new StartElementHandler(this,&TagFileParser::startStringValue)); + m_startElementHandlers.insert("compound", new StartElementHandler(this,&TagFileParser::startCompound)); + m_startElementHandlers.insert("member", new StartElementHandler(this,&TagFileParser::startMember)); + m_startElementHandlers.insert("name", new StartElementHandler(this,&TagFileParser::startStringValue)); + m_startElementHandlers.insert("base", new StartElementHandler(this,&TagFileParser::startBase)); + m_startElementHandlers.insert("filename", new StartElementHandler(this,&TagFileParser::startStringValue)); + m_startElementHandlers.insert("path", new StartElementHandler(this,&TagFileParser::startStringValue)); + m_startElementHandlers.insert("anchor", new StartElementHandler(this,&TagFileParser::startStringValue)); + m_startElementHandlers.insert("arglist", new StartElementHandler(this,&TagFileParser::startStringValue)); + m_startElementHandlers.insert("title", new StartElementHandler(this,&TagFileParser::startStringValue)); + m_startElementHandlers.insert("subgroup", new StartElementHandler(this,&TagFileParser::startStringValue)); + m_startElementHandlers.insert("class", new StartElementHandler(this,&TagFileParser::startStringValue)); + m_startElementHandlers.insert("namespace", new StartElementHandler(this,&TagFileParser::startStringValue)); + m_startElementHandlers.insert("file", new StartElementHandler(this,&TagFileParser::startStringValue)); + m_startElementHandlers.insert("page", new StartElementHandler(this,&TagFileParser::startStringValue)); + m_startElementHandlers.insert("docanchor", new StartElementHandler(this,&TagFileParser::startStringValue)); + m_startElementHandlers.insert("tagfile", new StartElementHandler(this,&TagFileParser::startIgnoreElement)); + m_startElementHandlers.insert("templarg", new StartElementHandler(this,&TagFileParser::startStringValue)); + m_startElementHandlers.insert("type", new StartElementHandler(this,&TagFileParser::startStringValue)); m_endElementHandlers.insert("compound", new EndElementHandler(this,&TagFileParser::endCompound)); m_endElementHandlers.insert("member", new EndElementHandler(this,&TagFileParser::endMember)); @@ -663,22 +667,22 @@ class TagFileErrorHandler : public QXmlErrorHandler /*! Dumps the internal structures. For debugging only! */ void TagFileParser::dump() { - printf("Result:\n"); + msg("Result:\n"); QListIterator<TagClassInfo> lci(m_tagFileClasses); //============== CLASSES TagClassInfo *cd; for (;(cd=lci.current());++lci) { - printf("class `%s'\n",cd->name.data()); - printf(" filename `%s'\n",cd->filename.data()); + msg("class `%s'\n",cd->name.data()); + msg(" filename `%s'\n",cd->filename.data()); if (cd->bases) { QListIterator<BaseInfo> bii(*cd->bases); BaseInfo *bi; for ( bii.toFirst() ; (bi=bii.current()) ; ++bii) { - printf( " base: %s \n", bi->name.data() ); + msg( " base: %s \n", bi->name.data() ); } } @@ -686,11 +690,11 @@ void TagFileParser::dump() TagMemberInfo *md; for (;(md=mci.current());++mci) { - printf(" member:\n"); - printf(" kind: `%s'\n",md->kind.data()); - printf(" name: `%s'\n",md->name.data()); - printf(" anchor: `%s'\n",md->anchor.data()); - printf(" arglist: `%s'\n",md->arglist.data()); + msg(" member:\n"); + msg(" kind: `%s'\n",md->kind.data()); + msg(" name: `%s'\n",md->name.data()); + msg(" anchor: `%s'\n",md->anchor.data()); + msg(" arglist: `%s'\n",md->arglist.data()); } } //============== NAMESPACES @@ -698,24 +702,24 @@ void TagFileParser::dump() TagNamespaceInfo *nd; for (;(nd=lni.current());++lni) { - printf("namespace `%s'\n",nd->name.data()); - printf(" filename `%s'\n",nd->filename.data()); + msg("namespace `%s'\n",nd->name.data()); + msg(" filename `%s'\n",nd->filename.data()); QStringList::Iterator it; for ( it = nd->classList.begin(); it != nd->classList.end(); ++it ) { - printf( " class: %s \n", (*it).latin1() ); + msg( " class: %s \n", (*it).latin1() ); } QListIterator<TagMemberInfo> mci(nd->members); TagMemberInfo *md; for (;(md=mci.current());++mci) { - printf(" member:\n"); - printf(" kind: `%s'\n",md->kind.data()); - printf(" name: `%s'\n",md->name.data()); - printf(" anchor: `%s'\n",md->anchor.data()); - printf(" arglist: `%s'\n",md->arglist.data()); + msg(" member:\n"); + msg(" kind: `%s'\n",md->kind.data()); + msg(" name: `%s'\n",md->name.data()); + msg(" anchor: `%s'\n",md->anchor.data()); + msg(" arglist: `%s'\n",md->arglist.data()); } } //============== FILES @@ -723,29 +727,29 @@ void TagFileParser::dump() TagFileInfo *fd; for (;(fd=lfi.current());++lfi) { - printf("file `%s'\n",fd->name.data()); - printf(" filename `%s'\n",fd->filename.data()); + msg("file `%s'\n",fd->name.data()); + msg(" filename `%s'\n",fd->filename.data()); QStringList::Iterator it; for ( it = fd->namespaceList.begin(); it != fd->namespaceList.end(); ++it ) { - printf( " namespace: %s \n", (*it).latin1() ); + msg( " namespace: %s \n", (*it).latin1() ); } for ( it = fd->classList.begin(); it != fd->classList.end(); ++it ) { - printf( " class: %s \n", (*it).latin1() ); + msg( " class: %s \n", (*it).latin1() ); } QListIterator<TagMemberInfo> mci(fd->members); TagMemberInfo *md; for (;(md=mci.current());++mci) { - printf(" member:\n"); - printf(" kind: `%s'\n",md->kind.data()); - printf(" name: `%s'\n",md->name.data()); - printf(" anchor: `%s'\n",md->anchor.data()); - printf(" arglist: `%s'\n",md->arglist.data()); + msg(" member:\n"); + msg(" kind: `%s'\n",md->kind.data()); + msg(" name: `%s'\n",md->name.data()); + msg(" anchor: `%s'\n",md->anchor.data()); + msg(" arglist: `%s'\n",md->arglist.data()); } } @@ -754,44 +758,44 @@ void TagFileParser::dump() TagGroupInfo *gd; for (;(gd=lgi.current());++lgi) { - printf("group `%s'\n",gd->name.data()); - printf(" filename `%s'\n",gd->filename.data()); + msg("group `%s'\n",gd->name.data()); + msg(" filename `%s'\n",gd->filename.data()); QStringList::Iterator it; for ( it = gd->namespaceList.begin(); it != gd->namespaceList.end(); ++it ) { - printf( " namespace: %s \n", (*it).latin1() ); + msg( " namespace: %s \n", (*it).latin1() ); } for ( it = gd->classList.begin(); it != gd->classList.end(); ++it ) { - printf( " class: %s \n", (*it).latin1() ); + msg( " class: %s \n", (*it).latin1() ); } for ( it = gd->fileList.begin(); it != gd->fileList.end(); ++it ) { - printf( " file: %s \n", (*it).latin1() ); + msg( " file: %s \n", (*it).latin1() ); } for ( it = gd->subgroupList.begin(); it != gd->subgroupList.end(); ++it ) { - printf( " subgroup: %s \n", (*it).latin1() ); + msg( " subgroup: %s \n", (*it).latin1() ); } for ( it = gd->pageList.begin(); it != gd->pageList.end(); ++it ) { - printf( " page: %s \n", (*it).latin1() ); + msg( " page: %s \n", (*it).latin1() ); } QListIterator<TagMemberInfo> mci(gd->members); TagMemberInfo *md; for (;(md=mci.current());++mci) { - printf(" member:\n"); - printf(" kind: `%s'\n",md->kind.data()); - printf(" name: `%s'\n",md->name.data()); - printf(" anchor: `%s'\n",md->anchor.data()); - printf(" arglist: `%s'\n",md->arglist.data()); + msg(" member:\n"); + msg(" kind: `%s'\n",md->kind.data()); + msg(" name: `%s'\n",md->name.data()); + msg(" anchor: `%s'\n",md->anchor.data()); + msg(" arglist: `%s'\n",md->arglist.data()); } } //============== PAGES @@ -799,9 +803,9 @@ void TagFileParser::dump() TagPageInfo *pd; for (;(pd=lpi.current());++lpi) { - printf("page `%s'\n",pd->name.data()); - printf(" title `%s'\n",pd->title.data()); - printf(" filename `%s'\n",pd->filename.data()); + msg("page `%s'\n",pd->name.data()); + msg(" title `%s'\n",pd->title.data()); + msg(" filename `%s'\n",pd->filename.data()); } } @@ -973,14 +977,17 @@ void TagFileParser::buildLists(Entry *root) } if (tci->templateArguments) { - if (ce->tArgList==0) ce->tArgList = new ArgumentList; + if (ce->tArgLists==0) ce->tArgLists = new QList<ArgumentList>; + ArgumentList *al = new ArgumentList; + ce->tArgLists->append(al); + QListIterator<QString> sli(*tci->templateArguments); QString *argName; for (;(argName=sli.current());++sli) { Argument *a = new Argument; a->name = *argName; - ce->tArgList->append(a); + al->append(a); } } diff --git a/src/translator.cpp b/src/translator.cpp index 1cb3040..3cce9df 100644 --- a/src/translator.cpp +++ b/src/translator.cpp @@ -1,6 +1,15 @@ +/*! \file translator.cpp + * \brief Implementation of generally used translator methods. + * + * This file contains implementation of the translator methods that + * are not expected to be reimplemented by derived translator classes. + * It also contains static data tables used by the methods. + * + */ #include "translator.h" -const char Translator::WinToISOTab[] = +/*! The translation table used by Win1250ToISO88592() method. */ +const char Translator::Win1250ToISO88592Tab[] = { '\x80', '\x81', '\x82', '\x83', '\x84', '\x85', '\x86', '\x87', '\x88', '\x89', '\xA9', '\x8B', '\xA6', '\xAB', '\xAE', '\xAC', @@ -22,7 +31,8 @@ const char Translator::WinToISOTab[] = }; -const char Translator::ISOToWinTab[] = { +/*! The translation table used by ISO88592ToWin1250() method. */ +const char Translator::ISO88592ToWin1250Tab[] = { '\x80', '\x81', '\x82', '\x83', '\x84', '\x85', '\x86', '\x87', '\x88', '\x89', '\x8A', '\x8B', '\x8C', '\x8D', '\x8E', '\x8F', '\x90', '\x91', '\x92', '\x93', '\x94', '\x95', '\x96', '\x97', @@ -42,7 +52,9 @@ const char Translator::ISOToWinTab[] = { '\0' }; -Q_UINT16 Translator::koi8_r[128] = + +/*! The translation table used by Koi8RToWindows1251() method. */ +Q_UINT16 Translator::Koi8RToWindows1251Tab[128] = { 0x2500, 0x2502, 0x250C, 0x2510, 0x2514, 0x2518, 0x251C, 0x2524, 0x252C, 0x2534, 0x253C, 0x2580, 0x2584, 0x2588, 0x258C, 0x2590, 0x2591, 0x2592, 0x2593, 0x2320, 0x25A0, 0x2219/**/, 0x221A, 0x2248, @@ -62,7 +74,8 @@ Q_UINT16 Translator::koi8_r[128] = }; -Q_UINT16 Translator::windows_1251[128] = +/*! The translation table used by Windows1251ToKoi8R() method. */ +Q_UINT16 Translator::Windows1251ToKoi8RTab[128] = { 0x0402, 0x0403, 0x201A, 0x0453, 0x201E, 0x2026, 0x2020, 0x2021, 0x20AC, 0x2030, 0x0409, 0x2039, 0x040A, 0x040C, 0x040B, 0x040F, 0x0452, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, @@ -82,3 +95,99 @@ Q_UINT16 Translator::windows_1251[128] = }; +/*! Returns the string converted from windows-1250 to iso-8859-2. */ +/* The method was designed initially for translator_cz.h. + * It is used for on-line encoding conversion related to + * conditional compilation in Unix/MS Windows environments + * (both use different encoding). Later, the translator_hr.h + * (by Boris Bralo) used and improved the same style. As the + * method with the translation table was the same, the + * decision to move it to this base class was made. The same + * holds for ISO88592ToWin1250() method. + * + * Alexandr Chelpanov used the same approach for + * Koi8RToWindows1251() and Windows1251ToKoi8R() methods. Notice, + * that he uses Unicode tables. + * + * It is recommended for possibly other similar methods in future. + */ +QCString Translator::Win1250ToISO88592(const QCString & sInput) +{ + // The conversion table for characters >127 + // + + QCString result; + int len = sInput.length(); + + for (int i = 0; i < len; ++i) + { + unsigned int c = sInput[i]; + result += (c > 127) ? Win1250ToISO88592Tab[c & 0x7F] : c; + } + return result; +} + + +/*! returns the string converted from iso-8859-2 to windows-1250 */ +/* See the comments of the Win1250ToISO88592() method for details. */ +QCString Translator::ISO88592ToWin1250(const QCString & sInput) +{ + // The conversion table for characters >127 + // + QCString result; + int len = sInput.length(); + + for (int i = 0; i < len; ++i) + { + unsigned int c = sInput[i]; + result += (c > 127) ? ISO88592ToWin1250Tab[c & 0x7F] : c; + } + return result; +} + + +/*! Returns the string converted from koi8-r to windows-1251. */ +/* The method was designed initially for translator_cz.h. + It is used for on-line encoding conversion related to conditional + compilation in Unix/MS Windows environments (both use different + encoding). Encoding table got from QT:qtextcodec.cpp + */ +QCString Translator::Koi8RToWindows1251( const QCString & sInput ) +{ + + QString result; + int len = sInput.length(); + + result.setUnicode(0, len); + QChar* uc = (QChar*)result.unicode(); // const_cast + const unsigned char * c = (const unsigned char *)(const char*)sInput; + for( int i=0; i<len; i++ ) { + if ( c[i] > 127 ) + uc[i] = Koi8RToWindows1251Tab[c[i]-128]; + else + uc[i] = c[i]; + } + return result.local8Bit(); +} + + +/*! returns the string converted from Windows-1251 to koi8-r */ +/* See the comments of the Koi8RToWindows1251() method for details. + Encoding table got from QT:qtextcodec.cpp */ +QCString Translator::Windows1251ToKoi8R( const QCString & sInput ) +{ + QString result; + int len = sInput.length(); + + result.setUnicode(0, len); + QChar* uc = (QChar*)result.unicode(); // const_cast + const unsigned char * c = (const unsigned char *)(const char*)sInput; + for( int i=0; i<len; i++ ) { + if ( c[i] > 127 ) + uc[i] = Windows1251ToKoi8RTab[c[i]-128]; + else + uc[i] = c[i]; + } + return result.local8Bit(); +} + diff --git a/src/translator.h b/src/translator.h index 852b997..c216deb 100644 --- a/src/translator.h +++ b/src/translator.h @@ -25,103 +25,25 @@ class Translator { + private: + /* Tables for encoding conversions. */ + static const char Win1250ToISO88592Tab[]; + static const char ISO88592ToWin1250Tab[]; + static Q_UINT16 Koi8RToWindows1251Tab[128]; + static Q_UINT16 Windows1251ToKoi8RTab[128]; + protected: - static const char WinToISOTab[]; - static const char ISOToWinTab[]; - static Q_UINT16 koi8_r[128]; - static Q_UINT16 windows_1251[128]; /*! Returns the string converted from windows-1250 to iso-8859-2. */ - /* The method was designed initially for translator_cz.h. - * It is used for on-line encoding conversion related to - * conditional compilation in Unix/MS Windows environments - * (both use different encoding). Later, the translator_hr.h - * (by Boris Bralo) used and improved the same style. As the - * method with the translation table was the same, the - * decision to move it to this base class was made. The same - * holds for ISO88592ToWin1250() method. - * - * Alexandr Chelpanov used the same approach for - * Koi8RToWindows1251() and Windows1251ToKoi8R() methods. Notice, - * that he uses Unicode tables. - * - * It is recommended for possibly other similar methods in future. - */ - QCString Win1250ToISO88592(const QCString & sInput) - { - // The conversion table for characters >127 - // - - QCString result; - int len = sInput.length(); - - for (int i = 0; i < len; ++i) - { - unsigned int c = sInput[i]; - result += (c > 127) ? WinToISOTab[c & 0x7F] : c; - } - return result; - } - - /*! returns the string converted from iso-8859-2 to windows-1250 */ - /* See the comments of the Win1250ToISO88592() method for details. */ - QCString ISO88592ToWin1250(const QCString & sInput) - { - // The conversion table for characters >127 - // - QCString result; - int len = sInput.length(); - - for (int i = 0; i < len; ++i) - { - unsigned int c = sInput[i]; - result += (c > 127) ? ISOToWinTab[c & 0x7F] : c; - } - return result; - } + QCString Win1250ToISO88592(const QCString & sInput); + + /*! Returns the string converted from iso-8859-2 to windows-1250. */ + QCString ISO88592ToWin1250(const QCString & sInput); /*! Returns the string converted from koi8-r to windows-1251. */ - /* The method was designed initially for translator_cz.h. - It is used for on-line encoding conversion related to conditional - compilation in Unix/MS Windows environments (both use different - encoding). - Encoding table got from QT:qtextcodec.cpp - */ - QCString Koi8RToWindows1251( const QCString & sInput ) - { - - QString result; - int len = sInput.length(); - - result.setUnicode(0, len); - QChar* uc = (QChar*)result.unicode(); // const_cast - const unsigned char * c = (const unsigned char *)(const char*)sInput; - for( int i=0; i<len; i++ ) { - if ( c[i] > 127 ) - uc[i] = koi8_r[c[i]-128]; - else - uc[i] = c[i]; - } - return result.local8Bit(); - } - /*! returns the string converted from Windows-1251 to koi8-r */ - /* See the comments of the Koi8RToWindows1251() method for details. - Encoding table got from QT:qtextcodec.cpp */ - QCString Windows1251ToKoi8R( const QCString & sInput ) - { - QString result; - int len = sInput.length(); - - result.setUnicode(0, len); - QChar* uc = (QChar*)result.unicode(); // const_cast - const unsigned char * c = (const unsigned char *)(const char*)sInput; - for( int i=0; i<len; i++ ) { - if ( c[i] > 127 ) - uc[i] = windows_1251[c[i]-128]; - else - uc[i] = c[i]; - } - return result.local8Bit(); - } + QCString Koi8RToWindows1251( const QCString & sInput ); + + /*! Returns the string converted from windows-1251 to koi8-r. */ + QCString Windows1251ToKoi8R( const QCString & sInput ); public: @@ -134,19 +56,15 @@ class Translator // --- Language control methods ------------------- - /*! Used for identification of the language. May resemble - * the string returned by latexBabelPackage(), but it is not used - * for the same purpose. The identification should not be translated. - * It should be replaced by the name of the language in English - * (e.g. Czech, Japanese, Russian, etc.). It should be equal to - * the identification in language.cpp. + /*! Used for identification of the language. + * See the comment for the translator_en.h method implementation + * for details. */ virtual QCString idLanguage() = 0; - /*! Used to get the command(s) for the language support. This method - * was designed for languages which do not prefer babel package. - * If this methods returns empty string, then the latexBabelPackage() - * method is used to generate the command for using the babel package. + /*! Used to get the command(s) for the language support. + * See the comment for the translator_en.h method implementation + * for details. */ virtual QCString latexLanguageSupportCommand() = 0; diff --git a/src/translator_cz.h b/src/translator_cz.h index 7fc8f1a..9ea3ba2 100644 --- a/src/translator_cz.h +++ b/src/translator_cz.h @@ -124,6 +124,10 @@ // - Updated misleading information in trLegendDocs(). // - The trReimplementedInList() updated to fit the context better. // - The trReimplementedFromList() updated to fit the context better. +// +// 2001/07/16 +// - trClassDocumentation() updated as in the English translator. +// // // Todo // ---- @@ -508,7 +512,16 @@ class TranslatorCzech : public Translator * the documentation of all classes, structs and unions. */ virtual QCString trClassDocumentation() - { return decode("Dokumentace tЬМd"); } + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return decode("Dokumentace datovЩch struktur"); + } + else + { + return decode("Dokumentace tЬМd"); + } + } /*! This is used in LaTeX as the title of the chapter containing * the documentation of all files. diff --git a/src/translator_pt.h b/src/translator_pt.h index ba0d0cc..a691b15 100644 --- a/src/translator_pt.h +++ b/src/translator_pt.h @@ -15,22 +15,60 @@ * * The translation into Portuguese was provided by * Rui Godinho Lopes <ruiglopes@yahoo.com> + * + * VERSION HISTORY + * --------------- + * 001 20 july 2001 + * - Updated for doxygen v1.2.8.1 + * 000 ? + * - Initial translation for doxygen v1.1.5 */ #ifndef TRANSLATOR_PT_H #define TRANSLATOR_PT_H -#include "translator_adapter.h" - -class TranslatorPortuguese : public TranslatorAdapter_1_1_5 +class TranslatorPortuguese : public Translator { public: + + // --- Language control methods ------------------- + + /*! Used for identification of the language. The identification + * should not be translated. It should be replaced by the name + * of the language in English using lower-case characters only + * (e.g. "czech", "japanese", "russian", etc.). It should be equal to + * the identification used in language.cpp. + */ QCString idLanguage() { return "portuguese"; } + + /*! Used to get the LaTeX command(s) for the language support. + * This method should return string with commands that switch + * LaTeX to the desired language. For example + * <pre>"\\usepackage[german]{babel}\n" + * </pre> + * or + * <pre>"\\usepackage{polski}\n" + * "\\usepackage[latin2]{inputenc}\n" + * "\\usepackage[T1]{fontenc}\n" + * </pre> + * + * The English LaTeX does not use such commands. Because of this + * the empty string is returned in this implementation. + */ + virtual QCString latexLanguageSupportCommand() + { return "Portuguese"; } + /*! returns the name of the package that is included by LaTeX */ QCString latexBabelPackage() { return "portuguese"; } + /*! return the language charset. This will be used for the HTML output */ + virtual QCString idLanguageCharset() + { return "iso-8859-1"; } + + // --- Language translation methods ------------------- + /*! used in the compound documentation before a list of related functions. */ QCString trRelatedFunctions() { return "FunГУes associadas"; } @@ -45,11 +83,11 @@ class TranslatorPortuguese : public TranslatorAdapter_1_1_5 /*! header that is put before the list of typedefs. */ QCString trMemberTypedefDocumentation() - { return "DocumentaГЦo de tipos definidos"; } + { return "DocumentaГЦo das definiГУes de tipo"; } /*! header that is put before the list of enumerations. */ QCString trMemberEnumerationDocumentation() - { return "DocumentaГЦo da enumeraГУes"; } + { return "DocumentaГЦo das enumeraГУes"; } /*! header that is put before the list of member functions. */ QCString trMemberFunctionDocumentation() @@ -57,7 +95,16 @@ class TranslatorPortuguese : public TranslatorAdapter_1_1_5 /*! header that is put before the list of member attributes. */ QCString trMemberDataDocumentation() - { return "DocumentaГЦo dos dados"; } + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "DocumentaГЦo dos campos e atributos"; + } + else + { + return "DocumentaГЦo dos dados membro"; + } + } /*! this is the text of a link put after brief descriptions. */ QCString trMore() @@ -101,14 +148,6 @@ class TranslatorPortuguese : public TranslatorAdapter_1_1_5 QCString trDefinedIn() { return "definido em"; } - /*! put as in introduction in the verbatim header file of a class. - * parameter f is the name of the include file. - */ - QCString trIncludeFile() - { return "Ficheiro incluМdo"; } - QCString trVerbatimText(const char *f) - { return (QCString)"Este texto foi originado pelo ficheiro incluМdo "+f+"."; } - // quick reference sections /*! This is put above each page as a link to the list of all groups of @@ -123,27 +162,54 @@ class TranslatorPortuguese : public TranslatorAdapter_1_1_5 /*! This is put above each page as a link to the list of annotated classes */ QCString trCompoundList() - { return "Lista de componentes"; + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Estruturas de dados"; + } + else + { + return "Lista de componentes"; + } + } - /*! This is put above each page as a link to the list of documented files */} + /*! This is put above each page as a link to the list of documented files */ QCString trFileList() { return "Lista de ficheiros"; } /*! This is put above each page as a link to the list of all verbatim headers */ QCString trHeaderFiles() - { return "Ficheiros IncluМdos"; } + { return "Ficheiros incluМdos"; } /*! This is put above each page as a link to all members of compounds. */ QCString trCompoundMembers() - { return "Componentes"; } + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Campos de dados"; + } + else + { + return "Componentes membro"; + } + } /*! This is put above each page as a link to all members of files. */ QCString trFileMembers() - { return "DeclaraГУes"; } + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Globais"; + } + else + { + return "Ficheiros membro"; + } + } /*! This is put above each page as a link to all related pages. */ QCString trRelatedPages() - { return "Paginas relacionadas"; } + { return "PАginas relacionadas"; } /*! This is put above each page as a link to all examples. */ QCString trExamples() @@ -168,28 +234,78 @@ class TranslatorPortuguese : public TranslatorAdapter_1_1_5 /*! This is an introduction to the annotated compound list. */ QCString trCompoundListDescription() - { return "Lista da classes, estruturas, uniУes e interfaces com uma breve descriГЦo:"; + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Lista das estruturas de dados com uma breve descriГЦo:"; + } + else + { + return "Lista de classes, estruturas, uniУes e interfaces com uma breve descriГЦo:"; + } } /*! This is an introduction to the page with all class members. */ QCString trCompoundMembersDescription(bool extractAll) { - QCString result="Lista de todas as funГУes membro "; - if (!extractAll) result+="documentadas "; - result+="com links para "; - if (extractAll) result+="a documentaГЦo da classe correspondente:"; - else result+="o ficheiro a que pertencem:"; + QCString result="Lista de todas as"; + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+=" estruturas e campos de uniУes"; + } + else + { + result+=" classes membro"; + } + if (!extractAll) + { + result+=" documentadas"; + } + result+=" com links para "; + if (extractAll) + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+="a respectiva documentaГЦo:"; + } + else + { + result+="a documentaГЦo de cada membro:"; + } + } + else + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+="as estruturas/uniУes a que pertencem:"; + } + else + { + result+="as classes a que pertencem:"; + } + } return result; } /*! This is an introduction to the page with all file members. */ QCString trFileMembersDescription(bool extractAll) { - QCString result="Lista de todas as funГУes membro "; - if (!extractAll) result+="documentadas "; + QCString result="Lista de todas as "; + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+="funГУes, variАveis, definiГУes, enumeraГУes e definiГУes de tipo "; + if (!extractAll) result+="documentadas "; + } + else + { + result+="ficheiros membro"; + if (!extractAll) result+="documentados "; + } result+="com links para "; - if (extractAll) result+="a documentaГЦo correspondente:"; - else result+="os ficheiros onde foram definidas:"; + if (extractAll) + result+="os ficheiro a que pertecem:"; + else + result+="a respectiva documentaГЦo:"; return result; } @@ -238,7 +354,16 @@ class TranslatorPortuguese : public TranslatorAdapter_1_1_5 * annotated compound index. */ QCString trCompoundIndex() - { return "мndice dos componentes"; } + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "мndice das estruturas de dados"; + } + else + { + return "мndice dos componentes"; + } + } /*! This is used in LaTeX as the title of the chapter with the * list of all files. @@ -296,7 +421,7 @@ class TranslatorPortuguese : public TranslatorAdapter_1_1_5 * list of typedefs */ QCString trTypedefs() - { return "DefiniГЦo de tipos"; } + { return "DefiniГУes de tipos"; } /*! This is used in the documentation of a file as a header before the * list of enumerations @@ -330,25 +455,25 @@ class TranslatorPortuguese : public TranslatorAdapter_1_1_5 * documentation blocks for defines */ QCString trDefineDocumentation() - { return "DocumentaГЦo da macro"; } + { return "DocumentaГЦo das macros"; } /*! This is used in the documentation of a file/namespace before the list * of documentation blocks for function prototypes */ QCString trFunctionPrototypeDocumentation() - { return "DocumentaГЦo do protСtipo da funГЦo"; } + { return "DocumentaГЦo dos protСtipos de funГУes"; } /*! This is used in the documentation of a file/namespace before the list * of documentation blocks for typedefs */ QCString trTypedefDocumentation() - { return "DocumentaГЦo do tipo"; } + { return "DocumentaГЦo dos tipos"; } /*! This is used in the documentation of a file/namespace before the list * of documentation blocks for enumeration types */ QCString trEnumerationTypeDocumentation() - { return "DocumentaГЦo do tipo de enumeraГЦo"; } + { return "DocumentaГЦo dos valores da enumeraГЦo"; } /*! This is used in the documentation of a file/namespace before the list * of documentation blocks for enumeration values @@ -360,19 +485,28 @@ class TranslatorPortuguese : public TranslatorAdapter_1_1_5 * of documentation blocks for functions */ QCString trFunctionDocumentation() - { return "DocumentaГЦo da funГЦo"; } + { return "DocumentaГЦo das funГУes"; } /*! This is used in the documentation of a file/namespace before the list * of documentation blocks for variables */ QCString trVariableDocumentation() - { return "DocumentaГЦo da variАvel"; } + { return "DocumentaГЦo das variАveis"; } /*! This is used in the documentation of a file/namespace/group before * the list of links to documented compounds */ QCString trCompounds() - { return "Componentes"; } + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Estruturas de Dados"; + } + else + { + return "Componentes"; + } + } /*! This is used in the documentation of a group before the list of * links to documented files @@ -409,7 +543,7 @@ class TranslatorPortuguese : public TranslatorAdapter_1_1_5 /*! this text is generated when the \\reimp command is used. */ QCString trReimplementedForInternalReasons() - { return "Redefinido por razУes internas; o interface nЦo И afectado"; + { return "Redefinido por razУes internas; A interface nЦo foi afectada."; } /*! this text is generated when the \\warning command is used. */ @@ -452,8 +586,11 @@ class TranslatorPortuguese : public TranslatorAdapter_1_1_5 QCString trGeneratedBy() { return "Gerado por"; } - // new since 0.49-990307 +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990307 +////////////////////////////////////////////////////////////////////////// + /*! used as the title of page containing all the index of all namespaces. */ virtual QCString trNamespaceList() { return "Lista de namespaces"; } @@ -480,7 +617,7 @@ class TranslatorPortuguese : public TranslatorAdapter_1_1_5 * related classes */ virtual QCString trRelatedFunctionDocumentation() - { return "DocumentaГЦo das funГУes relacionadas e classes amigas"; } + { return "DocumentaГЦo das classes amigas e funГУes relacionadas"; } ////////////////////////////////////////////////////////////////////////// // new since 0.49-990425 @@ -491,7 +628,7 @@ class TranslatorPortuguese : public TranslatorAdapter_1_1_5 ClassDef::CompoundType compType, bool isTemplate) { - QCString result="Referencia "; + QCString result="ReferЙncia "; switch(compType) { case ClassDef::Class: result+="Ю classe "; break; @@ -500,10 +637,7 @@ class TranslatorPortuguese : public TranslatorAdapter_1_1_5 case ClassDef::Interface: result+="ao interface "; break; case ClassDef::Exception: result+="Ю excepГЦo "; break; } - - if (isTemplate) - result+="<template> "; - + if (isTemplate) result+="Template "; result+=(QCString)clName; return result; } @@ -511,7 +645,7 @@ class TranslatorPortuguese : public TranslatorAdapter_1_1_5 /*! used as the title of the HTML page of a file */ virtual QCString trFileReference(const char *fileName) { - QCString result= "Referencia ao ficheiro "; + QCString result= "ReferЙncia ao ficheiro "; result += fileName; return result; } @@ -519,7 +653,7 @@ class TranslatorPortuguese : public TranslatorAdapter_1_1_5 /*! used as the title of the HTML page of a namespace */ virtual QCString trNamespaceReference(const char *namespaceName) { - QCString result= "Referencia ao namespace "; + QCString result= "ReferЙncia ao namespace "; result += namespaceName; return result; } @@ -565,7 +699,7 @@ class TranslatorPortuguese : public TranslatorAdapter_1_1_5 if (i<numEntries-2) // not the fore last entry result+=", "; else // the fore last entry - result+=", e "; + result+=" e "; } } return result; @@ -611,15 +745,17 @@ class TranslatorPortuguese : public TranslatorAdapter_1_1_5 virtual QCString trNamespaceMemberDescription(bool extractAll) { QCString result="Lista "; - if (extractAll) result+="de todos os "; + if (extractAll) result+="de todos os "; else result+="de toda a documentaГЦo dos "; result+="membros do namespace com links para "; - if (extractAll) result+="a documentaГЦo de cada membro:"; - else result+="o namespace correspondente:"; + if (extractAll) + result+="a documentaГЦo de cada membro:"; + else + result+="o namespace correspondente:"; return result; } - /*! This is used in LaTeX as the title of the chapter with the + /*! This is used in LaTeX as the title of the chapter with the * index of all namespaces. */ virtual QCString trNamespaceIndex() @@ -738,7 +874,7 @@ class TranslatorPortuguese : public TranslatorAdapter_1_1_5 /*! header that is put before the list of constructor/destructors. */ virtual QCString trConstructorDocumentation() { - return "DocumentaГЦo do Construtor & Destrutor"; + return "DocumentaГЦo dos Construtores & Destrutor"; } /*! Used in the file documentation to point to the corresponding sources. */ virtual QCString trGotoSourceCode() @@ -795,7 +931,7 @@ class TranslatorPortuguese : public TranslatorAdapter_1_1_5 ////////////////////////////////////////////////////////////////////////// // new since 1.1.0 ////////////////////////////////////////////////////////////////////////// - + virtual QCString trNote() { return "Nota"; @@ -806,7 +942,14 @@ class TranslatorPortuguese : public TranslatorAdapter_1_1_5 } virtual QCString trPublicAttribs() { - return "Atributos PЗblicos"; + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Campos de Dados"; + } + else + { + return "Atributos PЗblicos"; + } } virtual QCString trStaticPublicAttribs() { @@ -870,12 +1013,340 @@ class TranslatorPortuguese : public TranslatorAdapter_1_1_5 } virtual QCString trInclByDepGraph() { - return "Este grАfico mostra quais sЦo os ficheiros que incluem directamente ou indirectamente este ficheiro:"; + return "Este grafo mostra quais sЦo os ficheiros que incluem directamente ou indirectamente este ficheiro:"; } virtual QCString trSince() { return "Desde"; } +////////////////////////////////////////////////////////////////////////// +// new since 1.1.5 +////////////////////////////////////////////////////////////////////////// + + /*! title of the graph legend page */ + virtual QCString trLegendTitle() + { + return "Legenda do grafo"; + } + /*! page explaining how the dot graph's should be interpreted */ + virtual QCString trLegendDocs() + { + return + "Esta pАgina explica como interpretar os grafos gerados pelo doxygen.<p>\n" + "Considere o seguinte exemplo:\n" + "\\code\n" + "/*! Esta classe vai estar escondida devido Ю truncaГЦo */\n" + "class Invisible { };\n\n" + "/*! Esta classe tem a relaГЦo de heranГa escondida */\n" + "class Truncated : public Invisible { };\n\n" + "/* Classe nЦo documentada por comentАrios doxygen */\n" + "class Undocumented { };\n\n" + "/*! Classe derivada usando derivaГЦo pЗblica */\n" + "class PublicBase : public Truncated { };\n\n" + "/*! Classe derivada usando derivaГЦo protegida */\n" + "class ProtectedBase { };\n\n" + "/*! Classe derivada usando derivaГЦo privada */\n" + "class PrivateBase { };\n\n" + "/*! Classe usada pela classe Inherited */\n" + "class Used { };\n\n" + "/*! Super classe que deriva de vАrias classes */\n" + "class Inherited : public PublicBase,\n" + " protected ProtectedBase,\n" + " private PrivateBase,\n" + " public Undocumented\n" + "{\n" + " private:\n" + " Used *m_usedClass;\n" + "};\n" + "\\endcode\n" + "Se no ficheiro de configuraГЦo estiver a tag \\c MAX_DOT_GRAPH_HEIGHT " + "com o valor de 200 entЦo o seguinte grafo serА gerado:" + "<p><center><img src=\"graph_legend.gif\"></center>\n" + "<p>\n" + "As caixas no grafo anterior tЙm as seguintes interpretaГУes:\n" + "<ul>\n" + "<li>Uma caixa inteiramente preta representa a estrutura ou a classe para " + "a qual o grafo foi gerado.\n" + "<li>Uma caixa com borda preta representa uma estrutura ou classe documentada.\n" + "<li>Uma caixa com borda cinzenta representa uma estrutura ou classe nЦo documentada.\n" + "<li>Uma caixa com borda vermelha representa uma estrutura ou classe documentada onde " + "nem todas as relaГУes de heranГa/encapsulamento sЦo exibidas. Um grafo И truncado " + "quando nЦo cabe na sua Аrea predefinida.\n" + "</ul>\n" + "As setas tЙm a seguinte interpretaГЦo:\n" + "<ul>\n" + "<li>Uma seta azul escura representa uma relaГЦo de heranГa pЗblica entre duas classes.\n" + "<li>Uma seta verde escura representa uma relaГЦo de heranГa protegida.\n" + "<li>Uma seta vermelha escura representa uma relaГЦo de heranГa privada.\n" + "<li>Uma seta rocha em tracejado representa uma relaГЦo de encapsulamento ou uso por " + "parte de outra classe. A legenda da seta contИm o nome da variАvel ou variАveis da " + "relaГЦo. A seta aponta da classe que estabelece a relaГЦo para a classe ou estrutura que " + "И acessМvel.\n" + "</ul>\n"; + } + /*! text for the link to the legend page */ + virtual QCString trLegend() + { + return "legenda"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.0 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a marker that is put before a test item */ + virtual QCString trTest() + { + return "Teste"; + } + /*! Used as the header of the test list */ + virtual QCString trTestList() + { + return "Lista de teste"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.1 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a section header for KDE-2 IDL methods */ + virtual QCString trDCOPMethods() + { + return "MИtodos DCOP"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.2 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a section header for IDL properties */ + virtual QCString trProperties() + { + return "Propriedades"; + } + /*! Used as a section header for IDL property documentation */ + virtual QCString trPropertyDocumentation() + { + return "DocumentaГЦo das propriedades"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.4 +////////////////////////////////////////////////////////////////////////// + + /*! Used for Java interfaces in the summary section of Java packages */ + virtual QCString trInterfaces() + { + return "Interfaces"; + } + /*! Used for Java classes in the summary section of Java packages */ + virtual QCString trClasses() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Estruturas de dados"; + } + else + { + return "Classes"; + } + } + /*! Used as the title of a Java package */ + virtual QCString trPackage(const char *name) + { + return (QCString)"Pacote "+name; + } + /*! Title of the package index page */ + virtual QCString trPackageList() + { + return "Lista de pacotes"; + } + /*! The description of the package index page */ + virtual QCString trPackageListDescription() + { + return "Lista de pacotes com uma breve descriГЦo (se disponМvel):"; + } + /*! The link name in the Quick links header for each page */ + virtual QCString trPackages() + { + return "Pacotes"; + } + /*! Used as a chapter title for Latex & RTF output */ + virtual QCString trPackageDocumentation() + { + return "DocumentaГЦo do pacote"; + } + /*! Text shown before a multi-line define */ + virtual QCString trDefineValue() + { + return "Valor:"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.5 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a marker that is put before a \\bug item */ + virtual QCString trBug() + { + return "Bug"; + } + /*! Used as the header of the bug list */ + virtual QCString trBugList() + { + return "Lista de Bugs"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.6 +////////////////////////////////////////////////////////////////////////// + + /*! Used as ansicpg for RTF file + * + * The following table shows the correlation of Charset name, Charset Value and + * <pre> + * Codepage number: + * Charset Name Charset Value(hex) Codepage number + * ------------------------------------------------------ + * DEFAULT_CHARSET 1 (x01) + * SYMBOL_CHARSET 2 (x02) + * OEM_CHARSET 255 (xFF) + * ANSI_CHARSET 0 (x00) 1252 + * RUSSIAN_CHARSET 204 (xCC) 1251 + * EE_CHARSET 238 (xEE) 1250 + * GREEK_CHARSET 161 (xA1) 1253 + * TURKISH_CHARSET 162 (xA2) 1254 + * BALTIC_CHARSET 186 (xBA) 1257 + * HEBREW_CHARSET 177 (xB1) 1255 + * ARABIC _CHARSET 178 (xB2) 1256 + * SHIFTJIS_CHARSET 128 (x80) 932 + * HANGEUL_CHARSET 129 (x81) 949 + * GB2313_CHARSET 134 (x86) 936 + * CHINESEBIG5_CHARSET 136 (x88) 950 + * </pre> + * + */ + virtual QCString trRTFansicp() + { + return "1252"; + } + + + /*! Used as ansicpg for RTF fcharset + * \see trRTFansicp() for a table of possible values. + */ + virtual QCString trRTFCharSet() + { + return "0"; + } + + /*! Used as header RTF general index */ + virtual QCString trRTFGeneralIndex() + { + return "мndice"; + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trClass(bool first_capital, bool singular) + { + QCString result((first_capital ? "Classe" : "classe")); + if (!singular) result+="s"; + return result; + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trFile(bool first_capital, bool singular) + { + QCString result((first_capital ? "Ficheiro" : "ficheiro")); + if (!singular) result+="s"; + return result; + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trNamespace(bool first_capital, bool singular) + { + QCString result((first_capital ? "Namespace" : "namespace")); + if (!singular) result+="s"; + return result; + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trGroup(bool first_capital, bool singular) + { + QCString result((first_capital ? "Grupo" : "grupo")); + if (!singular) result+="s"; + return result; + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trPage(bool first_capital, bool singular) + { + QCString result((first_capital ? "PАgina" : "pАgina")); + if (!singular) result+="s"; + return result; + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trMember(bool first_capital, bool singular) + { + QCString result((first_capital ? "Membro" : "membro")); + if (!singular) result+="s"; + return result; + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trField(bool first_capital, bool singular) + { + QCString result((first_capital ? "Campo" : "campo")); + if (!singular) result+="s"; + return result; + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trGlobal(bool first_capital, bool singular) + { + QCString result((first_capital ? "Globa" : "globa")); + result+= singular? "l" : "ais"; + return result; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.7 +////////////////////////////////////////////////////////////////////////// + + /*! This text is generated when the \\author command is used and + * for the author section in man pages. */ + virtual QCString trAuthor(bool first_capital, bool singular) + { + QCString result((first_capital ? "Autor" : "autor")); + if (!singular) result+="es"; + return result; + } + }; #endif diff --git a/src/translator_ua.h b/src/translator_ua.h new file mode 100644 index 0000000..3275d9c --- /dev/null +++ b/src/translator_ua.h @@ -0,0 +1,1329 @@ +/****************************************************************************** + * + * + * + * Copyright (C) 1997-2000 by Dimitri van Heesch. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software + * for any purpose. It is provided "as is" without express or implied warranty. + * See the GNU General Public License for more details. + * + * Documents produced by Doxygen are derivative works derived from the + * input used in their production; they are not affected by this license. + * + * The translation into Ukrainian was provided by + * Olexij Tkatchenko (olexij.tkatchenko@parcs.de) + */ + +#ifndef TRANSLATOR_UA_H +#define TRANSLATOR_UA_H + +class TranslatorUkrainian : public Translator +{ + private: + /*! The Decode() inline assumes the source written in the + Koi8-U encoding (maintainer dependent). + */ + inline QCString decode(const QCString & sInput) + { +#ifdef _WIN32 + return Koi8RToWindows1251(sInput); +#else + return sInput; +#endif + } + + public: + /*! Used for identification of the language. */ + virtual QCString idLanguage() + { return "ukrainian"; } + + /* Used to get the command(s) for the language support. */ + virtual QCString latexLanguageSupportCommand() +#ifdef _WIN32 + { return "\\usepackage[cp1251]{inputenc}\n\\usepackage[ukrainian]{babel}\n"; } +#else + { return "\\usepackage[koi8-u]{inputenc}\n\\usepackage[ukrainian]{babel}\n"; } +#endif + + /*! return the language charset. This will be used for the HTML output */ + virtual QCString idLanguageCharset() +#ifdef _WIN32 + { return "Windows-1251"; } +#else + { return "koi8-u"; } +#endif + + // --- Language translation methods ------------------- + + /*! used in the compound documentation before a list of related functions. */ + virtual QCString trRelatedFunctions() + { return decode("Спор╕днен╕ фукц╕╖"); } + + /*! subscript for the related functions. */ + virtual QCString trRelatedSubscript() + { return decode("(не методи компонент)"); } + + /*! header that is put before the detailed description of files, classes and namespaces. */ + virtual QCString trDetailedDescription() + { return decode("Детальний опис"); } + + /*! header that is put before the list of typedefs. */ + virtual QCString trMemberTypedefDocumentation() + { return decode("Опис тип╕в користувача"); } + + /*! header that is put before the list of enumerations. */ + virtual QCString trMemberEnumerationDocumentation() + { return decode("Опис перел╕к╕в користувача"); } + + /*! header that is put before the list of member functions. */ + virtual QCString trMemberFunctionDocumentation() + { return decode("Опис метод╕в компонент"); } + + /*! header that is put before the list of member attributes. */ + virtual QCString trMemberDataDocumentation() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return decode( "Поля" ); + } + else + { + return decode( "Компонентн╕ дан╕" ); + } + } + + /*! this is the text of a link put after brief descriptions. */ + virtual QCString trMore() + { return decode("Детальн╕ше..."); } + + /*! put in the class documentation */ + /* Dosn't use when optimization for C is on. */ + virtual QCString trListOfAllMembers() + { + return decode( "Список вс╕х елемент╕в" ); + } + + /*! used as the title of the "list of all members" page of a class */ + /* Dosn't use when optimization for C is on. */ + virtual QCString trMemberList() + { + return decode( "Cписок елемент╕в" ); + } + + /*! this is the first part of a sentence that is followed by a class name */ + /* Dosn't use when optimization for C is on. */ + virtual QCString trThisIsTheListOfAllMembers() + { return decode("Повний список елемент╕в"); } + + /*! this is the remainder of the sentence after the class name */ + /* Dosn't use when optimization for C is on. */ + virtual QCString trIncludingInheritedMembers() + { return decode(", включаючи вс╕ успадкован╕ елементи"); } + + /*! this is put at the author sections at the bottom of man pages. + * parameter s is name of the project name. + */ + virtual QCString trGeneratedAutomatically(const char *s) + { QCString result=decode("Автоматично створено за допомогою Doxygen"); + if (s) result+=decode(" для ")+s; + result+=decode(" з тексту програми."); + return result; + } + + /*! put after an enum name in the list of all members */ + virtual QCString trEnumName() + { return decode("Перел╕к"); } + + /*! put after an enum value in the list of all members */ + virtual QCString trEnumValue() + { return decode("Елемент перел╕ку"); } + + /*! put after an undocumented member in the list of all members */ + virtual QCString trDefinedIn() + { return decode("визначено в "); } + + // quick reference sections + + /*! This is put above each page as a link to the list of all groups of + * compounds or files (see the \\group command). + */ + virtual QCString trModules() + { return decode("Програмн╕ модул╕"); } + + /*! This is put above each page as a link to the class hierarchy */ + virtual QCString trClassHierarchy() + { return decode("╤╓рарх╕я клас╕в"); } + + /*! This is put above each page as a link to the list of annotated classes */ + virtual QCString trCompoundList() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return decode( "Структури даних" ); + } + else + { + return decode( "Класи" ); + } + } + + /*! This is put above each page as a link to the list of documented files */ + virtual QCString trFileList() + { return decode("Файли"); } + + /*! This is put above each page as a link to the list of all verbatim headers */ + virtual QCString trHeaderFiles() + { return decode("Заголовочн╕ файли"); } + + /*! This is put above each page as a link to all members of compounds. */ + virtual QCString trCompoundMembers() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return decode( "Поля структур" ); + } + else + { + return decode( "Елементи клас╕в" ); + } + } + + /*! This is put above each page as a link to all members of files. */ + /*??*/ + virtual QCString trFileMembers() + { + return decode( "Елементи файлу" ); + } + + /*! This is put above each page as a link to all related pages. */ + virtual QCString trRelatedPages() + /* ?? Вариант перевода "См. также: " более удачный, но не в заголовке, + как в данном случае. */ + { return decode("Додаткова ╕нформац╕я"); } + + /*! This is put above each page as a link to all examples. */ + virtual QCString trExamples() + { return decode("Приклади"); } + + /*! This is put above each page as a link to the search engine. */ + virtual QCString trSearch() + { return decode("Пошук"); } + + /*! This is an introduction to the class hierarchy. */ + virtual QCString trClassHierarchyDescription() + { return decode("Список успадкувань впорядковано наближено до алфав╕ту"); } + + /*! This is an introduction to the list with all files. */ + virtual QCString trFileListDescription(bool extractAll) + { + QCString result="Повний список "; + if (!extractAll) result+="документованих "; + result+="файл╕в."; + return decode(result); + } + + /*! This is an introduction to the annotated compound list. */ + virtual QCString trCompoundListDescription() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return decode( "Структури даних з коротким описом." ); + } + else + { + return decode( "Класи, структури, об'╓днання та ╕нтерфейси з коротким описом." ); + } + } + + /*! This is an introduction to the page with all class members. */ + virtual QCString trCompoundMembersDescription(bool extractAll) + { + QCString result="Список вс╕х "; + if(!extractAll) result+="документоаних "; + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + result+="елемент╕в структур даних з посиланням на "; + else + result+="елемент╕в клас╕в даних з посиланням на "; + if(extractAll) + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + result+="документац╕ю по структур╕/об'╓днанню кожного елементу."; + else + result+="документац╕ю по класу кожного елементу."; + } + else + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + result += "в╕дпов╕дн╕ структури"; + else + result += "в╕дпов╕дн╕ класи"; + result+=", до яких вони належать."; + } + return decode( result ); + } + + /*! This is an introduction to the page with all file members. */ + virtual QCString trFileMembersDescription(bool extractAll) + { + QCString result="Список вс╕х "; + if (!extractAll) result+="документованих "; + + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+="функц╕й, зм╕нних, макроозначень, " + "перел╕к╕в ╕ означень тип╕в"; + } + else + { + result+="елемент╕в файл╕в "; + } + result+=" з посиланям на "; + if (extractAll) + result+="файли, до яких вони належать."; + else + result+="документац╕ю."; + return decode( result ); + } + + /*! This is an introduction to the page with the list of all header files. */ + virtual QCString trHeaderFilesDescription() + { return decode("Повний список заголовочних файл╕в."); } + + /*! This is an introduction to the page with the list of all examples */ + virtual QCString trExamplesDescription() + { return decode("Повний список приклад╕в."); } + + /*! This is an introduction to the page with the list of related pages */ + virtual QCString trRelatedPagesDescription() + { return decode("Полный список додаткових опис╕в."); } + + /*! This is an introduction to the page with the list of class/file groups */ + virtual QCString trModulesDescription() + { return decode("Полный список модул╕в."); } + + /*! This sentences is used in the annotated class/file lists if no brief + * description is given. + */ + virtual QCString trNoDescriptionAvailable() + { return decode("Опис в╕дсутн╕й"); } + + // index titles (the project name is prepended for these) + + + /*! This is used in HTML as the title of index.html. */ + virtual QCString trDocumentation() + { return decode("Документац╕я"); } + + /*! This is used in LaTeX as the title of the chapter with the + * index of all groups. + */ + virtual QCString trModuleIndex() + { return decode("Алфав╕тний покажчик модул╕в"); } + + /*! This is used in LaTeX as the title of the chapter with the + * class hierarchy. + */ + virtual QCString trHierarchicalIndex() + { return decode("╤╓рарх╕чний покажчик клас╕в"); } + + /*! This is used in LaTeX as the title of the chapter with the + * annotated compound index. + */ + virtual QCString trCompoundIndex() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return decode( "Алфав╕тний покажчик структур даних" ); + } + else + { + return decode( "Алфав╕тний покажчик клас╕в" ); + } + } + + /*! This is used in LaTeX as the title of the chapter with the + * list of all files. + */ + virtual QCString trFileIndex() + { return decode( "Покажчик файлв" ); } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all groups. + */ + virtual QCString trModuleDocumentation() + { return decode("Програмн╕ Модул╕"); } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all classes, structs and unions. + */ + virtual QCString trClassDocumentation() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return decode( "Структури даних" ); + } + else + { + return decode( "Класи" ); + } + } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all files. + */ + virtual QCString trFileDocumentation() + { return decode("Файли"); } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all examples. + */ + virtual QCString trExampleDocumentation() + { return decode("Приклади"); } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all related pages. + */ + virtual QCString trPageDocumentation() + { return decode("Документац╕я по тем╕"); } + + /*! This is used in LaTeX as the title of the document */ + virtual QCString trReferenceManual() + { return decode("Дов╕дковий пос╕бник"); } + + /*! This is used in the documentation of a file as a header before the + * list of defines + */ + virtual QCString trDefines() + { return decode("Макроозначення"); } + + /*! This is used in the documentation of a file as a header before the + * list of function prototypes + */ + virtual QCString trFuncProtos() + { return decode("Прототипи фукц╕й"); } + + /*! This is used in the documentation of a file as a header before the + * list of typedefs + */ + virtual QCString trTypedefs() + { return decode("Означення тип╕в"); } + + /*! This is used in the documentation of a file as a header before the + * list of enumerations + */ + virtual QCString trEnumerations() + { return decode("Перел╕ки"); } + + /*! This is used in the documentation of a file as a header before the + * list of (global) functions + */ + virtual QCString trFunctions() + { return decode("Функц╕╖"); } + + /*! This is used in the documentation of a file as a header before the + * list of (global) variables + */ + virtual QCString trVariables() + { return decode("Зм╕нн╕"); } + + /*! This is used in the documentation of a file as a header before the + * list of (global) variables + */ + virtual QCString trEnumerationValues() + { return decode("Елементи перел╕к╕в"); } + + /*! This is used in the documentation of a file before the list of + * documentation blocks for defines + */ + virtual QCString trDefineDocumentation() + { return decode("Опис макроозначень"); } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for function prototypes + */ + virtual QCString trFunctionPrototypeDocumentation() + { return decode("Опис прототип╕в функц╕й"); } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for typedefs + */ + virtual QCString trTypedefDocumentation() + { return decode("Опис означень тип╕в"); } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for enumeration types + */ + virtual QCString trEnumerationTypeDocumentation() + { return decode("Опис перел╕к╕в"); } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for enumeration values + */ + virtual QCString trEnumerationValueDocumentation() + { return decode("Опис елемент╕в перел╕ку"); } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for functions + */ + virtual QCString trFunctionDocumentation() + { return decode("Опис функц╕й"); } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for variables + */ + virtual QCString trVariableDocumentation() + { return decode("Опис зм╕нних"); } + + /*! This is used in the documentation of a file/namespace/group before + * the list of links to documented compounds + */ + virtual QCString trCompounds() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return decode( "Структури даних" ); + } + else + { + return decode( "Класи" ); + } + + } + + /*! This is used in the documentation of a group before the list of + * links to documented files + */ + /*! This is used in the standard footer of each page and indicates when + * the page was generated + */ + virtual QCString trGeneratedAt(const char *date,const char *projName) + { + QCString result=decode("Документац╕я "); + if (projName) result+=decode("до ")+projName; + result+=decode(" створена ")+date; + result+=decode(" системою"); + return result; + } + /*! This is part of the sentence used in the standard footer of each page. + */ + virtual QCString trWrittenBy() + { + return decode("Автор:"); + } + + /*! this text is put before a class diagram */ + virtual QCString trClassDiagram(const char *clName) + { + return decode("Схема успадкувань для ")+clName; + } + + /*! this text is generated when the \\internal command is used. */ + virtual QCString trForInternalUseOnly() + { return decode("Т╕льки для внутр╕шнього користування"); } + + /*! this text is generated when the \\reimp command is used. */ + virtual QCString trReimplementedForInternalReasons() + /*??*/ + { return decode("Зм╕нено з внутр╕шн╕х причин. Зм╕ни не торкаються API."); + } + + /*! this text is generated when the \\warning command is used. */ + virtual QCString trWarning() + { return decode("Застереження"); } + + /*! this text is generated when the \\bug command is used. */ + virtual QCString trBugsAndLimitations() + { return decode("Помилки та обмеження застосування"); } + + /*! this text is generated when the \\version command is used. */ + virtual QCString trVersion() + { return decode("Верс╕я"); } + + /*! this text is generated when the \\date command is used. */ + virtual QCString trDate() + { return decode("Дата"); } + + /*! this text is generated when the \\return command is used. */ + virtual QCString trReturns() + { return decode("Поверта╓"); } + + /*! this text is generated when the \\sa command is used. */ + virtual QCString trSeeAlso() + { return decode("Див. також"); } + + /*! this text is generated when the \\param command is used. */ + virtual QCString trParameters() + { return decode("Аргументи"); } + + /*! this text is generated when the \\exception command is used. */ + virtual QCString trExceptions() + { return decode("Обробка виняткових ситуац╕й"); } + + /*! this text is used in the title page of a LaTeX document. */ + virtual QCString trGeneratedBy() + { return decode("Створено системою"); } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990307 +////////////////////////////////////////////////////////////////////////// + + /*! used as the title of page containing all the index of all namespaces. */ + virtual QCString trNamespaceList() + { return decode("Прост╕р ╕мен"); } + + /*! used as an introduction to the namespace list */ + virtual QCString trNamespaceListDescription(bool extractAll) + { + QCString result="Повний перел╕к "; + if (!extractAll) result+="документованих "; + result+="простор╕в ╕мен."; + return decode(result); + } + + /*! used in the class documentation as a header before the list of all + * friends of a class + */ + virtual QCString trFriends() + { return decode("Дружн╕ класи"); } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990405 +////////////////////////////////////////////////////////////////////////// + + /*! used in the class documentation as a header before the list of all + * related classes + */ + virtual QCString trRelatedFunctionDocumentation() + { return decode("Документация до дружн╕х клас╕в та в╕дпов╕дних функц╕й"); } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990425 +////////////////////////////////////////////////////////////////////////// + + /*! used as the title of the HTML page of a class/struct/union */ + virtual QCString trCompoundReference(const char *clName, + ClassDef::CompoundType compType, + bool isTemplate) + { + QCString result; + if (isTemplate) + { + result="Шаблон "; + switch(compType) + { + case ClassDef::Class: result+="класу"; break; + case ClassDef::Struct: result+="структури"; break; + case ClassDef::Union: result+="об'╓днання"; break; + case ClassDef::Interface: result+="╕нтерфейсу"; break; + case ClassDef::Exception: result+="Виняток"; break; + } + } + else + { + switch(compType) + { + case ClassDef::Class: result+="Клас"; break; + case ClassDef::Struct: result+="Структура"; break; + case ClassDef::Union: result+="Об'╓днання"; break; + case ClassDef::Interface: result+="╤нтерфейс"; break; + case ClassDef::Exception: result+="Виняток"; break; + } + } + result+=" "; + return decode(result)+clName; + } + + /*! used as the title of the HTML page of a file */ + virtual QCString trFileReference(const char *fileName) + { + return decode("Файл ")+fileName; + } + + /*! used as the title of the HTML page of a namespace */ + virtual QCString trNamespaceReference(const char *namespaceName) + { + return decode("Прост╕р ╕мен ")+namespaceName; + } + + virtual QCString trPublicMembers() + { return decode("Загальнодоступн╕ елементи"); } + virtual QCString trPublicSlots() + { return decode("Загальнодоступн╕ слоти"); } + virtual QCString trSignals() + { return decode("Сигнали"); } + virtual QCString trStaticPublicMembers() + { return decode("Загальнодоступн╕ статичн╕ елементи"); } + virtual QCString trProtectedMembers() + { return decode("Захищен╕ елементи"); } + virtual QCString trProtectedSlots() + { return decode("Захищен╕ слоти"); } + virtual QCString trStaticProtectedMembers() + { return decode("Захищен╕ статичн╕ елементи"); } + virtual QCString trPrivateMembers() + { return decode("Приватн╕ елементи"); } + virtual QCString trPrivateSlots() + { return decode("Приватн╕ слоти"); } + virtual QCString trStaticPrivateMembers() + { return decode("Приватн╕ статичн╕ елементи"); } + + /*! this function is used to produce a comma-separated list of items. + * use generateMarker(i) to indicate where item i should be put. + */ + virtual QCString trWriteList(int numEntries) + { + 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+=decode( " ╕ " ); + } + } + return result; + } + + /*! used in class documentation to produce a list of base classes, + * if class diagrams are disabled. + */ + virtual QCString trInheritsList(int numEntries) + { + return decode("Успадкову╓ клас ")+trWriteList(numEntries)+"."; + } + + /*! used in class documentation to produce a list of super classes, + * if class diagrams are disabled. + */ + virtual QCString trInheritedByList(int numEntries) + { + return decode("Успадковано класами ")+trWriteList(numEntries)+"."; + } + + /*! used in member documentation blocks to produce a list of + * members that are hidden by this one. + */ + virtual QCString trReimplementedFromList(int numEntries) + { + return decode("Переозначення з ")+trWriteList(numEntries)+"."; + } + + /*! used in member documentation blocks to produce a list of + * all member that overwrite the implementation of this member. + */ + virtual QCString trReimplementedInList(int numEntries) + { + return decode("Переознача╓ться в ")+trWriteList(numEntries)+"."; + } + + /*! This is put above each page as a link to all members of namespaces. */ + virtual QCString trNamespaceMembers() + { return decode("Елементи простору ╕мен"); } + + /*! This is an introduction to the page with all namespace members */ + virtual QCString trNamespaceMemberDescription(bool extractAll) + { + QCString result="Повний перел╕к "; + if (!extractAll) result+="документованих "; + result+="елемет╕в простору ╕мен з посиланням "; + if (extractAll) + result+="на документац╕ю для кожного елементу:"; + else + result+="на прост╕р ╕мен до якого вони належать:"; + return decode(result); + } + + /*! This is used in LaTeX as the title of the chapter with the + * index of all namespaces. + */ + virtual QCString trNamespaceIndex() + { return decode("Алфав╕тний покажчик простору ╕мен"); } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all namespaces. + */ + virtual QCString trNamespaceDocumentation() + { return decode("Опис простору ╕мен"); } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990522 +////////////////////////////////////////////////////////////////////////// + + /*! This is used in the documentation before the list of all + * namespaces in a file. + */ + virtual QCString trNamespaces() + { return decode( "Простори ╕мен" ); } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990728 +////////////////////////////////////////////////////////////////////////// + + /*! This is put at the bottom of a class documentation page and is + * followed by a list of files that were used to generate the page. + */ + virtual QCString trGeneratedFromFiles(ClassDef::CompoundType compType, + bool single) + { // here s is one of " Class", " Struct" or " Union" + // single is true implies a single file + QCString result=(QCString)"Документац╕я "; + switch(compType) + { + case ClassDef::Class: + if (single) result+="цього класу"; else result+="цих клас╕в"; + break; + case ClassDef::Struct: + if (single) result+="ц╕╓╖ структури"; else result+="цих структур"; + break; + case ClassDef::Union: + if (single) result+="цього об'╓днання"; else result+="цих об'╓днань"; + break; + case ClassDef::Interface: + if (single) result+="цього ╕нтерфейсу"; else result+="цих ╕нтерфейс╕в"; + break; + case ClassDef::Exception: + if (single) result+="цього винятку"; else result+="цих винятк╕в"; + break; + } + result+=" була створена з файл"; + if (single) result+="у:"; else result+="╕в:"; + return decode(result); + } + + /*! This is in the (quick) index as a link to the alphabetical compound + * list. + */ + virtual QCString trAlphabeticalList() + { return decode("Алфав╕тний покажчик"); } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990901 +////////////////////////////////////////////////////////////////////////// + + /*! This is used as the heading text for the retval command. */ + virtual QCString trReturnValues() + { return decode("Значения, що повертаються"); } + + /*! This is in the (quick) index as a link to the main page (index.html) + */ + virtual QCString trMainPage() + { return decode("Титульна стор╕нка"); } + + /*! This is used in references to page that are put in the LaTeX + * documentation. It should be an abbreviation of the word page. + */ + virtual QCString trPageAbbreviation() + { return decode("стор."); } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-991106 +////////////////////////////////////////////////////////////////////////// + + virtual QCString trSources() + { + return decode("Вих╕дн╕ тексти."); + } + virtual QCString trDefinedAtLineInSourceFile() + { + return decode("Див. означення в файл╕ @1, рядок @0"); + } + virtual QCString trDefinedInSourceFile() + { + return decode("Див. означення в файл╕ @0"); + } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-991205 +////////////////////////////////////////////////////////////////////////// + + virtual QCString trDeprecated() + { + return decode("Не рекомендовано"); + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.0.0 +////////////////////////////////////////////////////////////////////////// + + /*! this text is put before a collaboration diagram */ + virtual QCString trCollaborationDiagram(const char *clName) + { + return (QCString)decode("Д╕аграма зв'язк╕в класу ")+clName+":"; + } + /*! this text is put before an include dependency graph */ + virtual QCString trInclDepGraph(const char *fName) + { + return decode("Д╕аграма включених заголовочних файл╕в для ")+fName+":"; + } + /*! header that is put before the list of constructor/destructors. */ + virtual QCString trConstructorDocumentation() + { + return decode("Конструктор(и)"); + } + /*! Used in the file documentation to point to the corresponding sources. */ + virtual QCString trGotoSourceCode() + { + return decode("Див. вих╕дн╕ тексти."); + } + /*! Used in the file sources to point to the corresponding documentation. */ + virtual QCString trGotoDocumentation() + { + return decode("Див. документац╕ю."); + } + /*! Text for the \\pre command */ + virtual QCString trPrecondition() + { + return decode("Передумови"); + } + /*! Text for the \\post command */ + virtual QCString trPostcondition() + { + return decode("П╕сляумови"); + } + /*! Text for the \\invariant command */ + virtual QCString trInvariant() + { + return decode("╤нвар╕ант"); + } + /*! Text shown before a multi-line variable/enum initialization */ + virtual QCString trInitialValue() + { + return decode("Початков╕ значення"); + } + /*! Text used the source code in the file index */ + virtual QCString trCode() + { + return decode("Вих╕дн╕ тексти"); + } + virtual QCString trGraphicalHierarchy() + { + return decode("Граф╕чна ╕╓рарх╕я клас╕в"); + } + virtual QCString trGotoGraphicalHierarchy() + { + return decode("див. граф╕чну ╕╓рарх╕ю"); + } + virtual QCString trGotoTextualHierarchy() + { + return decode("див. текстову ╕╓рарх╕ю"); + } + virtual QCString trPageIndex() + { + return decode("Алфав╕тний покажчик тематичних опис╕в"); + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.1.0 +////////////////////////////////////////////////////////////////////////// + + virtual QCString trNote() + { + return decode("Нотатки"); + } + virtual QCString trPublicTypes() + { + return decode("Загальнодоступн╕ типи"); + } + virtual QCString trPublicAttribs() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return decode( "Поля даних" ); + } + else + { + return decode( "Загальнодоступн╕ атрибути" ); + } + } + virtual QCString trStaticPublicAttribs() + { + return decode("Статичн╕ загальнодоступн╕ данн╕"); + } + virtual QCString trProtectedTypes() + { + return decode("Захищен╕ типи"); + } + virtual QCString trProtectedAttribs() + { + return decode("Захищен╕ дан╕"); + } + virtual QCString trStaticProtectedAttribs() + { + return decode("Статичн╕ захищен╕ дан╕"); + } + virtual QCString trPrivateTypes() + { + return decode("Приватн╕ типи"); + } + virtual QCString trPrivateAttribs() + { + return decode("Приватн╕ дан╕"); + } + virtual QCString trStaticPrivateAttribs() + { + return decode("Приватн╕ статичн╕ дан╕"); + } + + +////////////////////////////////////////////////////////////////////////// +// new since 1.1.3 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a marker that is put before a todo item */ + virtual QCString trTodo() + /*??*/ + { + return decode("Необх╕дно зробити"); + } + /*! Used as the header of the todo list */ + virtual QCString trTodoList() + /*??*/ + { + return decode("Перел╕к завдань"); + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.1.4 +////////////////////////////////////////////////////////////////////////// + + virtual QCString trReferencedBy() + { + return decode("Вжива╓ться в"); + } + virtual QCString trRemarks() + { + return decode("Прим."); + } + virtual QCString trAttention() + { + return decode("Увага"); + } + virtual QCString trInclByDepGraph() + { + return decode("Граф файлов, як╕ включають цей файл:"); + } + virtual QCString trSince() + /*??*/ + { + return decode("Починаючи з"); + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.1.5 +////////////////////////////////////////////////////////////////////////// + + /*! title of the graph legend page */ + virtual QCString trLegendTitle() + { + return decode("Легенда"); + } + /*! page explaining how the dot graph's should be interpreted */ + virtual QCString trLegendDocs() + { + return decode( + "Позначення, що використовуються у графах.<p>\n" + "Розглянемо наступний приклад:\n" + "\\code\n" + "/*! Невидимый класс из-за усечения */\n" + "class Invisible { };\n\n" + "/*! Обмежений клас, в╕дношення успадкування приховане */\n" + "class Truncated : public Invisible { };\n\n" + "/* Недокументований класс */\n" + "class Undocumented { };\n\n" + "/*! Загальнодоступне успадкування */\n" + "class PublicBase : public Truncated { };\n\n" + "/*! Захищене успадкування */\n" + "class ProtectedBase { };\n\n" + "/*! Приватне успадкування */\n" + "class PrivateBase { };\n\n" + "/*! Клас, що використову╓ться класом Inherited */\n" + "class Used { };\n\n" + "/*! Клас, що успадкову╓ ╕нш╕ класи */\n" + "class Inherited : public PublicBase,\n" + " protected ProtectedBase,\n" + " private PrivateBase,\n" + " public Undocumented\n" + "{\n" + " private:\n" + " Used *m_usedClass;\n" + "};\n" + "\\endcode\n" + "Якщо \\c MAX_DOT_GRAPH_HEIGHT в конф╕гурац╕йному файл╕ " + "установлене на 200, отрима╓мо наступний граф:" + "<p><center><img src=\"graph_legend.gif\"></center>\n" + "<p>\n" + "Прямокутники в цьому граф╕ мають наступний зм╕ст:\n" + "<ul>\n" + "<li>Заповнений чорний прямокутник в╕добража╓ структуру або клас, " + "для якого створено граф.\n" + "<li>Прямокутник з чорною межею в╕добража╓ документовану структуру або клас.\n" + "<li>Прямокутник з с╕рою межею в╕добража╓ недокументовану структуру або клас.\n" + "<li>Прямокутник з червоною межею в╕добража╓ документовану структуру або клас, для яких\n" + " не вс╕ сп╕вв╕дношення успадкування/зм╕сту показан╕. Граф зр╕заниЙ, " + "якщо в╕н не вм╕ща╓ться у вказан╕ меж╕." + "</ul>\n" + "Стр╕лки мають наступний зм╕ст:\n" + "<ul>\n" + "<li>Темносиня стр╕лка в╕добража╓ в╕дношення загальнодоступного успадкування " + "м╕ь двома класами.\n" + "<li>Темнозелена стр╕лка використову╓ться при захищеному успадкуванн╕.\n" + "<li>Темночервона стр╕лка використову╓ться при приватному успадкуванн╕.\n" + "<li>Пурпурна стр╕лка використову╓ться, якщо клас м╕ститься в" + "╕ншому клас╕ або ним використову╓ться." + "Стр╕лка етикету╓ться зм╕нною, " + "через яку в╕дбува╓ться доступ до вказано╖ структури або класу. \n" + "</ul>\n"); + } + /*! text for the link to the legend page */ + virtual QCString trLegend() + { + return decode("див. легенду"); + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.0 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a marker that is put before a test item */ + virtual QCString trTest() + { + return decode("Тест"); + } + /*! Used as the header of the test list */ + virtual QCString trTestList() + { + return decode("Перел╕к тест╕в"); + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.1 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a section header for KDE-2 IDL methods */ + virtual QCString trDCOPMethods() + { + return decode("DCOP Методи"); + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.2 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a section header for IDL properties */ + virtual QCString trProperties() + { + return decode("Властивост╕"); + } + /*! Used as a section header for IDL property documentation */ + virtual QCString trPropertyDocumentation() + { + return decode("Повний перел╕к властивостей"); + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.4 +////////////////////////////////////////////////////////////////////////// + + /*! Used for Java interfaces in the summary section of Java packages */ + virtual QCString trInterfaces() + { + return decode("╤нтерфейси"); + } + /*! Used for Java classes in the summary section of Java packages */ + virtual QCString trClasses() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return decode( "Структури даних" ); + } + else + { + return decode( "Класи" ); + } + } + /*! Used as the title of a Java package */ + virtual QCString trPackage(const char *name) + { + return decode("Пакет ")+name; + } + /*! Title of the package index page */ + virtual QCString trPackageList() + { + return decode("Повний перел╕к пакет╕в"); + } + /*! The description of the package index page */ + virtual QCString trPackageListDescription() + { + return decode("Повний перел╕к документованих пакет╕в."); + } + /*! The link name in the Quick links header for each page */ + virtual QCString trPackages() + { + return decode("Пакети"); + } + /*! Used as a chapter title for Latex & RTF output */ + virtual QCString trPackageDocumentation() + { + return decode("Опис пакет╕в"); + } + /*! Text shown before a multi-line define */ + virtual QCString trDefineValue() + { + return decode("Макроозначення:"); + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.5 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a marker that is put before a \\bug item */ + virtual QCString trBug() + { + return decode("Дефект"); + } + /*! Used as the header of the bug list */ + virtual QCString trBugList() + { + return decode("Перел╕к дефект╕в"); + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.6 +////////////////////////////////////////////////////////////////////////// + /*! Used as ansicpg for RTF file */ + virtual QCString trRTFansicp() + { + return "1251"; + } + /*! Used as ansicpg for RTF fcharset */ + virtual QCString trRTFCharSet() + { + return "204"; + } + /*! Used as header RTF general index */ + virtual QCString trRTFGeneralIndex() + { + return decode("Предметний покажчик"); + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trClass(bool first_capital, bool singular) + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + QCString result((first_capital ? "Структури даних" : "структури даних")); + return decode(result); + } + else + { + QCString result((first_capital ? "Клас" : "клас")); + if(!singular) result+="и"; + return decode(result); + } + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trFile(bool first_capital, bool singular) + { + QCString result((first_capital ? "Файл" : "файл")); + if (!singular) result+="и"; + return decode(result); + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trNamespace(bool first_capital, bool singular) + { + QCString result((first_capital ? "Прост" : "прост")); + result+=(singular?"╕р ╕мен":"ори ╕мен"); + return decode(result); + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trGroup(bool first_capital, bool singular) + { + QCString result((first_capital ? "Груп" : "груп")); + result+=(singular ? "а" : "и"); + return decode(result); + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trPage(bool first_capital, bool singular) + { + QCString result((first_capital ? "Стор╕нк" : "стор╕нк")); + result+=(singular ? "а" : "и"); + return decode(result); + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trMember(bool first_capital, bool singular) + { + QCString result((first_capital ? "Елемент" : "елемент")); + if (!singular) result+="и"; + return decode(result); + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trField(bool first_capital, bool singular) + { + QCString result((first_capital ? "Пол" : "пол")); + result+=(singular ? "е" : "я"); + return decode(result); + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trGlobal(bool first_capital, bool singular) + { + QCString result((first_capital ? "Глобальн" : "глобальн")); + result+=(singular ? "ий" : "╕"); + return decode(result); + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.7 +////////////////////////////////////////////////////////////////////////// + + /*! This text is generated when the \\author command is used and + * for the author section in man pages. */ + virtual QCString trAuthor(bool first_capital, bool singular) + { + QCString result((first_capital ? "Автор" : "автор")); + if (!singular) result+="и"; + return decode(result); + } +}; + +#endif diff --git a/src/util.cpp b/src/util.cpp index 6a022af..52045cb 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1248,6 +1248,11 @@ static bool matchArgument(const Argument *srcA,const Argument *dstA, { if (!isspace(dstAType.at(dstPos))) // maybe the names differ { + if (!dstA->name.isEmpty()) // dst has its name separated from its type + { + NOMATCH + return FALSE; + } while (dstPos<dstAType.length() && isId(dstAType.at(dstPos))) dstPos++; if (dstPos!=dstAType.length()) { @@ -1270,6 +1275,11 @@ static bool matchArgument(const Argument *srcA,const Argument *dstA, { if (!isspace(srcAType.at(srcPos))) // maybe the names differ { + if (!srcA->name.isEmpty()) // src has its name separated from its type + { + NOMATCH + return FALSE; + } while (srcPos<srcAType.length() && isId(srcAType.at(srcPos))) srcPos++; if (srcPos!=srcAType.length()) { @@ -2860,7 +2870,7 @@ QCString substituteTemplateArgumentsInString( { if (formalArgs==0) return name; QCString result; - static QRegExp re("[a-z_A-Z][:a-z_A-Z0-9]*"); + static QRegExp re("[a-z_A-Z][a-z_A-Z0-9]*"); int p=0,l,i; // for each identifier in the base class name (e.g. B<T> -> B and T) while ((i=re.match(name,p,&l))!=-1) @@ -2901,4 +2911,90 @@ QCString substituteTemplateArgumentsInString( } +/*! Makes a deep copy of argument list \a src. Will allocate memory, that + * is owned by the caller. + */ +ArgumentList *copyArgumentList(const ArgumentList *src) +{ + ASSERT(src!=0); + ArgumentList *dst = new ArgumentList; + dst->setAutoDelete(TRUE); + ArgumentListIterator tali(*src); + Argument *a; + for (;(a=tali.current());++tali) + { + dst->append(new Argument(*a)); + } + dst->constSpecifier = src->constSpecifier; + dst->volatileSpecifier = src->volatileSpecifier; + dst->pureSpecifier = src->pureSpecifier; + return dst; +} + +/*! Makes a deep copy of the list of argument lists \a srcLists. + * Will allocate memory, that is owned by the caller. + */ +QList<ArgumentList> *copyArgumentLists(const QList<ArgumentList> *srcLists) +{ + ASSERT(srcLists!=0); + QList<ArgumentList> *dstLists = new QList<ArgumentList>; + dstLists->setAutoDelete(TRUE); + QListIterator<ArgumentList> sli(*srcLists); + ArgumentList *sl; + for (;(sl=sli.current());++sli) + { + dstLists->append(copyArgumentList(sl)); + } + return dstLists; +} + +/*! Strips template specifiers from scope \a fullName, except those + * that make up specialized classes. The switch \a parentOnly + * determines whether or not a template "at the end" of a scope + * should be considered, e.g. with \a parentOnly is \c TRUE, A<T>::B<S> will + * try to strip <T> and not <S>, while \a parentOnly is \c FALSE will + * strip both unless A<T> or B<S> are specialized template classes. + */ +QCString stripTemplateSpecifiersFromScope(const QCString &fullName, + bool parentOnly) +{ + QCString result; + int p=0; + int l=fullName.length(); + int i=fullName.find('<'); + int si= i==-1 ? -1 : fullName.find("::",i); + while (i!=-1 && (!parentOnly || i<si)) + { + result+=fullName.mid(p,i-p); + //printf("1:result+=%s\n",fullName.mid(p,i-p).data()); + int e=i+1; + bool done=FALSE; + int count=1; + while (e<l && !done) + { + char c=fullName.at(e++); + if (c=='<') + { + count++; + } + else if (c=='>') + { + count--; + done = count==0; + } + } + //printf(" trying %s\n",(result+fullName.mid(i,e-i)).data()); + if (getClass(result+fullName.mid(i,e-i))!=0) + { + result+=fullName.mid(i,e-i); + //printf("2:result+=%s\n",fullName.mid(i,e-i-1).data()); + } + p=e; + i=fullName.find('<',p); + si= i==-1 ? -1 : fullName.find("::",i); + } + result+=fullName.right(l-p); + //printf("3:result+=%s\n",fullName.right(l-p).data()); + return result; +} @@ -153,5 +153,10 @@ bool extractClassNameFromType(const QCString &type,int &pos, QCString substituteTemplateArgumentsInString( const QCString &name,ArgumentList *formalArgs,ArgumentList *actualArgs); +ArgumentList *copyArgumentList(const ArgumentList *src); +QList<ArgumentList> *copyArgumentLists(const QList<ArgumentList> *srcLists); +QCString stripTemplateSpecifiersFromScope(const QCString &fullName, + bool parentOnly=TRUE); + #endif diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp new file mode 100644 index 0000000..4bb20e0 --- /dev/null +++ b/src/xmlgen.cpp @@ -0,0 +1,500 @@ +/****************************************************************************** + * + * + * + * + * Copyright (C) 1997-2001 by Dimitri van Heesch. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software + * for any purpose. It is provided "as is" without express or implied warranty. + * See the GNU General Public License for more details. + * + * Documents produced by Doxygen are derivative works derived from the + * input used in their production; they are not affected by this license. + * + */ + +#include <stdlib.h> + +#include "qtbc.h" +#include "xmlgen.h" +#include "doxygen.h" +#include "message.h" +#include "config.h" +#include "classlist.h" +#include "util.h" +#include "defargs.h" + +#include <qdir.h> +#include <qfile.h> +#include <qtextstream.h> + +static void writeXMLString(QTextStream &t,const char *s) +{ + t << convertToXML(s); +} + +static void writeXMLLink(QTextStream &t,const char *compoundId,const char *memId, + const char *text) +{ + if (memId==0) + { + t << "<compoundref idref=\"" << compoundId << "\">"; + writeXMLString(t,text); + t << "</compoundref>"; + } + else + { + t << "<memberref idref=\"" << compoundId << "_1" << memId << "\">"; + writeXMLString(t,text); + t << "</memberref>"; + } +} + +class TextGeneratorXMLImpl : public TextGeneratorIntf +{ + public: + TextGeneratorXMLImpl(QTextStream &t): m_t(t) {} + void writeString(const char *s) const + { + writeXMLString(m_t,s); + } + void writeBreak() const {} + void writeLink(const char *extRef,const char *file, + const char *anchor,const char *text + ) const + { + if (extRef==0) + { writeXMLLink(m_t,file,anchor,text); } + else // external references are not supported for XML + { writeXMLString(m_t,text); } + } + private: + QTextStream &m_t; +}; + + +void generateXMLForMember(MemberDef *md,QTextStream &t,Definition *def) +{ + if (md->memberType()==MemberDef::EnumValue) return; + + QCString scopeName; + if (md->getClassDef()) + scopeName=md->getClassDef()->name(); + else if (md->getNamespaceDef()) + scopeName=md->getNamespaceDef()->name(); + + t << " <memberdef kind=\""; + //enum { define_t,variable_t,typedef_t,enum_t,function_t } xmlType = function_t; + QCString memType; + bool isFunc=FALSE; + switch (md->memberType()) + { + case MemberDef::Define: memType="define"; break; + case MemberDef::EnumValue: ASSERT(0); break; + case MemberDef::Property: memType="property"; break; + case MemberDef::Variable: memType="variable"; break; + case MemberDef::Typedef: memType="typedef"; break; + case MemberDef::Enumeration: memType="enum"; break; + case MemberDef::Function: memType="function"; isFunc=TRUE; break; + case MemberDef::Signal: memType="signal"; isFunc=TRUE; break; + case MemberDef::Prototype: memType="prototype"; isFunc=TRUE; break; + case MemberDef::Friend: memType="friend"; isFunc=TRUE; break; + case MemberDef::DCOP: memType="dcop"; isFunc=TRUE; break; + case MemberDef::Slot: memType="slot"; isFunc=TRUE; break; + } + t << memType << "\" id=\""; + t << def->getOutputFileBase() + << "_1" // encoded `:' character (see util.cpp:convertNameToFile) + << md->anchor(); + t << "\""; + t << " virt=\""; + switch (md->virtualness()) + { + case Normal: t << "normal"; break; + case Virtual: t << "virtual"; break; + case Pure: t << "pure-virtual"; break; + default: ASSERT(0); + } + t << "\" prot=\""; + switch(md->protection()) + { + case Public: t << "public"; break; + case Protected: t << "protected"; break; + case Private: t << "private"; break; + } + t << "\">" << endl; + + if (md->memberType()!=MemberDef::Define && + md->memberType()!=MemberDef::Enumeration + ) + { + QCString typeStr = replaceAnonymousScopes(md->typeString()); + t << " <type>"; + linkifyText(TextGeneratorXMLImpl(t),scopeName,md->name(),typeStr); + t << "</type>" << endl; + } + + t << " <name>"; + writeXMLString(t,md->name()); + t << "</name>" << endl; + if (isFunc) //function + { + ArgumentList *declAl = new ArgumentList; + ArgumentList *defAl = md->argumentList(); + stringToArgumentList(md->argsString(),declAl); + if (declAl->count()>0) + { + ArgumentListIterator declAli(*declAl); + ArgumentListIterator defAli(*defAl); + Argument *a; + for (declAli.toFirst();(a=declAli.current());++declAli) + { + Argument *defArg = defAli.current(); + t << " <param>" << endl; + if (!a->attrib.isEmpty()) + { + t << " <attributes>"; + writeXMLString(t,a->attrib); + t << "</attributes>" << endl; + } + if (!a->type.isEmpty()) + { + t << " <type>"; + linkifyText(TextGeneratorXMLImpl(t),scopeName,md->name(),a->type); + t << "</type>" << endl; + } + if (!a->name.isEmpty()) + { + t << " <declname>"; + writeXMLString(t,a->name); + t << "</declname>" << endl; + } + if (defArg && !defArg->name.isEmpty() && defArg->name!=a->name) + { + t << " <defname>"; + writeXMLString(t,defArg->name); + t << "</defname>" << endl; + } + if (!a->array.isEmpty()) + { + t << " <array>"; + writeXMLString(t,a->array); + t << "</array>" << endl; + } + if (!a->defval.isEmpty()) + { + t << " <defval>"; + linkifyText(TextGeneratorXMLImpl(t),scopeName,md->name(),a->defval); + t << "</defval>" << endl; + } + t << " </param>" << endl; + if (defArg) ++defAli; + } + } + delete declAl; + } + else if (md->memberType()==MemberDef::Define && + md->argsString()!=0) // define + { + ArgumentListIterator ali(*md->argumentList()); + Argument *a; + for (ali.toFirst();(a=ali.current());++ali) + { + t << " <param><defname>" << a->type << "</defname></param>" << endl; + } + } + if (!md->initializer().isEmpty()) + { + t << " <initializer>"; + linkifyText(TextGeneratorXMLImpl(t),scopeName,md->name(),md->initializer()); + t << "</initializer>" << endl; + } + // TODO: exceptions, const volatile + if (md->memberType()==MemberDef::Enumeration) // enum + { + if (md->enumFieldList()) + { + MemberListIterator emli(*md->enumFieldList()); + MemberDef *emd; + for (emli.toFirst();(emd=emli.current());++emli) + { + t << " <enumvalue>" << endl; + t << " <name>"; + writeXMLString(t,emd->name()); + t << "</name>" << endl; + if (!emd->initializer().isEmpty()) + { + t << " <initializer>"; + writeXMLString(t,emd->initializer()); + t << "</initializer>" << endl; + } + t << " </enumvalue>" << endl; + } + } + } + t << " </memberdef>" << endl; +} + + +void generateXMLClassSection(ClassDef *cd,QTextStream &t,MemberList *ml,const char *kind) +{ + if (ml->count()>0) + { + t << " <sectiondef kind=\"" << kind << "\">" << endl; + //t << " <memberlist>" << endl; + MemberListIterator mli(*ml); + MemberDef *md; + for (mli.toFirst();(md=mli.current());++mli) + { + generateXMLForMember(md,t,cd); + } + //t << " </memberlist>" << endl; + t << " </sectiondef>" << endl; + } +} + +void generateXMLForClass(ClassDef *cd,QTextStream &t) +{ + // brief description + // detailed description + // template arguments + // include files + // inheritance diagram + // list of direct super classes + // list of direct sub classes + // collaboration diagram + // list of all members + // user defined member sections + // standard member sections + // detailed documentation + // detailed member documentation + + if (cd->name().find('@')!=-1) return; // skip anonymous compounds + t << " <compounddef id=\"" + << cd->getOutputFileBase() << "\" kind=\"" + << cd->compoundTypeString() << "\">" << endl; + t << " <compoundname>"; + writeXMLString(t,cd->name()); + t << "</compoundname>" << endl; + if (cd->baseClasses()->count()>0) + { + //t << " <basecompoundlist>" << endl; + BaseClassListIterator bcli(*cd->baseClasses()); + BaseClassDef *bcd; + for (bcli.toFirst();(bcd=bcli.current());++bcli) + { + t << " <basecompoundref idref=\"" + << bcd->classDef->getOutputFileBase() + << "\" prot=\""; + switch (bcd->prot) + { + case Public: t << "public"; break; + case Protected: t << "protected"; break; + case Private: t << "private"; break; + } + t << "\" virt=\""; + switch(bcd->virt) + { + case Normal: t << "non-virtual"; break; + case Virtual: t << "virtual"; break; + case Pure: t <<"pure-virtual"; break; + } + t << "\"/>" << endl; + } + //t << " </basecompoundlist>" << endl; + } + if (cd->subClasses()->count()>0) + { + //t << " <derivedcompoundlist>" << endl; + BaseClassListIterator bcli(*cd->subClasses()); + BaseClassDef *bcd; + for (bcli.toFirst();(bcd=bcli.current());++bcli) + { + t << " <derivedcompoundref idref=\"" + << bcd->classDef->getOutputFileBase() + << "\" prot=\""; + switch (bcd->prot) + { + case Public: t << "public"; break; + case Protected: t << "protected"; break; + case Private: t << "private"; break; + } + t << "\" virt=\""; + switch(bcd->virt) + { + case Normal: t << "non-virtual"; break; + case Virtual: t << "virtual"; break; + case Pure: t << "pure-virtual"; break; + } + t << "\"/>" << endl; + } + //t << " </derivedcompoundlist>" << endl; + } + int numMembers = + cd->pubTypes.count()+cd->pubMembers.count()+cd->pubAttribs.count()+ + cd->pubSlots.count()+cd->signals.count()+cd->dcopMethods.count()+ + cd->pubStaticMembers.count()+ + cd->pubStaticAttribs.count()+cd->proTypes.count()+cd->proMembers.count()+ + cd->proAttribs.count()+cd->proSlots.count()+cd->proStaticMembers.count()+ + cd->proStaticAttribs.count()+cd->priTypes.count()+cd->priMembers.count()+ + cd->priAttribs.count()+cd->priSlots.count()+cd->priStaticMembers.count()+ + cd->priStaticAttribs.count()+cd->friends.count()+cd->related.count(); + if (numMembers>0) + { + //t << " <sectionlist>" << endl; + generateXMLClassSection(cd,t,&cd->pubTypes,"public-type"); + generateXMLClassSection(cd,t,&cd->pubMembers,"public-func"); + generateXMLClassSection(cd,t,&cd->pubAttribs,"public-attrib"); + generateXMLClassSection(cd,t,&cd->pubSlots,"public-slot"); + generateXMLClassSection(cd,t,&cd->signals,"signal"); + generateXMLClassSection(cd,t,&cd->dcopMethods,"dcop-func"); + generateXMLClassSection(cd,t,&cd->properties,"property"); + generateXMLClassSection(cd,t,&cd->pubStaticMembers,"public-static-func"); + generateXMLClassSection(cd,t,&cd->pubStaticAttribs,"public-static-attrib"); + generateXMLClassSection(cd,t,&cd->proTypes,"protected-type"); + generateXMLClassSection(cd,t,&cd->proMembers,"protected-func"); + generateXMLClassSection(cd,t,&cd->proAttribs,"protected-attrib"); + generateXMLClassSection(cd,t,&cd->proSlots,"protected-slot"); + generateXMLClassSection(cd,t,&cd->proStaticMembers,"protected-static-func"); + generateXMLClassSection(cd,t,&cd->proStaticAttribs,"protected-static-attrib"); + generateXMLClassSection(cd,t,&cd->priTypes,"private-type"); + generateXMLClassSection(cd,t,&cd->priMembers,"private-func"); + generateXMLClassSection(cd,t,&cd->priAttribs,"private-attrib"); + generateXMLClassSection(cd,t,&cd->priSlots,"private-slot"); + generateXMLClassSection(cd,t,&cd->priStaticMembers,"private-static-func"); + generateXMLClassSection(cd,t,&cd->priStaticAttribs,"private-static-attrib"); + generateXMLClassSection(cd,t,&cd->friends,"signal"); + generateXMLClassSection(cd,t,&cd->related,"related"); + //t << " </sectionlist>" << endl; + } + t << " </compounddef>" << endl; +} + +void generateXMLFileSection(FileDef *fd,QTextStream &t,MemberList *ml,const char *kind) +{ + if (ml->count()>0) + { + t << " <sectiondef kind=\"" << kind << "\">" << endl; + //t << " <memberlist>" << endl; + MemberListIterator mli(*ml); + MemberDef *md; + for (mli.toFirst();(md=mli.current());++mli) + { + generateXMLForMember(md,t,fd); + } + //t << " </memberlist>" << endl; + t << " </sectiondef>" << endl; + } +} + +void generateXMLForFile(FileDef *fd,QTextStream &t) +{ + t << " <compounddef id=\"" + << fd->getOutputFileBase() << "\" kind=\"file\">" << endl; + t << " <compoundname>"; + writeXMLString(t,fd->name()); + t << "</compoundname>" << endl; + int numMembers = fd->decDefineMembers.count()+fd->decProtoMembers.count()+ + fd->decTypedefMembers.count()+fd->decEnumMembers.count()+ + fd->decFuncMembers.count()+fd->decVarMembers.count(); + if (numMembers>0) + { + //t << " <sectionlist>" << endl; + generateXMLFileSection(fd,t,&fd->decDefineMembers,"define"); + generateXMLFileSection(fd,t,&fd->decProtoMembers,"prototype"); + generateXMLFileSection(fd,t,&fd->decTypedefMembers,"typedef"); + generateXMLFileSection(fd,t,&fd->decEnumMembers,"enum"); + generateXMLFileSection(fd,t,&fd->decFuncMembers,"func"); + generateXMLFileSection(fd,t,&fd->decVarMembers,"var"); + //t << " </sectionlist>" << endl; + } + t << " </compounddef>" << endl; +} + + +void generateXML() +{ + QCString outputDirectory = Config_getString("OUTPUT_DIRECTORY"); + if (outputDirectory.isEmpty()) + { + outputDirectory=QDir::currentDirPath(); + } + else + { + QDir dir(outputDirectory); + if (!dir.exists()) + { + dir.setPath(QDir::currentDirPath()); + if (!dir.mkdir(outputDirectory)) + { + err("Error: tag OUTPUT_DIRECTORY: Output directory `%s' does not " + "exist and cannot be created\n",outputDirectory.data()); + exit(1); + } + else if (!Config_getBool("QUIET")) + { + err("Notice: Output directory `%s' does not exist. " + "I have created it for you.\n", outputDirectory.data()); + } + dir.cd(outputDirectory); + } + outputDirectory=dir.absPath(); + } + + QDir dir(outputDirectory); + if (!dir.exists()) + { + dir.setPath(QDir::currentDirPath()); + if (!dir.mkdir(outputDirectory)) + { + err("Cannot create directory %s\n",outputDirectory.data()); + return; + } + } + QDir xmlDir(outputDirectory+"/xml"); + if (!xmlDir.exists() && !xmlDir.mkdir(outputDirectory+"/xml")) + { + err("Could not create xml directory in %s\n",outputDirectory.data()); + return; + } + + QCString fileName=outputDirectory+"/xml/doxygen.xml"; + QFile f(fileName); + if (!f.open(IO_WriteOnly)) + { + err("Cannot open file %s for writing!\n",fileName.data()); + return; + } + QTextStream t(&f); + t << "<?xml version='1.0' encoding='ISO-8859-1' standalone='yes'?>" << endl; + //t << "<!DOCTYPE doxygen SYSTEM \"doxygen.dtd\">" << endl; + t << "<doxygen>" << endl; + if (Doxygen::classSDict.count()+Doxygen::inputNameList.count()>0) + { + //t << " <compoundlist>" << endl; + ClassSDict::Iterator cli(Doxygen::classSDict); + ClassDef *cd; + for (cli.toFirst();(cd=cli.current());++cli) + { + generateXMLForClass(cd,t); + } + FileNameListIterator fnli(Doxygen::inputNameList); + FileName *fn; + for (;(fn=fnli.current());++fnli) + { + FileNameIterator fni(*fn); + FileDef *fd; + for (;(fd=fni.current());++fni) + { + generateXMLForFile(fd,t); + } + } + //t << " </compoundlist>" << endl; + } + t << "</doxygen>" << endl; +} + + diff --git a/src/xmlgen.h b/src/xmlgen.h new file mode 100644 index 0000000..c762d29 --- /dev/null +++ b/src/xmlgen.h @@ -0,0 +1,20 @@ +/****************************************************************************** + * + * + * + * Copyright (C) 1997-2001 by Dimitri van Heesch. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software + * for any purpose. It is provided "as is" without express or implied warranty. + * See the GNU General Public License for more details. + * + */ + +#ifndef XMLGEN_H +#define XMLGEN_H + +void generateXML(); + +#endif |