diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.in | 2 | ||||
-rw-r--r-- | src/classdef.cpp | 2 | ||||
-rw-r--r-- | src/code.l | 46 | ||||
-rw-r--r-- | src/config.l | 19 | ||||
-rw-r--r-- | src/definition.cpp | 4 | ||||
-rw-r--r-- | src/docparser.cpp | 9 | ||||
-rw-r--r-- | src/dot.cpp | 102 | ||||
-rw-r--r-- | src/doxygen.cpp | 10 | ||||
-rw-r--r-- | src/filedef.cpp | 2 | ||||
-rw-r--r-- | src/groupdef.cpp | 2 | ||||
-rw-r--r-- | src/memberdef.cpp | 2 | ||||
-rw-r--r-- | src/namespacedef.cpp | 2 | ||||
-rw-r--r-- | src/search.php | 4 | ||||
-rw-r--r-- | src/search_php.h | 4 | ||||
-rw-r--r-- | src/searchindex.cpp | 7 | ||||
-rw-r--r-- | src/searchindex.h | 2 |
16 files changed, 157 insertions, 62 deletions
diff --git a/src/Makefile.in b/src/Makefile.in index 1d57871..ccb63ca 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -38,7 +38,7 @@ tmake: $(ENV) $(PERL) $(TMAKE) doxygen.pro >Makefile.doxygen $(ENV) $(PERL) $(TMAKE) doxytag.pro >Makefile.doxytag -clean: Makefile.libdoxygen Makefile.doxygen Makefile.doxytag +clean: Makefile.libdoxygen Makefile.libdoxycfg Makefile.doxygen Makefile.doxytag $(MAKE) -f Makefile.libdoxygen clean $(MAKE) -f Makefile.libdoxycfg clean $(MAKE) -f Makefile.doxygen clean diff --git a/src/classdef.cpp b/src/classdef.cpp index 150ad3f..c061257 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -853,7 +853,7 @@ void ClassDef::writeDocumentation(OutputList &ol) if (Config_getBool("SEARCHENGINE")) { - Doxygen::searchIndex->setCurrentDoc(pageTitle,getOutputFileBase()+Config_getString("HTML_FILE_EXTENSION")); + Doxygen::searchIndex->setCurrentDoc(pageTitle,getOutputFileBase()); Doxygen::searchIndex->addWord(localName().lower()); } @@ -34,6 +34,7 @@ #include "outputlist.h" #include "util.h" #include "membername.h" +#include "searchindex.h" #define YY_NEVER_INTERACTIVE 1 @@ -78,7 +79,8 @@ static QCString g_name; static QCString g_args; static QCString g_classScope; static QCString g_realScope; -static QStack<int> g_scopeStack; //!< 1 if bracket starts a scope, 2 for internal blocks +static QStack<int> g_scopeStack; //!< 1 if bracket starts a scope, + // 2 for internal blocks static int g_anchorCount; static FileDef * g_sourceFileDef; static Definition * g_currentDefinition; @@ -318,6 +320,24 @@ static void popScope() //printf("popScope() result: `%s'\n",g_classScope.data()); } +static void setCurrentDoc(const QCString &name,const QCString &base,const QCString &anchor="") +{ + static bool searchEngineEnabled=Config_getBool("SEARCHENGINE"); + if (searchEngineEnabled) + { + Doxygen::searchIndex->setCurrentDoc(name,base,anchor); + } +} + +static void addToSearchIndex(const char *text) +{ + static bool searchEngineEnabled=Config_getBool("SEARCHENGINE"); + if (searchEngineEnabled) + { + Doxygen::searchIndex->addWord(text); + } +} + static void setClassScope(const QCString &name) { //printf("setClassScope(%s)\n",name.data()); @@ -360,17 +380,27 @@ static void startCodeLine() g_realScope = d->name().copy(); //printf("Real scope: `%s'\n",g_realScope.data()); g_bodyCurlyCount = 0; + QCString lineAnchor; + lineAnchor.sprintf("l%05d",g_yyLineNr); if (g_currentMemberDef) { g_code->writeLineNumber(g_currentMemberDef->getReference(), g_currentMemberDef->getOutputFileBase(), g_currentMemberDef->anchor(),g_yyLineNr); + setCurrentDoc( + g_currentMemberDef->qualifiedName(), + g_sourceFileDef->getSourceFileBase(), + lineAnchor); } else { g_code->writeLineNumber(d->getReference(), d->getOutputFileBase(), 0,g_yyLineNr); + setCurrentDoc( + d->qualifiedName(), + g_sourceFileDef->getSourceFileBase(), + lineAnchor); } } else @@ -683,6 +713,7 @@ static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName, } } writeMultiLineCodeLink(ol,cd->getReference(),cd->getOutputFileBase(),0,className); + addToSearchIndex(className); if (md) { Definition *d = md->getOuterScope()==Doxygen::globalScope ? @@ -717,6 +748,7 @@ static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName, if (md->isLinkable()) { writeMultiLineCodeLink(ol,md->getReference(),md->getOutputFileBase(),md->anchor(),clName); + addToSearchIndex(clName); if (g_currentMemberDef) { addDocCrossReference(g_currentMemberDef,md); @@ -727,6 +759,7 @@ static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName, } codifyLines(clName); + addToSearchIndex(clName); } } @@ -782,6 +815,7 @@ static bool getLink(const char *className, md->getOutputFileBase(), md->anchor(), text ? text : memberName); + addToSearchIndex(text ? text : memberName); return TRUE; } } @@ -834,6 +868,7 @@ static bool generateClassMemberLink(BaseCodeDocInterface &ol,ClassDef *mcd,const // write the actual link writeMultiLineCodeLink(ol,xmd->getReference(), xmd->getOutputFileBase(),xmd->anchor(),memName); + addToSearchIndex(memName); return TRUE; } @@ -934,6 +969,7 @@ static void generateMemberLink(BaseCodeDocInterface &ol,const QCString &varName, } } codifyLines(memName); + addToSearchIndex(memName); return; } @@ -1499,12 +1535,14 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned" if (!generateClassMemberLink(*g_code,g_theCallContext.getClass(),yytext)) { g_code->codify(yytext); + addToSearchIndex(yytext); } g_name.resize(0); } else { g_code->codify(yytext); + addToSearchIndex(yytext); g_name.resize(0); } g_type.resize(0); @@ -1524,12 +1562,14 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned" if (!generateClassMemberLink(*g_code,g_theCallContext.getClass(),yytext)) { g_code->codify(yytext); + addToSearchIndex(yytext); } g_name.resize(0); } else { g_code->codify(yytext); + addToSearchIndex(yytext); g_name.resize(0); } g_type.resize(0); @@ -2104,6 +2144,10 @@ void parseCode(BaseCodeDocInterface &od,const char *className,const QCString &s, g_exampleBlock = exBlock; g_exampleName = exName; g_sourceFileDef = fd; + if (fd) + { + setCurrentDoc(fd->name(),fd->getSourceFileBase()); + } g_currentDefinition = 0; g_currentMemberDef = 0; g_searchingForBody = FALSE; diff --git a/src/config.l b/src/config.l index 594cbc2..cd88d3e 100644 --- a/src/config.l +++ b/src/config.l @@ -19,7 +19,6 @@ */ #include <stdio.h> #include <stdlib.h> -//#include <iostream.h> #include <assert.h> #include <ctype.h> #include <stdarg.h> @@ -1489,7 +1488,7 @@ void Config::create() "will interpret the first line (until the first dot) of a JavaDoc-style \n" "comment as the brief description. If set to NO, the JavaDoc \n" "comments will behave just like the Qt-style comments (thus requiring an \n" - "explict @brief command for a brief description. \n", + "explicit @brief command for a brief description. \n", FALSE ); cb = addBool( @@ -1513,7 +1512,7 @@ void Config::create() "INHERIT_DOCS", "If the INHERIT_DOCS tag is set to YES (the default) then an undocumented \n" "member inherits the documentation from any documented member that it \n" - "reimplements. \n", + "re-implements. \n", TRUE ); cb = addBool( @@ -2007,7 +2006,7 @@ void Config::create() "If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can \n" "be used to specify the file name of the resulting .chm file. You \n" "can add a path in front of the file if the result should not be \n" - "written to the html output dir. \n" + "written to the html output directory. \n" ); cs->addDependency("GENERATE_HTML"); cs = addString( @@ -2187,7 +2186,7 @@ void Config::create() cb = addBool( "GENERATE_RTF", "If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output \n" - "The RTF output is optimised for Word 97 and may not look very pretty with \n" + "The RTF output is optimized for Word 97 and may not look very pretty with \n" "other RTF readers or editors.\n", FALSE ); @@ -2222,7 +2221,7 @@ void Config::create() cs = addString( "RTF_STYLESHEET_FILE", "Load stylesheet definitions from file. Syntax is similar to doxygen's \n" - "config file, i.e. a series of assigments. You only have to provide \n" + "config file, i.e. a series of assignments. You only have to provide \n" "replacements, missing definitions are set to their default value. \n" ); cs->setWidgetType(ConfigString::File); @@ -2277,9 +2276,7 @@ void Config::create() "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", + "the code including all documentation. \n", FALSE ); cs = addString( @@ -2500,7 +2497,7 @@ void Config::create() "If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will \n" "generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or \n" "super classes. Setting the tag to NO turns the diagrams off. Note that this \n" - "option is superceded by the HAVE_DOT option below. This is only a fallback. It is \n" + "option is superseded by the HAVE_DOT option below. This is only a fallback. It is \n" "recommended to install and use dot, since it yields more powerful graphs. \n", TRUE ); @@ -2540,7 +2537,7 @@ void Config::create() cb = addBool( "UML_LOOK", "If the UML_LOOK tag is set to YES doxygen will generate inheritance and \n" - "collaboration diagrams in a style similiar to the OMG's Unified Modeling \n" + "collaboration diagrams in a style similar to the OMG's Unified Modeling \n" "Language. \n", FALSE ); diff --git a/src/definition.cpp b/src/definition.cpp index 1e4f287..687ef77 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -207,6 +207,8 @@ void Definition::setDocumentation(const char *d,const char *docFile,int docLine, m_docLine = docLine; } +#define uni_isupper(c) (QChar(c).category()==QChar::Letter_Uppercase) + void Definition::setBriefDescription(const char *b,const char *briefFile,int briefLine) { if (b==0) return; @@ -219,7 +221,7 @@ void Definition::setBriefDescription(const char *b,const char *briefFile,int bri { case '.': case '!': case '?': break; default: - if (isupper(m_brief.at(0))) m_brief+='.'; + if (uni_isupper(m_brief.at(0))) m_brief+='.'; break; } } diff --git a/src/docparser.cpp b/src/docparser.cpp index 1ee90f5..3774a08 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -4782,16 +4782,15 @@ DocNode *validatingParseDoc(const char *fileName,int startLine, if (indexWords && md && Config_getBool("SEARCHENGINE")) { - g_searchUrl=md->getOutputFileBase()+ - Config_getString("HTML_FILE_EXTENSION")+"#"+md->anchor(); + g_searchUrl=md->getOutputFileBase(); Doxygen::searchIndex->setCurrentDoc( theTranslator->trMember(TRUE,TRUE)+" "+md->qualifiedName(), - g_searchUrl); + g_searchUrl, + md->anchor()); } else if (indexWords && ctx && Config_getBool("SEARCHENGINE")) { - g_searchUrl=ctx->getOutputFileBase()+ - Config_getString("HTML_FILE_EXTENSION"); + g_searchUrl=ctx->getOutputFileBase(); QCString name = ctx->qualifiedName(); if (Config_getBool("OPTIMIZE_OUTPUT_JAVA")) { diff --git a/src/dot.cpp b/src/dot.cpp index efaf077..06fa924 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -938,11 +938,12 @@ void DotGfxHierarchyTable::writeGraph(QTextStream &out,const char *path) node->write(md5stream,DotNode::Hierarchy,BITMAP,FALSE,TRUE,1000,TRUE); } } - char md5_sig[16]; + uchar md5_sig[16]; QCString sigStr(33); - md5_buffer(buf.ascii(),buf.length(),md5_sig); - md5_sig_to_string(md5_sig,sigStr.data(),33); - if (checkAndUpdateMd5Signature(baseName,sigStr)) + MD5Buffer(buf.ascii(),buf.length(),md5_sig); + MD5SigToString(md5_sig,sigStr.data(),33); + if (checkAndUpdateMd5Signature(baseName,sigStr) || + !QFileInfo(mapName).exists()) { // image was new or has changed QCString dotName=baseName+".dot"; @@ -1478,10 +1479,10 @@ QCString computeMd5Signature(DotNode *root, pn->write(md5stream,gt,format,TRUE,FALSE,distance,backArrows); } } - char md5_sig[16]; + uchar md5_sig[16]; QCString sigStr(33); - md5_buffer(buf.ascii(),buf.length(),md5_sig); - md5_sig_to_string(md5_sig,sigStr.data(),33); + MD5Buffer(buf.ascii(),buf.length(),md5_sig); + MD5SigToString(md5_sig,sigStr.data(),33); //printf("md5: %s | file: %s\n",sigStr,baseName.data()); return sigStr; } @@ -1492,9 +1493,9 @@ static bool findMaximalDotGraph(DotNode *root, QDir &thisDir, DotNode::GraphType gt, GraphOutputFormat format, - bool lrRank=FALSE, - bool renderParents=FALSE, - bool backArrows=TRUE + bool lrRank /*=FALSE*/, + bool renderParents /*=FALSE*/, + bool backArrows /*=TRUE*/ ) { int minDistance=1; // min distance that shows only direct children. @@ -1506,10 +1507,6 @@ static bool findMaximalDotGraph(DotNode *root, int maxDotGraphHeight = Config_getInt("MAX_DOT_GRAPH_HEIGHT"); int lastFit=minDistance; - QCString md5 = computeMd5Signature(root,gt,format,lrRank, - renderParents,maxDistance,backArrows); - if (!checkAndUpdateMd5Signature(baseName,md5)) return FALSE; - // binary search for the maximal inheritance depth that fits in a reasonable // sized image (dimensions: Config_getInt("MAX_DOT_GRAPH_WIDTH"), Config_getInt("MAX_DOT_GRAPH_HEIGHT")) while (minDistance<=maxDistance) @@ -1631,9 +1628,28 @@ QCString DotClassGraph::writeGraph(QTextStream &out, QCString imgExt = Config_getEnum("DOT_IMAGE_FORMAT"); - if (findMaximalDotGraph(m_startNode,QMIN(m_recDepth,m_maxDistance),baseName, - thisDir,m_graphType,format,!isTBRank,m_graphType==DotNode::Inheritance)) + QCString md5 = computeMd5Signature(m_startNode, // root + m_graphType, // gt + format, // format + !isTBRank, // lrRank + m_graphType==DotNode::Inheritance, // renderParent + QMIN(m_recDepth,m_maxDistance), // maxDist + TRUE // backArrows + ); + if (checkAndUpdateMd5Signature(baseName,md5) || + !QFileInfo(baseName+".map").exists() + ) { + findMaximalDotGraph(m_startNode, // root + QMIN(m_recDepth,m_maxDistance), // maxDist + baseName, // baseName + thisDir, // thisDir + m_graphType, // gt + format, // format + !isTBRank, // lrRank + m_graphType==DotNode::Inheritance, // renderParents + TRUE // backArrows + ); if (format==BITMAP) // run dot to create a bitmap image { QCString dotArgs(maxCmdLine); @@ -1686,7 +1702,7 @@ QCString DotClassGraph::writeGraph(QTextStream &out, if (Config_getBool("DOT_CLEANUP")) thisDir.remove(baseName+".dot"); } - if (format==BITMAP) // run dot to create a bitmap image + if (format==BITMAP && generateImageMap) // run dot to create a image map { QCString mapLabel = convertNameToFile(m_startNode->m_label+"_"+mapName); out << "<p><center><img src=\"" << baseName << "." @@ -1879,11 +1895,28 @@ QCString DotInclDepGraph::writeGraph(QTextStream &out, if (m_inverse) mapName+="dep"; QCString imgExt = Config_getEnum("DOT_IMAGE_FORMAT"); - if (findMaximalDotGraph(m_startNode,QMIN(m_recDepth,m_maxDistance), - baseName,thisDir,DotNode::Dependency,format, - FALSE,FALSE,!m_inverse) + QCString md5 = computeMd5Signature(m_startNode, // root + DotNode::Dependency, // gt + format, // format + FALSE, // lrRank + FALSE, // renderParents + QMIN(m_recDepth,m_maxDistance), // maxDist + !m_inverse // backArrows + ); + if (checkAndUpdateMd5Signature(baseName,md5) || + !QFileInfo(baseName+".map").exists() ) { + findMaximalDotGraph(m_startNode, // root + QMIN(m_recDepth,m_maxDistance), // maxDist + baseName, // baseName + thisDir, // thisDir + DotNode::Dependency, // gt + format, // format + FALSE, // lrRank + FALSE, // renderParents + !m_inverse // backArrows + ); if (format==BITMAP) { // run dot to create a bitmap image @@ -1943,7 +1976,7 @@ QCString DotInclDepGraph::writeGraph(QTextStream &out, if (Config_getBool("DOT_CLEANUP")) thisDir.remove(baseName+".dot"); } - if (format==BITMAP) + if (format==BITMAP && generateImageMap) { out << "<p><center><img src=\"" << baseName << "." << imgExt << "\" border=\"0\" usemap=\"#" @@ -2045,14 +2078,31 @@ QCString DotCallGraph::writeGraph(QTextStream &out, GraphOutputFormat format, QDir thisDir; QCString baseName=m_diskName+"_cgraph"; - //baseName=convertNameToFile(baseName); QCString mapName=baseName; QCString imgExt = Config_getEnum("DOT_IMAGE_FORMAT"); - if (findMaximalDotGraph(m_startNode,QMIN(m_recDepth,m_maxDistance), - baseName,thisDir,DotNode::CallGraph,format, - TRUE,FALSE,FALSE)) + QCString md5 = computeMd5Signature(m_startNode, // root + DotNode::CallGraph, // gt + format, // format + TRUE, // lrRank + FALSE, // renderParents + QMIN(m_recDepth,m_maxDistance), // maxDist + FALSE // backArrows + ); + if (checkAndUpdateMd5Signature(baseName,md5) || + !QFileInfo(baseName+".map").exists() + ) { + findMaximalDotGraph(m_startNode, // root + QMIN(m_recDepth,m_maxDistance), // maxDist + baseName, // baseName + thisDir, // thisDir + DotNode::CallGraph, // gt + format, // format + TRUE, // lrRank + FALSE, // renderParents + FALSE // backArrows + ); if (format==BITMAP) { // run dot to create a bitmap image @@ -2108,7 +2158,7 @@ QCString DotCallGraph::writeGraph(QTextStream &out, GraphOutputFormat format, } } - if (format==BITMAP) + if (format==BITMAP && generateImageMap) { out << "<p><center><img src=\"" << baseName << "." << imgExt << "\" border=\"0\" usemap=\"#" diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 8360acb..03db72d 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -8155,6 +8155,11 @@ void parseInput() inheritDocumentation(); } + // compute the shortest possible names of all files + // without loosing the uniqueness of the file names. + msg("Generating disk names...\n"); + Doxygen::inputNameList.generateDiskNames(); + msg("Adding source references...\n"); addSourceReferences(); @@ -8269,11 +8274,6 @@ void generateOutput() msg("Counting data structures...\n"); countDataStructures(); - // compute the shortest possible names of all files - // without loosing the uniqueness of the file names. - msg("Generating disk names...\n"); - Doxygen::inputNameList.generateDiskNames(); - msg("Resolving user defined references...\n"); resolveUserReferences(); diff --git a/src/filedef.cpp b/src/filedef.cpp index 9f86c2a..161d1fc 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -223,7 +223,7 @@ void FileDef::writeDocumentation(OutputList &ol) if (Config_getBool("SEARCHENGINE")) { - Doxygen::searchIndex->setCurrentDoc(pageTitle,getOutputFileBase()+Config_getString("HTML_FILE_EXTENSION")); + Doxygen::searchIndex->setCurrentDoc(pageTitle,getOutputFileBase()); Doxygen::searchIndex->addWord(localName().lower()); } diff --git a/src/groupdef.cpp b/src/groupdef.cpp index a1ee9a3..b170612 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -427,7 +427,7 @@ void GroupDef::writeDocumentation(OutputList &ol) if (Config_getBool("SEARCHENGINE")) { - Doxygen::searchIndex->setCurrentDoc(title,getOutputFileBase()+Config_getString("HTML_FILE_EXTENSION")); + Doxygen::searchIndex->setCurrentDoc(title,getOutputFileBase()); Doxygen::searchIndex->addWord(localName().lower()); } diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 3ce930d..a47e103 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -817,7 +817,7 @@ void MemberDef::writeDeclaration(OutputList &ol, // write search index info if (Config_getBool("SEARCHENGINE")) { - Doxygen::searchIndex->setCurrentDoc(qualifiedName(),getOutputFileBase()+Config_getString("HTML_FILE_EXTENSION")+"#"+anchor()); + Doxygen::searchIndex->setCurrentDoc(qualifiedName(),getOutputFileBase(),anchor()); Doxygen::searchIndex->addWord(localName().lower()); Doxygen::searchIndex->addWord(qualifiedName().lower()); } diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index 9ca4e89..c2aa94a 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -263,7 +263,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol) if (Config_getBool("SEARCHENGINE")) { - Doxygen::searchIndex->setCurrentDoc(pageTitle,getOutputFileBase()+Config_getString("HTML_FILE_EXTENSION")); + Doxygen::searchIndex->setCurrentDoc(pageTitle,getOutputFileBase()); Doxygen::searchIndex->addWord(localName().lower()); } diff --git a/src/search.php b/src/search.php index 7075ea3..bc4330d 100644 --- a/src/search.php +++ b/src/search.php @@ -276,7 +276,7 @@ function main() $requiredWords = array(); $forbiddenWords = array(); $foundWords = array(); - $word=strtolower(strtok($query," ")); + $word=strtok($query," "); while ($word) // for each word in the search query { if (($word{0}=='+')) { $word=substr($word,1); $requiredWords[]=$word; } @@ -286,7 +286,7 @@ function main() $foundWords[]=$word; search($file,$word,$results); } - $word=strtolower(strtok(" ")); + $word=strtok(" "); } $docs = array(); combine_results($results,$docs); diff --git a/src/search_php.h b/src/search_php.h index 4213b19..2ffa41c 100644 --- a/src/search_php.h +++ b/src/search_php.h @@ -276,7 +276,7 @@ " $requiredWords = array();\n" " $forbiddenWords = array();\n" " $foundWords = array();\n" -" $word=strtolower(strtok($query,\" \"));\n" +" $word=strtok($query,\" \");\n" " while ($word) // for each word in the search query\n" " {\n" " if (($word{0}=='+')) { $word=substr($word,1); $requiredWords[]=$word; }\n" @@ -286,7 +286,7 @@ " $foundWords[]=$word;\n" " search($file,$word,$results);\n" " }\n" -" $word=strtolower(strtok(\" \"));\n" +" $word=strtok(\" \");\n" " }\n" " $docs = array();\n" " combine_results($results,$docs);\n" diff --git a/src/searchindex.cpp b/src/searchindex.cpp index 74834b9..7427ac6 100644 --- a/src/searchindex.cpp +++ b/src/searchindex.cpp @@ -17,6 +17,7 @@ #include "qtbc.h" #include "searchindex.h" +#include "config.h" #include <qfile.h> @@ -59,8 +60,10 @@ SearchIndex::SearchIndex() : m_words(328829), m_index(numIndexEntries), m_urlInd for (i=0;i<numIndexEntries;i++) m_index.insert(i,new QList<IndexWord>); } -void SearchIndex::setCurrentDoc(const char *name,const char *url) +void SearchIndex::setCurrentDoc(const char *name,const char *baseName,const char *anchor) { + QCString url=baseName+Config_getString("HTML_FILE_EXTENSION"); + if (anchor) url+=(QCString)"#"+anchor; m_urlIndex++; m_urls.insert(m_urlIndex,new URL(name,url)); } @@ -84,7 +87,7 @@ void SearchIndex::addWord(const char *word) int idx=charsToIndex(word); if (idx<0) return; w = new IndexWord(word); - //printf("addWord(%s) at index %d\n",word,idx); + //fprintf(stderr,"addWord(%s) at index %d\n",word,idx); m_index[idx]->append(w); m_words.insert(word,w); } diff --git a/src/searchindex.h b/src/searchindex.h index 87fcd70..6f4494e 100644 --- a/src/searchindex.h +++ b/src/searchindex.h @@ -57,7 +57,7 @@ class SearchIndex { public: SearchIndex(); - void setCurrentDoc(const char *name,const char *url); + void setCurrentDoc(const char *name,const char *baseName,const char *anchor=0); void addWord(const char *word); void write(const char *file); private: |