diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2002-07-07 17:23:26 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2002-07-07 17:23:26 (GMT) |
commit | bcbf69496a8e7e703ecf4fb6e5de264f86ebea84 (patch) | |
tree | f08f27e02ce20e8ca59117d6d02be98fbe3c8c24 /src/doxygen.cpp | |
parent | 46570cfd109829f87a17c46e32006f901b9026f4 (diff) | |
download | Doxygen-bcbf69496a8e7e703ecf4fb6e5de264f86ebea84.zip Doxygen-bcbf69496a8e7e703ecf4fb6e5de264f86ebea84.tar.gz Doxygen-bcbf69496a8e7e703ecf4fb6e5de264f86ebea84.tar.bz2 |
Release-1.2.16-20020707
Diffstat (limited to 'src/doxygen.cpp')
-rw-r--r-- | src/doxygen.cpp | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/doxygen.cpp b/src/doxygen.cpp index e6951fe..90b1ab2 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -1441,6 +1441,56 @@ static int findFunctionPtr(const QCString &type,int *pLength=0) } } + +/*! Returns TRUE iff \a type is a class within scope \a context. + * Used to detect variable declarations that look like function prototypes. + */ +static bool isVarWithConstructor(Entry *root) +{ + static QRegExp initChars("[0-9\"'&*!^]+"); + static QRegExp idChars("[a-z_A-Z][a-z_A-Z0-9]*"); + if (root->type.isEmpty()) return FALSE; + Definition *ctx = 0; + //printf("isVarWithConstructor(%s,%s)\n",root->parent->name.data(), + // root->type.data()); + if (root->parent->name) ctx=Doxygen::namespaceSDict.find(root->parent->name); + bool typeIsClass=getResolvedClass(ctx,root->type)!=0; + if (typeIsClass) // now we still have to check if the arguments are + // types or values. Since we do not have complete type info + // we need to rely on heuristics :-( + { + //printf("typeIsClass\n"); + ArgumentList *al = root->argList; + if (al==0) return FALSE; // empty arg list -> function prototype. + ArgumentListIterator ali(*al); + Argument *a; + for (ali.toFirst();(a=ali.current());++ali) + { + //printf("a->name=%s a->type=%s\n",a->name.data(),a->type.data()); + if (!a->name.isEmpty() || !a->defval.isEmpty()) return FALSE; // arg has (type,name) pair -> function prototype + if (a->type.isEmpty() || getResolvedClass(ctx,a->type)!=0) return FALSE; // arg type is a known type + if (a->type.find(initChars)==0) return TRUE; // argument type starts with typical initializer char + QCString resType=resolveTypeDef(ctx,a->type); + if (resType.isEmpty()) resType=a->type; + int len; + if (idChars.match(resType,0,&len)==0) // resType starts with identifier + { + resType=resType.left(len); + //printf("resType=%s\n",resType.data()); + if (resType=="int" || resType=="long" || resType=="float" || + resType=="double" || resType=="char" || resType=="signed" || + resType=="const" || resType=="unsigned") + { + return FALSE; // type keyword -> function prototype + } + } + } + return TRUE; + } + // return type not a class -> function prototype + return FALSE; +} + //---------------------------------------------------------------------- // Searches the Entry tree for Variable documentation sections. // If found they are stored in their class or in the global list. @@ -1454,6 +1504,9 @@ void buildVarList(Entry *root) ) || (root->section==Entry::FUNCTION_SEC && // or maybe a function pointer variable findFunctionPtr(root->type)!=-1 + ) || + (root->section==Entry::FUNCTION_SEC && // class variable initialized by constructor + isVarWithConstructor(root) ) ) ) // documented variable @@ -7662,5 +7715,16 @@ void generateOutput() msg("Generating AutoGen DEF output...\n"); generateDEF(); } + if (Config_getBool("GENERATE_HTMLHELP") && !Config_getString("HHC_LOCATION").isEmpty()) + { + msg("Running html help compiler...\n"); + QString oldDir = QDir::currentDirPath(); + QDir::setCurrent(Config_getString("HTML_OUTPUT")); + if (iSystem(Config_getString("HHC_LOCATION"), "index.hhp", FALSE)) + { + err("Error: failed to run html help compiler on index.hhp"); + } + QDir::setCurrent(oldDir); + } } |