Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
doxygen-1.8.11
src
searchindex.h
Go to the documentation of this file.
1
/******************************************************************************
2
*
3
*
4
*
5
* Copyright (C) 1997-2015 by Dimitri van Heesch.
6
*
7
* Permission to use, copy, modify, and distribute this software and its
8
* documentation under the terms of the GNU General Public License is hereby
9
* granted. No representations are made about the suitability of this software
10
* for any purpose. It is provided "as is" without express or implied warranty.
11
* See the GNU General Public License for more details.
12
*
13
* Documents produced by Doxygen are derivative works derived from the
14
* input used in their production; they are not affected by this license.
15
*
16
*/
17
18
#ifndef _SEARCHINDEX_H
19
#define _SEARCHINDEX_H
20
21
#include <
qintdict.h
>
22
#include <
qlist.h
>
23
#include <
qdict.h
>
24
#include <
qintdict.h
>
25
#include <
qvector.h
>
26
#include "
sortdict.h
"
27
#include "
definition.h
"
28
#include "
util.h
"
29
30
class
FTextStream
;
31
class
Definition
;
32
class
MemberDef
;
33
34
/*! Initialize the search indexer */
35
void
initSearchIndexer
();
36
/*! Cleanup the search indexer */
37
void
finializeSearchIndexer
();
38
39
//------- server side search index ----------------------
40
41
struct
URL
42
{
43
URL
(
const
char
*
n
,
const
char
*u) :
name
(n),
url
(u) {}
44
QCString
name
;
45
QCString
url
;
46
};
47
48
49
struct
URLInfo
50
{
51
URLInfo
(
int
idx,
int
f
) : urlIdx(idx), freq(f) {}
52
int
urlIdx
;
53
int
freq
;
54
};
55
56
class
IndexWord
57
{
58
public
:
59
IndexWord
(
const
char
*
word
);
60
void
addUrlIndex(
int
,
bool
);
61
const
QIntDict<URLInfo>
&
urls
()
const
{
return
m_urls; }
62
QCString
word
()
const
{
return
m_word; }
63
64
private
:
65
QCString
m_word
;
66
QIntDict<URLInfo>
m_urls
;
67
};
68
69
class
SearchIndexIntf
70
{
71
public
:
72
enum
Kind
{ Internal, External };
73
SearchIndexIntf
(
Kind
k
) : m_kind(k) {}
74
virtual
~SearchIndexIntf
() {}
75
virtual
void
setCurrentDoc
(
Definition
*ctx,
const
char
*anchor,
bool
isSourceFile) = 0;
76
virtual
void
addWord(
const
char
*
word
,
bool
hiPriority) = 0;
77
virtual
void
write
(
const
char
*
file
) = 0;
78
Kind
kind
()
const
{
return
m_kind; }
79
private
:
80
Kind
m_kind
;
81
};
82
83
class
SearchIndex
:
public
SearchIndexIntf
84
{
85
public
:
86
SearchIndex
();
87
void
setCurrentDoc
(
Definition
*ctx,
const
char
*anchor,
bool
isSourceFile);
88
void
addWord(
const
char
*
word
,
bool
hiPriority);
89
void
write
(
const
char
*
file
);
90
private
:
91
void
addWord(
const
char
*word,
bool
hiPrio,
bool
recurse);
92
QDict<IndexWord>
m_words
;
93
QVector< QList<IndexWord>
>
m_index
;
94
QDict<int>
m_url2IdMap
;
95
QIntDict<URL>
m_urls
;
96
int
m_urlIndex
;
97
};
98
99
100
class
SearchIndexExternal
:
public
SearchIndexIntf
101
{
102
struct
Private
;
103
public
:
104
SearchIndexExternal
();
105
~
SearchIndexExternal
();
106
void
setCurrentDoc
(
Definition
*ctx,
const
char
*anchor,
bool
isSourceFile);
107
void
addWord(
const
char
*
word
,
bool
hiPriority);
108
void
write
(
const
char
*
file
);
109
private
:
110
Private
*
p
;
111
};
112
113
//------- client side search index ----------------------
114
115
#define SEARCH_INDEX_ALL 0
116
#define SEARCH_INDEX_CLASSES 1
117
#define SEARCH_INDEX_NAMESPACES 2
118
#define SEARCH_INDEX_FILES 3
119
#define SEARCH_INDEX_FUNCTIONS 4
120
#define SEARCH_INDEX_VARIABLES 5
121
#define SEARCH_INDEX_TYPEDEFS 6
122
#define SEARCH_INDEX_ENUMS 7
123
#define SEARCH_INDEX_ENUMVALUES 8
124
#define SEARCH_INDEX_PROPERTIES 9
125
#define SEARCH_INDEX_EVENTS 10
126
#define SEARCH_INDEX_RELATED 11
127
#define SEARCH_INDEX_DEFINES 12
128
#define SEARCH_INDEX_GROUPS 13
129
#define SEARCH_INDEX_PAGES 14
130
#define NUM_SEARCH_INDICES 15
131
132
class
SearchDefinitionList
:
public
QList
<Definition>
133
{
134
public
:
135
SearchDefinitionList
(
const
QCString
&
id
,
const
QCString
&
name
) : m_id(id), m_name(name) {}
136
QCString
id
()
const
{
return
m_id; }
137
QCString
name
()
const
{
return
m_name; }
138
private
:
139
QCString
m_id
;
140
QCString
m_name
;
141
};
142
143
class
SearchIndexList
:
public
SDict
< SearchDefinitionList >
144
{
145
public
:
146
typedef
Definition
ElementType
;
147
SearchIndexList
(
uint
letter);
148
~
SearchIndexList
();
149
void
append(
Definition
*
d
);
150
uint
letter()
const
;
151
private
:
152
int
compareValues(
const
SearchDefinitionList
*md1,
const
SearchDefinitionList
*md2)
const
;
153
uint
m_letter
;
154
};
155
156
struct
SearchIndexInfo
157
{
158
LetterToIndexMap<SearchIndexList>
symbolList
;
159
QCString
name
;
160
QCString
text
;
161
};
162
163
void
createJavascriptSearchIndex
();
164
void
writeJavascriptSearchIndex
();
165
const
SearchIndexInfo
*
getSearchIndices
();
166
167
#endif
QIntDict< URLInfo >
SearchIndex
Definition:
searchindex.h:83
keras_to_tensorflow.f
f
Definition:
keras_to_tensorflow.py:162
SearchDefinitionList::m_id
QCString m_id
Definition:
searchindex.h:139
Definition
Definition:
definition.h:92
IndexWord::word
QCString word() const
Definition:
searchindex.h:62
SearchIndexInfo
Definition:
searchindex.h:156
MemberDef
Definition:
memberdef.h:43
writeJavascriptSearchIndex
void writeJavascriptSearchIndex()
Definition:
searchindex.cpp:903
finializeSearchIndexer
void finializeSearchIndexer()
Definition:
searchindex.cpp:1320
SearchIndexIntf::~SearchIndexIntf
virtual ~SearchIndexIntf()
Definition:
searchindex.h:74
SearchIndex::m_url2IdMap
QDict< int > m_url2IdMap
Definition:
searchindex.h:94
SearchIndex::m_index
QVector< QList< IndexWord > > m_index
Definition:
searchindex.h:93
definition.h
bump_copyright.d
string d
Definition:
bump_copyright.py:70
IndexWord::m_urls
QIntDict< URLInfo > m_urls
Definition:
searchindex.h:66
write
size_t write(int, const char *, size_t)
Writes count bytes from buf to the filedescriptor fd.
SearchIndexList::ElementType
Definition ElementType
Definition:
searchindex.h:146
FTextStream
Simplified and optimized version of QTextStream.
Definition:
ftextstream.h:11
QVector
Definition:
qvector.h:46
SearchIndexList::m_letter
uint m_letter
Definition:
searchindex.h:153
qvector.h
SearchIndexIntf::kind
Kind kind() const
Definition:
searchindex.h:78
SearchDefinitionList::id
QCString id() const
Definition:
searchindex.h:136
SDict
Definition:
sortdict.h:73
initSearchIndexer
void initSearchIndexer()
Definition:
searchindex.cpp:1298
SearchIndex::m_urls
QIntDict< URL > m_urls
Definition:
searchindex.h:95
SearchDefinitionList::m_name
QCString m_name
Definition:
searchindex.h:140
URLInfo
Definition:
searchindex.h:49
cet::n
std::void_t< T > n
Definition:
metaprogramming.h:28
cache_state.file
file
Definition:
cache_state.py:421
SearchIndex::m_urlIndex
int m_urlIndex
Definition:
searchindex.h:96
URLInfo::URLInfo
URLInfo(int idx, int f)
Definition:
searchindex.h:51
SearchDefinitionList
Definition:
searchindex.h:132
util.h
A bunch of utility functions.
URL
Definition:
searchindex.h:41
LetterToIndexMap< SearchIndexList >
SearchIndexInfo::text
QCString text
Definition:
searchindex.h:160
sortdict.h
URL::URL
URL(const char *n, const char *u)
Definition:
searchindex.h:43
SearchIndexIntf::SearchIndexIntf
SearchIndexIntf(Kind k)
Definition:
searchindex.h:73
SearchDefinitionList::SearchDefinitionList
SearchDefinitionList(const QCString &id, const QCString &name)
Definition:
searchindex.h:135
SearchIndexExternal
Definition:
searchindex.h:100
URLInfo::freq
int freq
Definition:
searchindex.h:53
getSearchIndices
const SearchIndexInfo * getSearchIndices()
Definition:
searchindex.cpp:1247
SearchIndexIntf::m_kind
Kind m_kind
Definition:
searchindex.h:80
IndexWord::urls
const QIntDict< URLInfo > & urls() const
Definition:
searchindex.h:61
SearchIndexIntf::Kind
Kind
Definition:
searchindex.h:72
IndexWord
Definition:
searchindex.h:56
SearchIndexIntf
Definition:
searchindex.h:69
SearchIndexExternal::p
Private * p
Definition:
searchindex.h:110
qdict.h
setCurrentDoc
static void setCurrentDoc(const QCString &anchor)
Definition:
code.cpp:10966
URLInfo::urlIdx
int urlIdx
Definition:
searchindex.h:52
URL::name
QCString name
Definition:
searchindex.h:44
IndexWord::m_word
QCString m_word
Definition:
searchindex.h:65
muoncounters.k
k
Definition:
muoncounters.py:27
SearchIndexInfo::name
QCString name
Definition:
searchindex.h:159
SearchIndex::m_words
QDict< IndexWord > m_words
Definition:
searchindex.h:92
SearchIndexExternal::Private
Definition:
searchindex.cpp:425
SearchIndexInfo::symbolList
LetterToIndexMap< SearchIndexList > symbolList
Definition:
searchindex.h:158
qlist.h
QCString
Definition:
qcstring.h:131
createJavascriptSearchIndex
void createJavascriptSearchIndex()
Definition:
searchindex.cpp:718
uint
unsigned uint
Definition:
qglobal.h:351
ptb::content::word::word
union ptb::content::word::word word
SearchIndexList
Definition:
searchindex.h:143
qintdict.h
URL::url
QCString url
Definition:
searchindex.h:45
QList
Definition:
qlist.h:54
SearchDefinitionList::name
QCString name() const
Definition:
searchindex.h:137
Generated by
1.8.11