summaryrefslogtreecommitdiffstats
path: root/src/searchindex.h
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2003-08-08 12:54:22 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2003-08-08 12:54:22 (GMT)
commitd09056a74447fe1c841ffd469986afdffd99765b (patch)
tree7c2d3f65b509d762729291b5341f0751138192fd /src/searchindex.h
parent8c1096fc0147c36d3e026ec093b2c5f9158ae01d (diff)
downloadDoxygen-d09056a74447fe1c841ffd469986afdffd99765b.zip
Doxygen-d09056a74447fe1c841ffd469986afdffd99765b.tar.gz
Doxygen-d09056a74447fe1c841ffd469986afdffd99765b.tar.bz2
Release-1.3.3-20030808
Diffstat (limited to 'src/searchindex.h')
-rw-r--r--src/searchindex.h50
1 files changed, 49 insertions, 1 deletions
diff --git a/src/searchindex.h b/src/searchindex.h
index f5ae41c..f9d9c2f 100644
--- a/src/searchindex.h
+++ b/src/searchindex.h
@@ -22,9 +22,12 @@
#include <qintdict.h>
#include <qlist.h>
#include <qdict.h>
+#include <qintdict.h>
+#include <qvector.h>
-#include "suffixtree.h"
+#if 0 // old version
+#include "suffixtree.h"
//class IndexTree;
class SuffixTree;
@@ -70,3 +73,48 @@ class SearchIndex
};
#endif
+
+struct URL
+{
+ URL(const char *n,const char *u) : name(n), url(u) {}
+ QCString name;
+ QCString url;
+};
+
+
+struct URLInfo
+{
+ URLInfo(int idx,int f) : urlIdx(idx), freq(f) {}
+ int urlIdx;
+ int freq;
+};
+
+class IndexWord
+{
+ public:
+ IndexWord(const char *word);
+ void addUrlIndex(int);
+ const QIntDict<URLInfo> &urls() const { return m_urls; }
+ QCString word() const { return m_word; }
+
+ private:
+ QCString m_word;
+ QIntDict<URLInfo> m_urls;
+};
+
+class SearchIndex
+{
+ public:
+ SearchIndex();
+ void setCurrentDoc(const char *name,const char *url);
+ void addWord(const char *word);
+ void write(const char *file);
+ private:
+ QDict<IndexWord> m_words;
+ QVector< QList<IndexWord> > m_index;
+ QIntDict<URL> m_urls;
+ int m_urlIndex;
+};
+
+
+#endif