Commit 5d31b7ab authored by dimitri's avatar dimitri

Release-1.4.2-20050421

parent 76e39987
DOXYGEN Version 1.4.2-20050410 DOXYGEN Version 1.4.2-20050421
Please read the installation section of the manual Please read the installation section of the manual
(http://www.doxygen.org/install.html) for instructions. (http://www.doxygen.org/install.html) for instructions.
-------- --------
Dimitri van Heesch (10 April 2005) Dimitri van Heesch (21 April 2005)
DOXYGEN Version 1.4.2_20050410 DOXYGEN Version 1.4.2_20050421
Please read INSTALL for compilation instructions. Please read INSTALL for compilation instructions.
...@@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives. ...@@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives.
Enjoy, Enjoy,
Dimitri van Heesch (dimitri@stack.nl) (10 April 2005) Dimitri van Heesch (dimitri@stack.nl) (21 April 2005)
1.4.2-20050410 1.4.2-20050421
...@@ -857,8 +857,9 @@ FILE_VERSION_INFO = "cleartool desc -fmt \%Vn" ...@@ -857,8 +857,9 @@ FILE_VERSION_INFO = "cleartool desc -fmt \%Vn"
<dt>\c FILTER_SOURCE_FILES <dd> <dt>\c FILTER_SOURCE_FILES <dd>
\addindex FILTER_SOURCE_FILES \addindex FILTER_SOURCE_FILES
If the \c FILTER_SOURCE_FILES tag is set to \c YES, the input filter (if set using If the \c FILTER_SOURCE_FILES tag is set to \c YES, the input filter (if set using
\c INPUT_FILTER ) will be used to filter the input files when producing source \ref cfg_input_filter "INPUT_FILTER" ) will also be used to filter the input
files to browse. files that are used for producing the source files to browse
(i.e. when SOURCE_BROWSER is set to YES).
</dl> </dl>
......
...@@ -23,7 +23,7 @@ text fragments, generated by doxygen, can be produced in languages other ...@@ -23,7 +23,7 @@ text fragments, generated by doxygen, can be produced in languages other
than English (the default). The output language is chosen through the than English (the default). The output language is chosen through the
configuration file (with default name and known as Doxyfile). configuration file (with default name and known as Doxyfile).
Currently (version 1.4.2), 31 languages Currently (version 1.4.2-20050410), 31 languages
are supported (sorted alphabetically): are supported (sorted alphabetically):
Afrikaans, Brazilian Portuguese, Catalan, Chinese, Chinese Afrikaans, Brazilian Portuguese, Catalan, Chinese, Chinese
Traditional, Croatian, Czech, Danish, Dutch, English, Finnish, French, Traditional, Croatian, Czech, Danish, Dutch, English, Finnish, French,
...@@ -138,7 +138,7 @@ when the translator was updated. ...@@ -138,7 +138,7 @@ when the translator was updated.
<td>Hungarian</td> <td>Hungarian</td>
<td>&Aacute;kos Kiss<br>F&ouml;ldv&aacute;ri Gy&ouml;rgy</td> <td>&Aacute;kos Kiss<br>F&ouml;ldv&aacute;ri Gy&ouml;rgy</td>
<td>akiss at users dot sourceforge dot net<br>foldvari lost at cyberspace</td> <td>akiss at users dot sourceforge dot net<br>foldvari lost at cyberspace</td>
<td>1.4.1</td> <td>up-to-date</td>
</tr> </tr>
<tr bgcolor="#ffffff"> <tr bgcolor="#ffffff">
<td>Indonesian</td> <td>Indonesian</td>
...@@ -168,7 +168,7 @@ when the translator was updated. ...@@ -168,7 +168,7 @@ when the translator was updated.
<td>Korean</td> <td>Korean</td>
<td>SooYoung Jung<br>Richard Kim</td> <td>SooYoung Jung<br>Richard Kim</td>
<td>jung5000 at gmail dot com<br>ryk at dspwiz dot com</td> <td>jung5000 at gmail dot com<br>ryk at dspwiz dot com</td>
<td>1.4.1</td> <td>up-to-date</td>
</tr> </tr>
<tr bgcolor="#ffffff"> <tr bgcolor="#ffffff">
<td>KoreanEn</td> <td>KoreanEn</td>
...@@ -294,7 +294,7 @@ when the translator was updated. ...@@ -294,7 +294,7 @@ when the translator was updated.
\hline \hline
Greek & Harry Kalogirou & {\tt\tiny harkal@rainbow.cs.unipi.gr} & 1.2.11 \\ Greek & Harry Kalogirou & {\tt\tiny harkal@rainbow.cs.unipi.gr} & 1.2.11 \\
\hline \hline
Hungarian & \'{A}kos Kiss & {\tt\tiny akiss@users.sourceforge.net} & 1.4.1 \\ Hungarian & \'{A}kos Kiss & {\tt\tiny akiss@users.sourceforge.net} & up-to-date \\
~ & F\"{o}ldv\'{a}ri Gy\"{o}rgy & {\tt\tiny foldvari lost@cyberspace} & ~ \\ ~ & F\"{o}ldv\'{a}ri Gy\"{o}rgy & {\tt\tiny foldvari lost@cyberspace} & ~ \\
\hline \hline
Indonesian & Hendy Irawan & {\tt\tiny ceefour@gauldong.net} & up-to-date \\ Indonesian & Hendy Irawan & {\tt\tiny ceefour@gauldong.net} & up-to-date \\
...@@ -308,7 +308,7 @@ when the translator was updated. ...@@ -308,7 +308,7 @@ when the translator was updated.
\hline \hline
JapaneseEn & see the Japanese language & {\tt\tiny ~} & English based \\ JapaneseEn & see the Japanese language & {\tt\tiny ~} & English based \\
\hline \hline
Korean & SooYoung Jung & {\tt\tiny jung5000@gmail.com} & 1.4.1 \\ Korean & SooYoung Jung & {\tt\tiny jung5000@gmail.com} & up-to-date \\
~ & Richard Kim & {\tt\tiny ryk@dspwiz.com} & ~ \\ ~ & Richard Kim & {\tt\tiny ryk@dspwiz.com} & ~ \\
\hline \hline
KoreanEn & see the Korean language & {\tt\tiny ~} & English based \\ KoreanEn & see the Korean language & {\tt\tiny ~} & English based \\
......
...@@ -28,7 +28,7 @@ So if you have the following code fragment ...@@ -28,7 +28,7 @@ So if you have the following code fragment
#define VERSION 200 #define VERSION 200
#define CONST_STRING const char * #define CONST_STRING const char *
#if VERSION < 200 #if VERSION >= 200
static CONST_STRING version = "2.xx"; static CONST_STRING version = "2.xx";
#else #else
static CONST_STRING version = "1.xx"; static CONST_STRING version = "1.xx";
......
(1.4.2) (1.4.2-20050410)
Doxygen supports the following 31 languages (sorted alphabetically): Doxygen supports the following 31 languages (sorted alphabetically):
...@@ -8,7 +8,7 @@ German, Greek, Hungarian, Indonesian, Italian, Japanese (+En), Korean ...@@ -8,7 +8,7 @@ German, Greek, Hungarian, Indonesian, Italian, Japanese (+En), Korean
(+En), Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, (+En), Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian,
Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.
Of them, 10 translators are up-to-date, 21 translators are based on Of them, 12 translators are up-to-date, 19 translators are based on
some adapter class, and 2 are English based. some adapter class, and 2 are English based.
---------------------------------------------------------------------- ----------------------------------------------------------------------
...@@ -23,8 +23,10 @@ still may be some details listed even for them: ...@@ -23,8 +23,10 @@ still may be some details listed even for them:
TranslatorDutch -- Remove the obsolete methods (never used). TranslatorDutch -- Remove the obsolete methods (never used).
TranslatorEnglish -- Remove the obsolete methods (never used). TranslatorEnglish -- Remove the obsolete methods (never used).
TranslatorGerman -- Remove the obsolete methods (never used). TranslatorGerman -- Remove the obsolete methods (never used).
TranslatorHungarian
TranslatorIndonesian -- Remove the obsolete methods (never used). TranslatorIndonesian -- Remove the obsolete methods (never used).
TranslatorItalian TranslatorItalian
TranslatorKorean
TranslatorRussian TranslatorRussian
TranslatorSwedish TranslatorSwedish
...@@ -38,8 +40,6 @@ must be implemented to become up-to-date: ...@@ -38,8 +40,6 @@ must be implemented to become up-to-date:
TranslatorSerbian 1.4.1 1 method to implement TranslatorSerbian 1.4.1 1 method to implement
TranslatorRomanian 1.4.1 1 method to implement TranslatorRomanian 1.4.1 1 method to implement
TranslatorPolish 1.4.1 1 method to implement TranslatorPolish 1.4.1 1 method to implement
TranslatorKorean 1.4.1 1 method to implement
TranslatorHungarian 1.4.1 1 method to implement
TranslatorFrench 1.4.1 1 method to implement TranslatorFrench 1.4.1 1 method to implement
TranslatorChinese 1.4.1 1 method to implement TranslatorChinese 1.4.1 1 method to implement
TranslatorCatalan 1.4.1 1 method to implement TranslatorCatalan 1.4.1 1 method to implement
...@@ -454,29 +454,6 @@ TranslatorGreek (TranslatorAdapter_1_2_11) 26 methods to implement ...@@ -454,29 +454,6 @@ TranslatorGreek (TranslatorAdapter_1_2_11) 26 methods to implement
virtual QCString trNoDescriptionAvailable() virtual QCString trNoDescriptionAvailable()
TranslatorHungarian (TranslatorAdapter_1_4_1) 1 method to implement
-------------------
Implements 191 of the required methods.
Missing methods (should be implemented):
virtual QCString trOverloadText()
Obsolete methods (should be removed, never used):
QCString trHeaderFilesDescription()
virtual QCString trField(bool first_capital, bool/*singular*/)
virtual QCString trPackageDocumentation()
QCString trSources()
QCString trReimplementedForInternalReasons()
virtual QCString trInterfaces()
QCString trHeaderFiles()
QCString trBugsAndLimitations()
QCString trEnumerationValueDocumentation()
QCString trNoDescriptionAvailable()
TranslatorIndonesian (Translator) TranslatorIndonesian (Translator)
-------------------- --------------------
...@@ -485,7 +462,7 @@ TranslatorIndonesian (Translator) ...@@ -485,7 +462,7 @@ TranslatorIndonesian (Translator)
Obsolete methods (should be removed, never used): Obsolete methods (should be removed, never used):
virtual QCString trHeaderFilesDescription() virtual QCString trHeaderFilesDescription()
virtual QCString trField(bool first_capital, bool singular) virtual QCString trField(bool first_capital, bool)
virtual QCString trPackageDocumentation() virtual QCString trPackageDocumentation()
virtual QCString trSources() virtual QCString trSources()
virtual QCString trReimplementedForInternalReasons() virtual QCString trReimplementedForInternalReasons()
...@@ -539,16 +516,6 @@ TranslatorJapaneseEn (TranslatorEnglish) 187 methods to implement ...@@ -539,16 +516,6 @@ TranslatorJapaneseEn (TranslatorEnglish) 187 methods to implement
virtual QCString latexLanguageSupportCommand() virtual QCString latexLanguageSupportCommand()
TranslatorKorean (TranslatorAdapter_1_4_1) 1 method to implement
----------------
Implements 191 of the required methods.
Missing methods (should be implemented):
virtual QCString trOverloadText()
TranslatorKoreanEn (TranslatorEnglish) 187 methods to implement TranslatorKoreanEn (TranslatorEnglish) 187 methods to implement
------------------ ------------------
......
Summary: A documentation system for C/C++. Summary: A documentation system for C/C++.
Name: doxygen Name: doxygen
Version: 1.4.2_20050410 Version: 1.4.2_20050421
Release: 1 Release: 1
Epoch: 1 Epoch: 1
Source0: ftp://ftp.stack.nl/pub/users/dimitri/%{name}-%{version}.src.tar.gz Source0: ftp://ftp.stack.nl/pub/users/dimitri/%{name}-%{version}.src.tar.gz
......
...@@ -71,9 +71,20 @@ public: ...@@ -71,9 +71,20 @@ public:
void resize( uint n ) { QGDict::resize(n); } void resize( uint n ) { QGDict::resize(n); }
void statistics() const { QGDict::statistics(); } void statistics() const { QGDict::statistics(); }
private: private:
void deleteItem( Item d ) { if ( del_item ) delete (type *)d; } void deleteItem( Item d );
}; };
#if defined(Q_DELETING_VOID_UNDEFINED)
template<> inline void QAsciiDict<void>::deleteItem( Item )
{
}
#endif
template<class type> inline void QAsciiDict<type>::deleteItem( QCollection::Item d )
{
if ( del_item ) delete (type *)d;
}
template<class type> class Q_EXPORT QAsciiDictIterator : public QGDictIterator template<class type> class Q_EXPORT QAsciiDictIterator : public QGDictIterator
{ {
......
...@@ -42,6 +42,9 @@ ...@@ -42,6 +42,9 @@
#include "qgcache.h" #include "qgcache.h"
#endif // QT_H #endif // QT_H
#define USE_ASCII_STRING
#ifndef USE_ASCII_STRING
template<class type> class Q_EXPORT QCache : public QGCache template<class type> class Q_EXPORT QCache : public QGCache
{ {
...@@ -74,6 +77,43 @@ private: ...@@ -74,6 +77,43 @@ private:
void deleteItem( Item d ) { if ( del_item ) delete (type *)d; } void deleteItem( Item d ) { if ( del_item ) delete (type *)d; }
}; };
#else
template<class type> class Q_EXPORT QCache : public QGCache
{
public:
QCache( const QCache<type> &c ) : QGCache(c) {}
QCache( int maxCost=100, int size=17, bool caseSensitive=TRUE )
: QGCache( maxCost, size, AsciiKey, caseSensitive, TRUE ) {}
~QCache() { clear(); }
QCache<type> &operator=( const QCache<type> &c )
{ return (QCache<type>&)QGCache::operator=(c); }
int maxCost() const { return QGCache::maxCost(); }
int totalCost() const { return QGCache::totalCost(); }
void setMaxCost( int m ) { QGCache::setMaxCost(m); }
uint count() const { return QGCache::count(); }
uint size() const { return QGCache::size(); }
bool isEmpty() const { return QGCache::count() == 0; }
void clear() { QGCache::clear(); }
bool insert( const char *k, const type *d, int c=1, int p=0 )
{ return QGCache::insert_other(k,(Item)d,c,p);}
bool remove( const char *k )
{ return QGCache::remove_other(k); }
type *take( const char *k )
{ return (type *)QGCache::take_ascii(k); }
type *find( const char *k, bool ref=TRUE ) const
{ return (type *)QGCache::find_other(k,ref);}
type *operator[]( const char *k ) const
{ return (type *)QGCache::find_other(k);}
void statistics() const { QGCache::statistics(); }
private:
void deleteItem( Item d ) { if ( del_item ) delete (type *)d; }
};
#endif
template<class type> class Q_EXPORT QCacheIterator : public QGCacheIterator template<class type> class Q_EXPORT QCacheIterator : public QGCacheIterator
...@@ -92,7 +132,11 @@ public: ...@@ -92,7 +132,11 @@ public:
type *toLast() { return (type *)QGCacheIterator::toLast(); } type *toLast() { return (type *)QGCacheIterator::toLast(); }
operator type *() const { return (type *)QGCacheIterator::get(); } operator type *() const { return (type *)QGCacheIterator::get(); }
type *current() const { return (type *)QGCacheIterator::get(); } type *current() const { return (type *)QGCacheIterator::get(); }
#ifndef USE_ASCII_STRING
QString currentKey() const{ return QGCacheIterator::getKeyString(); } QString currentKey() const{ return QGCacheIterator::getKeyString(); }
#else
const char *currentKey() const{ return QGCacheIterator::getKeyAscii(); }
#endif
type *operator()() { return (type *)QGCacheIterator::operator()();} type *operator()() { return (type *)QGCacheIterator::operator()();}
type *operator++() { return (type *)QGCacheIterator::operator++(); } type *operator++() { return (type *)QGCacheIterator::operator++(); }
type *operator+=(uint j) { return (type *)QGCacheIterator::operator+=(j);} type *operator+=(uint j) { return (type *)QGCacheIterator::operator+=(j);}
......
...@@ -42,6 +42,15 @@ ...@@ -42,6 +42,15 @@
#include "qgdict.h" #include "qgdict.h"
#endif // QT_H #endif // QT_H
#define USE_ASCII_STRING
#ifdef USE_ASCII_STRING
#define QAsciiDict QDict
#define QAsciiDictIterator QDictIterator
#include "qasciidict.h"
#else
template<class type> class Q_EXPORT QDict : public QGDict template<class type> class Q_EXPORT QDict : public QGDict
{ {
...@@ -102,5 +111,6 @@ public: ...@@ -102,5 +111,6 @@ public:
type *operator+=(uint j) { return (type *)QGDictIterator::operator+=(j);} type *operator+=(uint j) { return (type *)QGDictIterator::operator+=(j);}
}; };
#endif // USE_ASCII_STRING
#endif // QDICT_H #endif // QDICT_H
...@@ -175,7 +175,11 @@ bool QFile::open( int m ) ...@@ -175,7 +175,11 @@ bool QFile::open( int m )
} }
#if defined(HAS_TEXT_FILEMODE) #if defined(HAS_TEXT_FILEMODE)
if ( isTranslated() ) if ( isTranslated() )
#ifdef __CYGWIN__
/* Do nothing, allowing the Cygwin mount mode to take effect. */;
#else
oflags |= OPEN_TEXT; oflags |= OPEN_TEXT;
#endif
else else
oflags |= OPEN_BINARY; oflags |= OPEN_BINARY;
#endif #endif
...@@ -214,7 +218,11 @@ bool QFile::open( int m ) ...@@ -214,7 +218,11 @@ bool QFile::open( int m )
qstrcpy( perm2, perm ); qstrcpy( perm2, perm );
#if defined(HAS_TEXT_FILEMODE) #if defined(HAS_TEXT_FILEMODE)
if ( isTranslated() ) if ( isTranslated() )
#ifdef __CYGWIN__
/* Do nothing, allowing the Cygwin mount mode to take effect. */;
#else
strcat( perm2, "t" ); strcat( perm2, "t" );
#endif
else else
strcat( perm2, "b" ); strcat( perm2, "b" );
#endif #endif
......
...@@ -92,16 +92,17 @@ int QGDict::hashKeyString( const QString &key ) ...@@ -92,16 +92,17 @@ int QGDict::hashKeyString( const QString &key )
int i; int i;
register uint h=0; register uint h=0;
uint g; uint g;
int len = key.length();
const QChar *p = key.unicode(); const QChar *p = key.unicode();
if ( cases ) { // case sensitive if ( cases ) { // case sensitive
for ( i=0; i<(int)key.length(); i++ ) { for ( i=0; i<len; i++ ) {
h = (h<<4) + p[i].cell(); h = (h<<4) + p[i].cell();
if ( (g = h & 0xf0000000) ) if ( (g = h & 0xf0000000) )
h ^= g >> 24; h ^= g >> 24;
h &= ~g; h &= ~g;
} }
} else { // case insensitive } else { // case insensitive
for ( i=0; i<(int)key.length(); i++ ) { for ( i=0; i<len; i++ ) {
h = (h<<4) + p[i].lower().cell(); h = (h<<4) + p[i].lower().cell();
if ( (g = h & 0xf0000000) ) if ( (g = h & 0xf0000000) )
h ^= g >> 24; h ^= g >> 24;
...@@ -123,7 +124,10 @@ int QGDict::hashKeyAscii( const char *key ) ...@@ -123,7 +124,10 @@ int QGDict::hashKeyAscii( const char *key )
{ {
#if defined(CHECK_NULL) #if defined(CHECK_NULL)
if ( key == 0 ) if ( key == 0 )
{
qWarning( "QGDict::hashAsciiKey: Invalid null key" ); qWarning( "QGDict::hashAsciiKey: Invalid null key" );
return 0;
}
#endif #endif
register const char *k = key; register const char *k = key;
register uint h=0; register uint h=0;
......
...@@ -1856,8 +1856,11 @@ void ClassDef::setTemplateArguments(ArgumentList *al) ...@@ -1856,8 +1856,11 @@ void ClassDef::setTemplateArguments(ArgumentList *al)
*/ */
bool ClassDef::hasNonReferenceSuperClass() bool ClassDef::hasNonReferenceSuperClass()
{ {
bool found=!isReference(); bool found=!isReference() && isLinkableInProject();
if (found) return TRUE; // we're done if this class is not a reference if (found)
{
return TRUE; // we're done if this class is not a reference
}
BaseClassListIterator bcli(*m_inheritedBy); BaseClassListIterator bcli(*m_inheritedBy);
for ( ; bcli.current() && !found ; ++bcli ) // for each super class for ( ; bcli.current() && !found ; ++bcli ) // for each super class
{ {
...@@ -2879,6 +2882,7 @@ void ClassDef::getTemplateParameterLists(QList<ArgumentList> &lists) const ...@@ -2879,6 +2882,7 @@ void ClassDef::getTemplateParameterLists(QList<ArgumentList> &lists) const
QCString ClassDef::qualifiedNameWithTemplateParameters( QCString ClassDef::qualifiedNameWithTemplateParameters(
QList<ArgumentList> *actualParams) const QList<ArgumentList> *actualParams) const
{ {
static bool optimizeOutputJava = Config_getBool("OPTIMIZE_OUTPUT_JAVA");
//printf("qualifiedNameWithTemplateParameters() localName=%s\n",localName().data()); //printf("qualifiedNameWithTemplateParameters() localName=%s\n",localName().data());
QCString scName; QCString scName;
Definition *d=getOuterScope(); Definition *d=getOuterScope();
...@@ -2896,7 +2900,7 @@ QCString ClassDef::qualifiedNameWithTemplateParameters( ...@@ -2896,7 +2900,7 @@ QCString ClassDef::qualifiedNameWithTemplateParameters(
} }
QCString scopeSeparator; QCString scopeSeparator;
if (Config_getBool("OPTIMIZE_OUTPUT_JAVA")) if (optimizeOutputJava)
scopeSeparator="."; scopeSeparator=".";
else else
scopeSeparator="::"; scopeSeparator="::";
......
...@@ -272,10 +272,11 @@ ClassDef *VariableContext::findVariable(const QCString &name) ...@@ -272,10 +272,11 @@ ClassDef *VariableContext::findVariable(const QCString &name)
ClassDef *result = 0; ClassDef *result = 0;
QListIterator<Scope> sli(m_scopes); QListIterator<Scope> sli(m_scopes);
Scope *scope; Scope *scope;
QCString key = name;
// search from inner to outer scope // search from inner to outer scope
for (sli.toLast();(scope=sli.current());--sli) for (sli.toLast();(scope=sli.current());--sli)
{ {
result = scope->find(name); result = scope->find(key);
if (result) if (result)
{ {
DBG_CTX((stderr,"** findVariable(%s)=%p\n",name.data(),result)); DBG_CTX((stderr,"** findVariable(%s)=%p\n",name.data(),result));
...@@ -2433,7 +2434,7 @@ OPERATOR {ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP} ...@@ -2433,7 +2434,7 @@ OPERATOR {ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}
<MemberCall,MemberCall2,FuncCall>")" { <MemberCall,MemberCall2,FuncCall>")" {
g_theVarContext.addVariable(g_parmType,g_parmName); g_theVarContext.addVariable(g_parmType,g_parmName);
g_theCallContext.popScope(); g_theCallContext.popScope();
g_theCallContext.setClass(0); //g_theCallContext.setClass(0); // commented out, otherwise a()->b() does not work for b().
g_code->codify(yytext); g_code->codify(yytext);
if (--g_bracketCount<=0) if (--g_bracketCount<=0)
{ {
...@@ -2461,8 +2462,7 @@ OPERATOR {ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP} ...@@ -2461,8 +2462,7 @@ OPERATOR {ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}
g_theVarContext.addVariable(g_type,g_name); g_theVarContext.addVariable(g_type,g_name);
} }
g_parmType.resize(0);g_parmName.resize(0); g_parmType.resize(0);g_parmName.resize(0);
//g_theCallContext.popScope(); g_theCallContext.setClass(0);
//g_theCallContext.setClass(0);
if (*yytext==';' || g_insideBody) if (*yytext==';' || g_insideBody)
{ {
if (!g_insideBody) if (!g_insideBody)
......
...@@ -523,8 +523,10 @@ void convertCppComments(BufStr *inBuf,BufStr *outBuf,const char *fileName) ...@@ -523,8 +523,10 @@ void convertCppComments(BufStr *inBuf,BufStr *outBuf,const char *fileName)
while (!g_condStack.isEmpty()) while (!g_condStack.isEmpty())
{ {
CondCtx *ctx = g_condStack.pop(); CondCtx *ctx = g_condStack.pop();
warn(g_fileName,ctx->lineNr,"Conditional section with %s does not have " QCString sectionInfo = " ";
"a corresponding \\endcond command within this file.",ctx->sectionId.data()); if (ctx->sectionId!=" ") sectionInfo.sprintf(" with label %s ",ctx->sectionId.data());
warn(g_fileName,ctx->lineNr,"Conditional section%sdoes not have "
"a corresponding \\endcond command within this file.",sectionInfo.data());
} }
if (Debug::isFlagSet(Debug::CommentCnv)) if (Debug::isFlagSet(Debug::CommentCnv))
{ {
......
...@@ -267,7 +267,8 @@ enum OutputContext ...@@ -267,7 +267,8 @@ enum OutputContext
enum GuardType enum GuardType
{ {
Guard_If, Guard_If,
Guard_IfNot Guard_IfNot,
Guard_Skip
}; };
class GuardedSection class GuardedSection
...@@ -305,6 +306,7 @@ static QCString blockName; // preformatted block name (e.g. ve ...@@ -305,6 +306,7 @@ static QCString blockName; // preformatted block name (e.g. ve
static XRefKind xrefKind; // kind of cross-reference command static XRefKind xrefKind; // kind of cross-reference command
static XRefKind newXRefKind; // static XRefKind newXRefKind; //
static GuardType guardType; // kind of guard for conditional section static GuardType guardType; // kind of guard for conditional section
static bool enabledSectionFound;
static QCString nameHeader; // heading of the @name command static QCString nameHeader; // heading of the @name command
static QCString functionProto; // function prototype static QCString functionProto; // function prototype
static QStack<GuardedSection> guards; // tracks nested conditional sections (if,ifnot,..) static QStack<GuardedSection> guards; // tracks nested conditional sections (if,ifnot,..)
...@@ -548,8 +550,10 @@ static inline void setOutput(OutputContext ctx) ...@@ -548,8 +550,10 @@ static inline void setOutput(OutputContext ctx)
{ {
bool xrefAppendToPrev = xrefAppendFlag; bool xrefAppendToPrev = xrefAppendFlag;
// determine append flag for the next item (i.e. the end of this item) // determine append flag for the next item (i.e. the end of this item)
xrefAppendFlag = ctx==OutputXRef && newXRefKind==xrefKind && xrefAppendFlag = inContext==OutputXRef && ctx==OutputXRef && // two consecutive xref items
(xrefKind!=XRef_Item || newXRefItemKey==xrefItemKey); newXRefKind==xrefKind && // of the same kind
(xrefKind!=XRef_Item ||
newXRefItemKey==xrefItemKey); // with the same key if \xrefitem
//printf("refKind=%d newXRefKind=%d xrefAppendToPrev=%d xrefAppendFlag=%d\n", //printf("refKind=%d newXRefKind=%d xrefAppendToPrev=%d xrefAppendFlag=%d\n",
// xrefKind,newXRefKind,xrefAppendToPrev,xrefAppendFlag); // xrefKind,newXRefKind,xrefAppendToPrev,xrefAppendFlag);
xrefItemKey = newXRefItemKey; xrefItemKey = newXRefItemKey;
...@@ -1386,11 +1390,15 @@ SCOPENAME "$"?(({ID}?{BN}*"::"{BN}*)*)((~{BN}*)?{ID}) ...@@ -1386,11 +1390,15 @@ SCOPENAME "$"?(({ID}?{BN}*"::"{BN}*)*)((~{BN}*)?{ID})
) // section is visible ) // section is visible
{ {
guards.push(new GuardedSection(TRUE,TRUE)); guards.push(new GuardedSection(TRUE,TRUE));
enabledSectionFound=TRUE;
BEGIN( Comment ); BEGIN( Comment );
} }
else // section is invisible else // section is invisible
{
if (guardType!=Guard_Skip)
{ {
guards.push(new GuardedSection(FALSE,TRUE)); guards.push(new GuardedSection(FALSE,TRUE));
}
BEGIN( SkipGuardedSection ); BEGIN( SkipGuardedSection );
} }
} }
...@@ -1443,10 +1451,11 @@ SCOPENAME "$"?(({ID}?{BN}*"::"{BN}*)*)((~{BN}*)?{ID}) ...@@ -1443,10 +1451,11 @@ SCOPENAME "$"?(({ID}?{BN}*"::"{BN}*)*)((~{BN}*)?{ID})
} }
else else
{ {
if (guards.top()->parentVisible()) if (!enabledSectionFound && guards.top()->parentVisible())
{ {
delete guards.pop(); delete guards.pop();
guards.push(new GuardedSection(TRUE,TRUE)); guards.push(new GuardedSection(TRUE,TRUE));
enabledSectionFound=TRUE;
BEGIN( Comment ); BEGIN( Comment );
} }
} }
...@@ -1459,7 +1468,7 @@ SCOPENAME "$"?(({ID}?{BN}*"::"{BN}*)*)((~{BN}*)?{ID}) ...@@ -1459,7 +1468,7 @@ SCOPENAME "$"?(({ID}?{BN}*"::"{BN}*)*)((~{BN}*)?{ID})
} }
else else
{ {
if (guards.top()->parentVisible()) if (!enabledSectionFound && guards.top()->parentVisible())
{ {
delete guards.pop(); delete guards.pop();
BEGIN( GuardParam ); BEGIN( GuardParam );
...@@ -1828,6 +1837,7 @@ static void handleRefItem(const QCString &) ...@@ -1828,6 +1837,7 @@ static void handleRefItem(const QCString &)
static void handleSection(const QCString &s) static void handleSection(const QCString &s)
{ {
setOutput(OutputDoc);
addOutput("@"+s+" "); addOutput("@"+s+" ");
BEGIN(SectionLabel); BEGIN(SectionLabel);
} }
...@@ -1868,12 +1878,14 @@ static void handleAddIndex(const QCString &) ...@@ -1868,12 +1878,14 @@ static void handleAddIndex(const QCString &)
static void handleIf(const QCString &) static void handleIf(const QCString &)
{ {
enabledSectionFound=FALSE;
guardType = Guard_If; guardType = Guard_If;
BEGIN(GuardParam); BEGIN(GuardParam);
} }
static void handleIfNot(const QCString &) static void handleIfNot(const QCString &)
{ {
enabledSectionFound=FALSE;
guardType = Guard_IfNot; guardType = Guard_IfNot;
BEGIN(GuardParam); BEGIN(GuardParam);
} }
...@@ -1887,7 +1899,7 @@ static void handleElseIf(const QCString &) ...@@ -1887,7 +1899,7 @@ static void handleElseIf(const QCString &)
} }
else else
{ {
guardType = Guard_If; guardType = enabledSectionFound ? Guard_Skip : Guard_If;
BEGIN(GuardParam); BEGIN(GuardParam);
} }
} }
...@@ -1916,6 +1928,7 @@ static void handleEndIf(const QCString &) ...@@ -1916,6 +1928,7 @@ static void handleEndIf(const QCString &)
{ {
delete guards.pop(); delete guards.pop();
} }
enabledSectionFound=FALSE;
} }
static void handleIngroup(const QCString &) static void handleIngroup(const QCString &)
...@@ -2058,8 +2071,7 @@ bool parseCommentBlock(/* in */ ParserInterface *parser, ...@@ -2058,8 +2071,7 @@ bool parseCommentBlock(/* in */ ParserInterface *parser,
warn(yyFileName,yyLineNr,"Documentation block ended in the middle of a conditional section!"); warn(yyFileName,yyLineNr,"Documentation block ended in the middle of a conditional section!");
} }
// strip any leading/trailing whitespace current->doc=stripLeadingAndTrailingEmptyLines(current->doc);
current->doc=current->doc.stripWhiteSpace();
if (current->section==Entry::FILEDOC_SEC && current->doc.isEmpty()) if (current->section==Entry::FILEDOC_SEC && current->doc.isEmpty())
{ {
......
...@@ -1734,6 +1734,7 @@ void Config::create() ...@@ -1734,6 +1734,7 @@ void Config::create()
"provided by doxygen. Whatever the progam writes to standard output \n" "provided by doxygen. Whatever the progam writes to standard output \n"
"is used as the file version. See the manual for examples. \n" "is used as the file version. See the manual for examples. \n"
); );
cs->setWidgetType(ConfigString::File);
//----------------------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------------------
addInfo( "Messages","configuration options related to warning and progress messages"); addInfo( "Messages","configuration options related to warning and progress messages");
...@@ -1791,6 +1792,7 @@ void Config::create() ...@@ -1791,6 +1792,7 @@ void Config::create()
"and error messages should be written. If left blank the output is written \n" "and error messages should be written. If left blank the output is written \n"
"to stderr. \n" "to stderr. \n"
); );
cs->setWidgetType(ConfigString::File);
//----------------------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------------------
addInfo( "Input","configuration options related to the input files"); addInfo( "Input","configuration options related to the input files");
//----------------------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------------------
...@@ -1877,6 +1879,7 @@ void Config::create() ...@@ -1877,6 +1879,7 @@ void Config::create()
"to standard output. If FILTER_PATTERNS is specified, this tag will be \n" "to standard output. If FILTER_PATTERNS is specified, this tag will be \n"
"ignored. \n" "ignored. \n"
); );
cs->setWidgetType(ConfigString::File);
cl = addList( cl = addList(
"FILTER_PATTERNS", "FILTER_PATTERNS",
"The FILTER_PATTERNS tag can be used to specify filters on a per file pattern \n" "The FILTER_PATTERNS tag can be used to specify filters on a per file pattern \n"
...@@ -2041,6 +2044,7 @@ void Config::create() ...@@ -2041,6 +2044,7 @@ void Config::create()
"can add a path in front of the file if the result should not be \n" "can add a path in front of the file if the result should not be \n"
"written to the html output directory. \n" "written to the html output directory. \n"
); );
cs->setWidgetType(ConfigString::File);
cs->addDependency("GENERATE_HTML"); cs->addDependency("GENERATE_HTML");
cs = addString( cs = addString(
"HHC_LOCATION", "HHC_LOCATION",
...@@ -2049,6 +2053,7 @@ void Config::create() ...@@ -2049,6 +2053,7 @@ void Config::create()
"the HTML help compiler (hhc.exe). If non-empty doxygen will try to run \n" "the HTML help compiler (hhc.exe). If non-empty doxygen will try to run \n"
"the HTML help compiler on the generated index.hhp.\n" "the HTML help compiler on the generated index.hhp.\n"
); );
cs->setWidgetType(ConfigString::File);
cs->addDependency("GENERATE_HTML"); cs->addDependency("GENERATE_HTML");
cb = addBool( cb = addBool(
"GENERATE_CHI", "GENERATE_CHI",
......
...@@ -177,9 +177,10 @@ void Definition::setDocumentation(const char *d,const char *docFile,int docLine, ...@@ -177,9 +177,10 @@ void Definition::setDocumentation(const char *d,const char *docFile,int docLine,
{ {
if (d==0) return; if (d==0) return;
//printf("Definition::setDocumentation(%s,%s,%d,%d)\n",d,docFile,docLine,stripWhiteSpace); //printf("Definition::setDocumentation(%s,%s,%d,%d)\n",d,docFile,docLine,stripWhiteSpace);
QCString doc; QCString doc = d;
if (stripWhiteSpace) if (stripWhiteSpace)
{ {
#if 0
// strip leading empty lines in front of the text, but not the // strip leading empty lines in front of the text, but not the
// leading spaces in front of the first line, so list items are // leading spaces in front of the first line, so list items are
// parsed with the correct indent // parsed with the correct indent
...@@ -201,6 +202,8 @@ void Definition::setDocumentation(const char *d,const char *docFile,int docLine, ...@@ -201,6 +202,8 @@ void Definition::setDocumentation(const char *d,const char *docFile,int docLine,
doc.at(e)='\0'; doc.at(e)='\0';
e--; e--;
} }
#endif
doc = stripLeadingAndTrailingEmptyLines(doc);
} }
else // don't strip whitespace else // don't strip whitespace
{ {
......
...@@ -79,7 +79,7 @@ class Definition ...@@ -79,7 +79,7 @@ class Definition
virtual QCString getOutputFileBase() const = 0; virtual QCString getOutputFileBase() const = 0;
/*! Returns the name of the source listing of this file. */ /*! Returns the name of the source listing of this file. */
const QCString getSourceFileBase() const { ASSERT(0); return "NULL"; } virtual QCString getSourceFileBase() const { ASSERT(0); return "NULL"; }
/*! Returns the detailed description of this definition */ /*! Returns the detailed description of this definition */
const QCString& documentation() const { return m_doc; } const QCString& documentation() const { return m_doc; }
......
...@@ -892,6 +892,18 @@ static void handleLinkedWord(DocNode *parent,QList<DocNode> &children) ...@@ -892,6 +892,18 @@ static void handleLinkedWord(DocNode *parent,QList<DocNode> &children)
) )
); );
} }
else if (compound->definitionType()==Definition::TypeFile &&
((FileDef*)compound)->generateSourceFile()
) // undocumented file that has source code we can link to
{
children.append(new
DocLinkedWord(parent,g_token->name,
compound->getReference(),
compound->getSourceFileBase(),
""
)
);
}
else // not linkable else // not linkable
{ {
children.append(new DocWord(parent,name)); children.append(new DocWord(parent,name));
...@@ -1915,15 +1927,16 @@ DocRef::DocRef(DocNode *parent,const QString &target) : ...@@ -1915,15 +1927,16 @@ DocRef::DocRef(DocNode *parent,const QString &target) :
m_refToSection = sec->type!=SectionInfo::Anchor; m_refToSection = sec->type!=SectionInfo::Anchor;
//printf("m_text=%s,m_ref=%s,m_file=%s,m_refToAnchor=%d\n", //printf("m_text=%s,m_ref=%s,m_file=%s,m_refToAnchor=%d\n",
// m_text.data(),m_ref.data(),m_file.data(),m_refToAnchor); // m_text.data(),m_ref.data(),m_file.data(),m_refToAnchor);
return;
} }
else if (resolveLink(g_context,target,TRUE,&compound,/*&pageInfo,*/anchor)) else if (resolveLink(g_context,target,TRUE,&compound,anchor))
{ {
bool isFile = compound ? bool isFile = compound ?
(compound->definitionType()==Definition::TypeFile ? TRUE : FALSE) : (compound->definitionType()==Definition::TypeFile ? TRUE : FALSE) :
FALSE; FALSE;
m_text = linkToText(target,isFile); m_text = linkToText(target,isFile);
m_anchor = anchor; m_anchor = anchor;
if (compound) // ref to compound if (compound && compound->isLinkable()) // ref to compound
{ {
if (anchor.isEmpty() && /* compound link */ if (anchor.isEmpty() && /* compound link */
compound->definitionType()==Definition::TypeGroup && /* is group */ compound->definitionType()==Definition::TypeGroup && /* is group */
...@@ -1935,18 +1948,20 @@ DocRef::DocRef(DocNode *parent,const QString &target) : ...@@ -1935,18 +1948,20 @@ DocRef::DocRef(DocNode *parent,const QString &target) :
m_file = compound->getOutputFileBase(); m_file = compound->getOutputFileBase();
m_ref = compound->getReference(); m_ref = compound->getReference();
return;
} }
else else if (compound->definitionType()==Definition::TypeFile &&
((FileDef*)compound)->generateSourceFile()
) // undocumented file that has source code we can link to
{ {
err("%s:%d: Internal error: resolveLink successful but no compound found!\n",__FILE__,__LINE__); m_file = compound->getSourceFileBase();
m_ref = compound->getReference();
return;
} }
} }
else // oops, bogus target
{
m_text = linkToText(target,FALSE); m_text = linkToText(target,FALSE);
warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unable to resolve reference to `%s' for \\ref command", warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unable to resolve reference to `%s' for \\ref command",
target.data()); target.data());
}
} }
void DocRef::parse() void DocRef::parse()
...@@ -1998,25 +2013,27 @@ DocLink::DocLink(DocNode *parent,const QString &target) : ...@@ -1998,25 +2013,27 @@ DocLink::DocLink(DocNode *parent,const QString &target) :
m_refText = m_refText.right(m_refText.length()-1); m_refText = m_refText.right(m_refText.length()-1);
} }
if (resolveLink(g_context,stripKnownExtensions(target),g_inSeeBlock, if (resolveLink(g_context,stripKnownExtensions(target),g_inSeeBlock,
&compound,/*&page,*/anchor)) &compound,anchor))
{ {
m_anchor = anchor; m_anchor = anchor;
if (compound) if (compound && compound->isLinkable())
{ {
m_file = compound->getOutputFileBase(); m_file = compound->getOutputFileBase();
m_ref = compound->getReference(); m_ref = compound->getReference();
} }
//else if (page) else if (compound->definitionType()==Definition::TypeFile &&
//{ ((FileDef*)compound)->generateSourceFile()
// m_file = page->getOutputFileBase(); ) // undocumented file that has source code we can link to
// m_ref = page->getReference();
//}
}
else // oops, bogus target
{ {
m_file = compound->getSourceFileBase();
m_ref = compound->getReference();
}
return;
}
// bogus link target
warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unable to resolve link to `%s' for \\link command", warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unable to resolve link to `%s' for \\link command",
target.data()); target.data());
}
} }
...@@ -2205,6 +2222,14 @@ void DocImage::parse() ...@@ -2205,6 +2222,14 @@ void DocImage::parse()
int tok; int tok;
while ((tok=doctokenizerYYlex())) while ((tok=doctokenizerYYlex()))
{ {
if (tok==TK_WORD && (g_token->name=="width=" || g_token->name=="height="))
{
// special case: no title, but we do have a size indicator
doctokenizerYYsetStateTitleAttrValue();
// strip =
g_token->name=g_token->name.left(g_token->name.length()-1);
break;
}
if (!defaultHandleToken(this,tok,m_children)) if (!defaultHandleToken(this,tok,m_children))
{ {
switch (tok) switch (tok)
......
...@@ -122,6 +122,7 @@ bool doctokenizerYYpopContext(); ...@@ -122,6 +122,7 @@ bool doctokenizerYYpopContext();
int doctokenizerYYlex(); int doctokenizerYYlex();
void doctokenizerYYsetStatePara(); void doctokenizerYYsetStatePara();
void doctokenizerYYsetStateTitle(); void doctokenizerYYsetStateTitle();
void doctokenizerYYsetStateTitleAttrValue();
void doctokenizerYYsetStateCode(); void doctokenizerYYsetStateCode();
void doctokenizerYYsetStateHtmlOnly(); void doctokenizerYYsetStateHtmlOnly();
void doctokenizerYYsetStateManOnly(); void doctokenizerYYsetStateManOnly();
......
...@@ -931,6 +931,11 @@ void doctokenizerYYsetStateTitle() ...@@ -931,6 +931,11 @@ void doctokenizerYYsetStateTitle()
BEGIN(St_Title); BEGIN(St_Title);
} }
void doctokenizerYYsetStateTitleAttrValue()
{
BEGIN(St_TitleV);
}
void doctokenizerYYsetStateCode() void doctokenizerYYsetStateCode()
{ {
g_token->verb=""; g_token->verb="";
......
...@@ -713,7 +713,7 @@ void DotNode::writeArrow(QTextStream &t, ...@@ -713,7 +713,7 @@ void DotNode::writeArrow(QTextStream &t,
<< "\",fontsize=10,style=\"" << edgeStyleMap[ei->m_style] << "\""; << "\",fontsize=10,style=\"" << edgeStyleMap[ei->m_style] << "\"";
if (!ei->m_label.isEmpty()) if (!ei->m_label.isEmpty())
{ {
t << ",label=\"" << ei->m_label << "\""; t << ",label=\"" << convertLabel(ei->m_label) << "\"";
} }
if (Config_getBool("UML_LOOK") && if (Config_getBool("UML_LOOK") &&
arrowStyle[ei->m_color] && arrowStyle[ei->m_color] &&
...@@ -3217,7 +3217,7 @@ void DotGroupCollaboration::Edge::write( QTextStream &t, int& ) ...@@ -3217,7 +3217,7 @@ void DotGroupCollaboration::Edge::write( QTextStream &t, int& )
for( lli.toFirst(); (link=lli.current()); ++lli) for( lli.toFirst(); (link=lli.current()); ++lli)
{ {
if (first) first=FALSE; else t << "\\n"; if (first) first=FALSE; else t << "\\n";
t << link->label; t << convertLabel(link->label);
} }
t << "\""; t << "\"";
......
...@@ -724,29 +724,10 @@ static void addClassToContext(Entry *root) ...@@ -724,29 +724,10 @@ static void addClassToContext(Entry *root)
if (root->bodyLine!=-1 && cd->getStartBodyLine()==-1) if (root->bodyLine!=-1 && cd->getStartBodyLine()==-1)
{ {
cd->setBodySegment(root->bodyLine,root->endBodyLine); cd->setBodySegment(root->bodyLine,root->endBodyLine);
cd->setBodyDef(findFileDef(Doxygen::inputNameDict,root->fileName,ambig)); cd->setBodyDef(fd);
} }
cd->addSectionsToDefinition(root->anchors);
//cd->setName(fullName); // change name to match docs //cd->setName(fullName); // change name to match docs
} }
cd->setFileDef(fd);
if (cd->hasDocumentation())
{
addIncludeFile(cd,fd,root);
}
//addNamespace(root,cd);
if (fd && (root->section & Entry::COMPOUND_MASK))
{
//printf(">> Inserting class `%s' in file `%s' (root->fileName=`%s')\n",
// cd->name().data(),
// fd->name().data(),
// root->fileName.data()
// );
fd->insertClass(cd);
}
addClassToGroups(root,cd);
cd->setRefItems(root->sli);
if (!root->subGrouping) cd->setSubGrouping(FALSE);
if (cd->templateArguments()==0) if (cd->templateArguments()==0)
{ {
...@@ -804,7 +785,7 @@ static void addClassToContext(Entry *root) ...@@ -804,7 +785,7 @@ static void addClassToContext(Entry *root)
tagName = root->tagInfo->tagName; tagName = root->tagInfo->tagName;
refFileName = root->tagInfo->fileName; refFileName = root->tagInfo->fileName;
} }
ClassDef *cd=new ClassDef(root->fileName,root->startLine,fullName,sec, cd=new ClassDef(root->fileName,root->startLine,fullName,sec,
tagName,refFileName); tagName,refFileName);
cd->setDocumentation(root->doc,root->docFile,root->docLine); // copy docs to definition cd->setDocumentation(root->doc,root->docFile,root->docLine); // copy docs to definition
cd->setBriefDescription(root->brief,root->briefFile,root->briefLine); cd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
...@@ -817,41 +798,33 @@ static void addClassToContext(Entry *root) ...@@ -817,41 +798,33 @@ static void addClassToContext(Entry *root)
// tArgList ? tempArgListToString(tArgList).data() : "<none>"); // tArgList ? tempArgListToString(tArgList).data() : "<none>");
cd->setTemplateArguments(tArgList); cd->setTemplateArguments(tArgList);
cd->setProtection(root->protection); cd->setProtection(root->protection);
cd->addSectionsToDefinition(root->anchors);
cd->setIsStatic(root->stat); cd->setIsStatic(root->stat);
// file definition containing the class cd // file definition containing the class cd
cd->setBodySegment(root->bodyLine,root->endBodyLine); cd->setBodySegment(root->bodyLine,root->endBodyLine);
cd->setBodyDef(fd); cd->setBodyDef(fd);
if (!root->subGrouping) cd->setSubGrouping(FALSE);
addClassToGroups(root,cd);
cd->setRefItems(root->sli);
// see if the class is found inside a namespace // see if the class is found inside a namespace
//bool found=addNamespace(root,cd); //bool found=addNamespace(root,cd);
cd->setFileDef(fd);
if (cd->hasDocumentation()) // the empty string test is needed for extract all case
{ cd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
addIncludeFile(cd,fd,root); cd->insertUsedFile(root->fileName);
// add class to the list
//printf("ClassDict.insert(%s)\n",resolveDefines(fullName).data());
Doxygen::classSDict.append(fullName,cd);
} }
#if 0 cd->addSectionsToDefinition(root->anchors);
// namespace is part of the class name if (!root->subGrouping) cd->setSubGrouping(FALSE);
if (!found && !namespaceName.isEmpty()) if (cd->hasDocumentation())
{
NamespaceDef *nd = getResolvedNamespace(namespaceName);
if (nd)
{ {
cd->setNamespace(nd); addIncludeFile(cd,fd,root);
nd->insertClass(cd);
found=TRUE;
}
} }
// add the class to the file (we do this even if we have already inserted
// it into the namespace)
if (fd && (root->section & Entry::COMPOUND_MASK)) if (fd && (root->section & Entry::COMPOUND_MASK))
{ {
//printf(">> Inserting class `%s' in file `%s' (root->fileName=`%s')\n", //printf(">> Inserting class `%s' in file `%s' (root->fileName=`%s')\n",
...@@ -859,20 +832,11 @@ static void addClassToContext(Entry *root) ...@@ -859,20 +832,11 @@ static void addClassToContext(Entry *root)
// fd->name().data(), // fd->name().data(),
// root->fileName.data() // root->fileName.data()
// ); // );
cd->setFileDef(fd);
fd->insertClass(cd); fd->insertClass(cd);
} }
#endif addClassToGroups(root,cd);
cd->setRefItems(root->sli);
// the empty string test is needed for extract all case
cd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
cd->insertUsedFile(root->fileName);
// add class to the list
//printf("ClassDict.insert(%s)\n",resolveDefines(fullName).data());
Doxygen::classSDict.append(fullName,cd);
}
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
...@@ -3828,7 +3792,7 @@ static void computeTemplateClassRelations() ...@@ -3828,7 +3792,7 @@ static void computeTemplateClassRelations()
for (tdi.toFirst();(tcd=tdi.current());++tdi) // for each template instance for (tdi.toFirst();(tcd=tdi.current());++tdi) // for each template instance
{ {
Debug::print(Debug::Classes,0," Template instance %s : \n",tcd->name().data()); Debug::print(Debug::Classes,0," Template instance %s : \n",tcd->name().data());
QCString templSpec = tdi.currentKey().data(); QCString templSpec = tdi.currentKey();
ArgumentList *templArgs = new ArgumentList; ArgumentList *templArgs = new ArgumentList;
stringToArgumentList(templSpec,templArgs); stringToArgumentList(templSpec,templArgs);
QList<BaseInfo> *baseList=root->extends; QList<BaseInfo> *baseList=root->extends;
...@@ -5938,7 +5902,7 @@ static void createTemplateInstanceMembers() ...@@ -5938,7 +5902,7 @@ static void createTemplateInstanceMembers()
// for each instance of the template // for each instance of the template
for (qdi.toFirst();(tcd=qdi.current());++qdi) for (qdi.toFirst();(tcd=qdi.current());++qdi)
{ {
tcd->addMembersToTemplateInstance(cd,qdi.currentKey().data()); tcd->addMembersToTemplateInstance(cd,qdi.currentKey());
} }
} }
} }
......
...@@ -320,9 +320,9 @@ class Entry ...@@ -320,9 +320,9 @@ class Entry
{ {
switch( groupDocType ) switch( groupDocType )
{ {
case GROUPDOC_NORMAL: return "\\defgroup"; break; case GROUPDOC_NORMAL: return "\\defgroup";
case GROUPDOC_ADD: return "\\addgroup"; break; case GROUPDOC_ADD: return "\\addgroup";
case GROUPDOC_WEAK: return "\\weakgroup"; break; case GROUPDOC_WEAK: return "\\weakgroup";
default: return "unknown group command"; default: return "unknown group command";
} }
} }
...@@ -334,9 +334,9 @@ class Entry ...@@ -334,9 +334,9 @@ class Entry
} }
switch( groupDocType ) switch( groupDocType )
{ {
case GROUPDOC_NORMAL: return Grouping::GROUPING_AUTO_DEF; break; case GROUPDOC_NORMAL: return Grouping::GROUPING_AUTO_DEF;
case GROUPDOC_ADD: return Grouping::GROUPING_AUTO_ADD; break; case GROUPDOC_ADD: return Grouping::GROUPING_AUTO_ADD;
case GROUPDOC_WEAK: return Grouping::GROUPING_AUTO_WEAK; break; case GROUPDOC_WEAK: return Grouping::GROUPING_AUTO_WEAK;
default: return Grouping::GROUPING_LOWEST; default: return Grouping::GROUPING_LOWEST;
} }
} }
......
...@@ -551,14 +551,16 @@ void HtmlHelp::addContentsItem(bool isDir, ...@@ -551,14 +551,16 @@ void HtmlHelp::addContentsItem(bool isDir,
/*! Add an list item to the index file. /*! Add an list item to the index file.
* \param level1 the main index of the item. * \param level1 the main index of the item.
* \param level2 the sub index of the item. * \param level2 the sub index of the item.
* \param ref the URL of to the item. * \param contRef the output file refering to the container.
* \param memRef the output file containing to the member documentation.
* \param anchor the anchor of the item. * \param anchor the anchor of the item.
* \sa HtmlHelpIndex * \sa HtmlHelpIndex
*/ */
void HtmlHelp::addIndexItem(const char *level1, const char *level2, void HtmlHelp::addIndexItem(const char *level1, const char *level2,
const char *ref, const char *anchor) const char *contRef, const char *memRef,
const char *anchor)
{ {
index->addItem(level1,level2,ref,anchor,TRUE,FALSE); index->addItem(level1,level2,contRef,anchor,TRUE,FALSE);
index->addItem(level2,level1,ref,anchor,TRUE,TRUE); index->addItem(level2,level1,memRef,anchor,TRUE,TRUE);
} }
...@@ -74,7 +74,8 @@ class HtmlHelp ...@@ -74,7 +74,8 @@ class HtmlHelp
const char *ref = 0, const char *ref = 0,
const char *anchor = 0); const char *anchor = 0);
void addIndexItem(const char *level1, const char *level2, void addIndexItem(const char *level1, const char *level2,
const char *ref, const char *anchor); const char *contRef, const char *memRef,
const char *anchor);
void addIndexFile(const char *name); void addIndexFile(const char *name);
......
...@@ -1514,6 +1514,7 @@ void writeMemberList(OutputList &ol,bool useSections, ...@@ -1514,6 +1514,7 @@ void writeMemberList(OutputList &ol,bool useSections,
{ {
bool first = TRUE; bool first = TRUE;
char lastChar = 0; char lastChar = 0;
static bool hideFriendCompounds = Config_getBool("HIDE_FRIEND_COMPOUNDS");
MemberNameSDict::Iterator mnli(Doxygen::memberNameSDict); MemberNameSDict::Iterator mnli(Doxygen::memberNameSDict);
MemberName *mn=0; MemberName *mn=0;
...@@ -1527,7 +1528,7 @@ void writeMemberList(OutputList &ol,bool useSections, ...@@ -1527,7 +1528,7 @@ void writeMemberList(OutputList &ol,bool useSections,
while (md && !found) while (md && !found)
{ {
ClassDef *cd; ClassDef *cd;
bool isFriendToHide = Config_getBool("HIDE_FRIEND_COMPOUNDS") && bool isFriendToHide = hideFriendCompounds &&
(QCString(md->typeString())=="friend class" || (QCString(md->typeString())=="friend class" ||
QCString(md->typeString())=="friend struct" || QCString(md->typeString())=="friend struct" ||
QCString(md->typeString())=="friend union"); QCString(md->typeString())=="friend union");
...@@ -1615,6 +1616,7 @@ void writeMemberList(OutputList &ol,bool useSections, ...@@ -1615,6 +1616,7 @@ void writeMemberList(OutputList &ol,bool useSections,
int countClassMembers(int filter) int countClassMembers(int filter)
{ {
static bool hideFriendCompounds = Config_getBool("HIDE_FRIEND_COMPOUNDS");
int i=0;for (i=0;i<256;i++) g_memberIndexLetterUsed[filter][i]=FALSE; int i=0;for (i=0;i<256;i++) g_memberIndexLetterUsed[filter][i]=FALSE;
int count=0; int count=0;
MemberNameSDict::Iterator mnli(Doxygen::memberNameSDict); MemberNameSDict::Iterator mnli(Doxygen::memberNameSDict);
...@@ -1626,7 +1628,7 @@ int countClassMembers(int filter) ...@@ -1626,7 +1628,7 @@ int countClassMembers(int filter)
ClassDef *cd; ClassDef *cd;
while (md && !found) while (md && !found)
{ {
bool isFriendToHide = Config_getBool("HIDE_FRIEND_COMPOUNDS") && bool isFriendToHide = hideFriendCompounds &&
(QCString(md->typeString())=="friend class" || (QCString(md->typeString())=="friend class" ||
QCString(md->typeString())=="friend struct" || QCString(md->typeString())=="friend struct" ||
QCString(md->typeString())=="friend union"); QCString(md->typeString())=="friend union");
......
This diff is collapsed.
...@@ -101,6 +101,10 @@ static int g_commentCount; ...@@ -101,6 +101,10 @@ static int g_commentCount;
static bool g_insideComment; static bool g_insideComment;
static bool g_isImported; static bool g_isImported;
static QCString g_blockName; static QCString g_blockName;
static int g_condCtx;
static bool g_skip;
static QStack<bool> g_condStack;
static void setFileName(const char *name) static void setFileName(const char *name)
...@@ -973,6 +977,9 @@ Define *newDefine() ...@@ -973,6 +977,9 @@ Define *newDefine()
void addDefine() void addDefine()
{ {
if (g_skip) return; // do not add this define as it is inside a
// conditional section (@cond command) that is disabled.
//printf("addDefine %s %s\n",g_defName.data(),g_defArgsStr.data()); //printf("addDefine %s %s\n",g_defName.data(),g_defArgsStr.data());
//ArgumentList *al = new ArgumentList; //ArgumentList *al = new ArgumentList;
//stringToArgumentList(g_defArgsStr,al); //stringToArgumentList(g_defArgsStr,al);
...@@ -1127,6 +1134,31 @@ static void readIncludeFile(const QCString &inc) ...@@ -1127,6 +1134,31 @@ static void readIncludeFile(const QCString &inc)
} }
} }
/* ----------------------------------------------------------------- */
static void startCondSection(const char *sectId)
{
g_condStack.push(new bool(g_skip));
if (Config_getList("ENABLED_SECTIONS").find(sectId)==-1)
{
g_skip=TRUE;
}
}
static void endCondSection()
{
if (g_condStack.isEmpty())
{
g_skip=FALSE;
}
else
{
bool *ctx = g_condStack.pop();
g_skip=*ctx;
}
}
/* ----------------------------------------------------------------- */ /* ----------------------------------------------------------------- */
#undef YY_INPUT #undef YY_INPUT
...@@ -1183,6 +1215,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) ...@@ -1183,6 +1215,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
%x IgnoreLine %x IgnoreLine
%x FindDefineArgs %x FindDefineArgs
%x ReadString %x ReadString
%x CondLine
%% %%
...@@ -1777,11 +1810,34 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) ...@@ -1777,11 +1810,34 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
outputChar('/');outputChar('*'); outputChar('/');outputChar('*');
//g_commentCount++; //g_commentCount++;
} }
<SkipCComment>[\\@][\\@]("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"rtfonly"|"manonly"|"dot"|"code"){BN}+ {
outputArray(yytext,yyleng);
}
<SkipCComment>[\\@]("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"rtfonly"|"manonly"|"dot"|"code"){BN}+ { <SkipCComment>[\\@]("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"rtfonly"|"manonly"|"dot"|"code"){BN}+ {
outputArray(yytext,yyleng); outputArray(yytext,yyleng);
g_blockName=QCString(&yytext[1]).stripWhiteSpace(); g_blockName=QCString(&yytext[1]).stripWhiteSpace();
BEGIN(SkipVerbatim); BEGIN(SkipVerbatim);
} }
<SkipCComment,SkipCPPComment>[\\@]"cond"[ \t]+ { // conditional section
g_condCtx = YY_START;
outputArray(yytext,yyleng);
BEGIN(CondLine);
}
<CondLine>[a-z_A-Z][a-z_A-Z0-9.\-]* {
startCondSection(yytext);
outputArray(yytext,yyleng);
BEGIN(g_condCtx);
}
<SkipCComment,SkipCPPComment>[\\@]"cond"[ \t]+\n |
<CondLine>. {
outputArray(yytext,yyleng);
startCondSection(" ");
if (YY_START==CondLine) BEGIN(g_condCtx);
}
<SkipCComment,SkipCPPComment>[\\@]"endcond"/[^a-z_A-Z0-9] {
outputArray(yytext,yyleng);
endCondSection();
}
<SkipVerbatim>[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"endrtfonly"|"endmanonly"|"enddot"|"endcode") { /* end of verbatim block */ <SkipVerbatim>[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"endrtfonly"|"endmanonly"|"enddot"|"endcode") { /* end of verbatim block */
outputArray(yytext,yyleng); outputArray(yytext,yyleng);
if (&yytext[4]==g_blockName) if (&yytext[4]==g_blockName)
...@@ -1823,6 +1879,9 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) ...@@ -1823,6 +1879,9 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
<RemoveCComment>[^*\x06\n]+ <RemoveCComment>[^*\x06\n]+
<RemoveCComment>\n { g_yyLineNr++; outputChar('\n'); } <RemoveCComment>\n { g_yyLineNr++; outputChar('\n'); }
<RemoveCComment>. <RemoveCComment>.
<SkipCPPComment>[^\n\/\\@]+ {
outputArray(yytext,yyleng);
}
<SkipCPPComment,RemoveCPPComment>\n { <SkipCPPComment,RemoveCPPComment>\n {
unput(*yytext); unput(*yytext);
BEGIN(g_lastCPPContext); BEGIN(g_lastCPPContext);
...@@ -2129,6 +2188,8 @@ void preprocessFile(const char *fileName,BufStr &output) ...@@ -2129,6 +2188,8 @@ void preprocessFile(const char *fileName,BufStr &output)
g_fileDefineDict->clear(); g_fileDefineDict->clear();
g_expandedDict->setAutoDelete(FALSE); g_expandedDict->setAutoDelete(FALSE);
g_expandedDict->clear(); g_expandedDict->clear();
g_condStack.clear();
g_condStack.setAutoDelete(TRUE);
// add predefined macros // add predefined macros
char *defStr; char *defStr;
......
...@@ -302,7 +302,7 @@ static QCString stripQuotes(const char *s) ...@@ -302,7 +302,7 @@ static QCString stripQuotes(const char *s)
static void addMemberGroupDocs() static void addMemberGroupDocs()
{ {
memberGroupDocs=current->brief.stripWhiteSpace(); memberGroupDocs=current->brief.stripWhiteSpace();
current->doc = current->doc.stripWhiteSpace(); current->doc = stripLeadingAndTrailingEmptyLines(current->doc);
if (!memberGroupDocs.isEmpty() && !current->doc.isEmpty()) if (!memberGroupDocs.isEmpty() && !current->doc.isEmpty())
{ {
memberGroupDocs+="\n\n"; memberGroupDocs+="\n\n";
...@@ -4492,6 +4492,11 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt) ...@@ -4492,6 +4492,11 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt)
static void parsePrototype(const QCString &text) static void parsePrototype(const QCString &text)
{ {
//printf("**** parsePrototype(%s) begin\n",text.data()); //printf("**** parsePrototype(%s) begin\n",text.data());
if (text.isEmpty())
{
warn(yyFileName,yyLineNr,"Empty prototype found!");
return;
}
const char *orgInputString; const char *orgInputString;
int orgInputPosition; int orgInputPosition;
......
...@@ -208,6 +208,14 @@ class SDict ...@@ -208,6 +208,14 @@ class SDict
{ {
return m_dict->find(key); return m_dict->find(key);
} }
T *find(const QCString &key)
{
return m_dict->find(key);
}
T *find(const QString &key)
{
return m_dict->find(key);
}
/*! Equavalent to find(). */ /*! Equavalent to find(). */
T *operator[](const char *key) const T *operator[](const char *key) const
......
This diff is collapsed.
...@@ -1046,25 +1046,47 @@ ClassDef *getResolvedClassRec(Definition *scope, ...@@ -1046,25 +1046,47 @@ ClassDef *getResolvedClassRec(Definition *scope,
return 0; return 0;
} }
bool hasUsingStatements =
(fileScope && ((fileScope->getUsedNamespaces() &&
fileScope->getUsedNamespaces()->count()>0) ||
(fileScope->getUsedClasses() &&
fileScope->getUsedClasses()->count()>0))
);
// Since it is often the case that the same name is searched in the same // Since it is often the case that the same name is searched in the same
// scope over an over again (especially for the linked source code generation) // scope over an over again (especially for the linked source code generation)
// we use a cache to collect previous results. This is possible since the // we use a cache to collect previous results. This is possible since the
// result of a lookup is deterministic. As the key we use the concatenated // result of a lookup is deterministic. As the key we use the concatenated
// scope, the name to search for and the explicit scope prefix. The speedup // scope, the name to search for and the explicit scope prefix. The speedup
// achieved by this simple cache can be enormous. // achieved by this simple cache can be enormous.
QCString key=scope->name()+"+"+name+"+"+explicitScopePart; int scopeNameLen = scope->name().length()+1;
int nameLen = name.length()+1;
int explicitPartLen = explicitScopePart.length();
int fileScopeLen = hasUsingStatements ? 1+fileScope->name().length() : 0;
// below is a more efficient coding of
// QCString key=scope->name()+"+"+name+"+"+explicitScopePart;
QCString key(scopeNameLen+nameLen+explicitPartLen+fileScopeLen+1);
char *p=key.data();
qstrcpy(p,scope->name()); *(p+scopeNameLen-1)='+';
p+=scopeNameLen;
qstrcpy(p,name); *(p+nameLen-1)='+';
p+=nameLen;
qstrcpy(p,explicitScopePart);
p+=explicitPartLen;
// if a file scope is given and it contains using statements we should // if a file scope is given and it contains using statements we should
// also use the file part in the key (as a class name can be in // also use the file part in the key (as a class name can be in
// two different namespaces and a using statement in a file can select // two different namespaces and a using statement in a file can select
// one of them). // one of them).
if (fileScope && ((fileScope->getUsedNamespaces() && if (hasUsingStatements)
fileScope->getUsedNamespaces()->count()>0) ||
(fileScope->getUsedClasses() &&
fileScope->getUsedClasses()->count()>0))
)
{ {
key+="+"+fileScope->name(); // below is a more efficient coding of
// key+="+"+fileScope->name();
*p++='+';
qstrcpy(p,fileScope->name());
p+=fileScopeLen-1;
} }
*p='\0';
LookupInfo *pval=Doxygen::lookupCache.find(key); LookupInfo *pval=Doxygen::lookupCache.find(key);
//printf("Searching for %s result=%p\n",key.data(),pval); //printf("Searching for %s result=%p\n",key.data(),pval);
...@@ -3490,6 +3512,7 @@ bool resolveRef(/* in */ const char *scName, ...@@ -3490,6 +3512,7 @@ bool resolveRef(/* in */ const char *scName,
QCString linkToText(const char *link,bool isFileName) QCString linkToText(const char *link,bool isFileName)
{ {
static bool optimizeOutputJava = Config_getBool("OPTIMIZE_OUTPUT_JAVA");
QCString result=link; QCString result=link;
if (!result.isEmpty()) if (!result.isEmpty())
{ {
...@@ -3502,7 +3525,7 @@ QCString linkToText(const char *link,bool isFileName) ...@@ -3502,7 +3525,7 @@ QCString linkToText(const char *link,bool isFileName)
{ {
result=result.right(result.length()-2); result=result.right(result.length()-2);
} }
if (Config_getBool("OPTIMIZE_OUTPUT_JAVA")) if (optimizeOutputJava)
{ {
result=substitute(result,"::","."); result=substitute(result,"::",".");
} }
...@@ -3769,21 +3792,49 @@ QCString substitute(const char *s,const char *src,const char *dst) ...@@ -3769,21 +3792,49 @@ QCString substitute(const char *s,const char *src,const char *dst)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
struct FindFileCacheElem
{
FindFileCacheElem(FileDef *fd,bool ambig) : fileDef(fd), isAmbig(ambig) {}
FileDef *fileDef;
bool isAmbig;
};
static QCache<FindFileCacheElem> g_findFileDefCache(5000);
FileDef *findFileDef(const FileNameDict *fnDict,const char *n,bool &ambig) FileDef *findFileDef(const FileNameDict *fnDict,const char *n,bool &ambig)
{ {
ambig=FALSE; ambig=FALSE;
if (n==0) return 0;
QCString key;
key.sprintf("%p:",fnDict);
key+=n;
g_findFileDefCache.setAutoDelete(TRUE);
FindFileCacheElem *cachedResult = g_findFileDefCache.find(key);
if (cachedResult)
{
ambig = cachedResult->isAmbig;
return cachedResult->fileDef;
}
else
{
cachedResult = new FindFileCacheElem(0,FALSE);
}
QCString name=convertToQCString(QDir::cleanDirPath(n)); QCString name=convertToQCString(QDir::cleanDirPath(n));
QCString path; QCString path;
if (name.isEmpty()) return 0; int slashPos;
int slashPos=QMAX(name.findRev('/'),name.findRev('\\')); FileName *fn;
if (name.isEmpty()) goto exit;
slashPos=QMAX(name.findRev('/'),name.findRev('\\'));
if (slashPos!=-1) if (slashPos!=-1)
{ {
path=name.left(slashPos+1); path=name.left(slashPos+1);
name=name.right(name.length()-slashPos-1); name=name.right(name.length()-slashPos-1);
} }
//printf("findFileDef path=`%s' name=`%s'\n",path.data(),name.data()); //printf("findFileDef path=`%s' name=`%s'\n",path.data(),name.data());
if (name.isEmpty()) return 0; if (name.isEmpty()) goto exit;
FileName *fn;
if ((fn=(*fnDict)[name])) if ((fn=(*fnDict)[name]))
{ {
if (fn->count()==1) if (fn->count()==1)
...@@ -3791,6 +3842,8 @@ FileDef *findFileDef(const FileNameDict *fnDict,const char *n,bool &ambig) ...@@ -3791,6 +3842,8 @@ FileDef *findFileDef(const FileNameDict *fnDict,const char *n,bool &ambig)
FileDef *fd = fn->getFirst(); FileDef *fd = fn->getFirst();
if (path.isEmpty() || fd->getPath().right(path.length())==path) if (path.isEmpty() || fd->getPath().right(path.length())==path)
{ {
cachedResult->fileDef = fd;
g_findFileDefCache.insert(key,cachedResult);
return fd; return fd;
} }
} }
...@@ -3809,9 +3862,14 @@ FileDef *findFileDef(const FileNameDict *fnDict,const char *n,bool &ambig) ...@@ -3809,9 +3862,14 @@ FileDef *findFileDef(const FileNameDict *fnDict,const char *n,bool &ambig)
} }
} }
ambig=(count>1); ambig=(count>1);
cachedResult->isAmbig = ambig;
cachedResult->fileDef = lastMatch;
g_findFileDefCache.insert(key,cachedResult);
return lastMatch; return lastMatch;
} }
} }
exit:
g_findFileDefCache.insert(key,cachedResult);
return 0; return 0;
} }
...@@ -5276,3 +5334,44 @@ bool findAndRemoveWord(QCString &s,const QCString &word) ...@@ -5276,3 +5334,44 @@ bool findAndRemoveWord(QCString &s,const QCString &word)
return FALSE; return FALSE;
} }
/** Special version of QCString::stripWhiteSpace() that only strips
* empty lines.
*/
QCString stripLeadingAndTrailingEmptyLines(const QCString &s)
{
const char *p = s.data();
if (p==0) return 0;
// search for leading empty lines
int i=0,li=-1,l=s.length();
char c;
while ((c=*p++))
{
if (c==' ' || c=='\t' || c=='\r') i++;
else if (c=='\n') i++,li=i;
else break;
}
// search for trailing empty lines
int b=l-1,bi=-1;
p=s.data()+b;
while (b>=0)
{
c=*--p;
if (c==' ' || c=='\t' || c=='\r') b--;
else if (c=='\n') bi=b,b--;
else break;
}
// return whole string if no leading or trailing lines where found
if (li==-1 && bi==-1) return s;
// return substring
if (bi==-1) bi=l;
if (li==-1) li=0;
if (bi<=li) return 0; // only empty lines
return s.mid(li,bi-li);
}
...@@ -230,6 +230,7 @@ void createSubDirs(QDir &d); ...@@ -230,6 +230,7 @@ void createSubDirs(QDir &d);
QCString stripPath(const char *s); QCString stripPath(const char *s);
bool containsWord(const QCString &s,const QCString &word); bool containsWord(const QCString &s,const QCString &word);
bool findAndRemoveWord(QCString &s,const QCString &word); bool findAndRemoveWord(QCString &s,const QCString &word);
QCString stripLeadingAndTrailingEmptyLines(const QCString &s);
#endif #endif
...@@ -117,6 +117,10 @@ SOURCE=..\src\commentcnv.cpp ...@@ -117,6 +117,10 @@ SOURCE=..\src\commentcnv.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\commentscan.cpp
# End Source File
# Begin Source File
SOURCE=..\src\config.cpp SOURCE=..\src\config.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
...@@ -573,6 +577,10 @@ SOURCE=..\src\perlmodgen.h ...@@ -573,6 +577,10 @@ SOURCE=..\src\perlmodgen.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\parserintf.h
# End Source File
# Begin Source File
SOURCE=..\src\pngenc.h SOURCE=..\src\pngenc.h
# End Source File # End Source File
# Begin Source File # Begin Source File
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment