Doxygen
Loading...
Searching...
No Matches
SearchIndexIntf Class Reference

Abstract proxy interface for non-javascript based search indices. More...

#include <src/searchindex.h>

Public Types

enum  Kind { Disabled , Internal , External }
 
using SearchIndexVariant = std::variant<std::monostate,SearchIndex,SearchIndexExternal>
 

Public Member Functions

 SearchIndexIntf ()
 
bool enabled () const
 
void setCurrentDoc (const Definition *ctx, const QCString &anchor, bool isSourceFile)
 
void addWord (const QCString &word, bool hiPriority)
 
void write (const QCString &file)
 
void setKind (Kind k)
 
Kind kind () const
 

Private Attributes

Kind m_kind
 
SearchIndexVariant m_variant
 

Detailed Description

Abstract proxy interface for non-javascript based search indices.

It forwards calls to either SearchIndex or SearchIndexExternal depending on the Kind passed during construction.

Definition at line 140 of file searchindex.h.

Member Typedef Documentation

◆ SearchIndexVariant

Definition at line 143 of file searchindex.h.

Member Enumeration Documentation

◆ Kind

Enumerator
Disabled 
Internal 
External 

Definition at line 144 of file searchindex.h.

Constructor & Destructor Documentation

◆ SearchIndexIntf()

SearchIndexIntf::SearchIndexIntf ( )
inline

Definition at line 145 of file searchindex.h.

References Disabled, and m_kind.

Member Function Documentation

◆ addWord()

void SearchIndexIntf::addWord ( const QCString & word,
bool hiPriority )
inline

Definition at line 159 of file searchindex.h.

160 {
161 if (std::holds_alternative<SearchIndex>(m_variant))
162 {
163 std::get<SearchIndex>(m_variant).addWord(word,hiPriority);
164 }
165 else if (std::holds_alternative<SearchIndexExternal>(m_variant))
166 {
167 std::get<SearchIndexExternal>(m_variant).addWord(word,hiPriority);
168 }
169 }
SearchIndexVariant m_variant
std::string_view word
Definition util.cpp:980

References m_variant, and word.

◆ enabled()

bool SearchIndexIntf::enabled ( ) const
inline

Definition at line 146 of file searchindex.h.

146{ return m_kind!=Disabled; }

References Disabled, and m_kind.

◆ kind()

Kind SearchIndexIntf::kind ( ) const
inline

Definition at line 190 of file searchindex.h.

190{ return m_kind; }

References m_kind.

◆ setCurrentDoc()

void SearchIndexIntf::setCurrentDoc ( const Definition * ctx,
const QCString & anchor,
bool isSourceFile )
inline

Definition at line 148 of file searchindex.h.

149 {
150 if (std::holds_alternative<SearchIndex>(m_variant))
151 {
152 std::get<SearchIndex>(m_variant).setCurrentDoc(ctx,anchor,isSourceFile);
153 }
154 else if (std::holds_alternative<SearchIndexExternal>(m_variant))
155 {
156 std::get<SearchIndexExternal>(m_variant).setCurrentDoc(ctx,anchor,isSourceFile);
157 }
158 }

References m_variant.

◆ setKind()

void SearchIndexIntf::setKind ( Kind k)
inline

Definition at line 181 of file searchindex.h.

181 {
182 m_kind=k;
183 switch (m_kind)
184 {
185 case Disabled: m_variant = std::monostate(); break;
186 case Internal: m_variant = SearchIndex(); break;
187 case External: m_variant = SearchIndexExternal(); break;
188 }
189 }

References Disabled, External, Internal, m_kind, and m_variant.

◆ write()

void SearchIndexIntf::write ( const QCString & file)
inline

Definition at line 170 of file searchindex.h.

171 {
172 if (std::holds_alternative<SearchIndex>(m_variant))
173 {
174 std::get<SearchIndex>(m_variant).write(file);
175 }
176 else if (std::holds_alternative<SearchIndexExternal>(m_variant))
177 {
178 std::get<SearchIndexExternal>(m_variant).write(file);
179 }
180 }

References m_variant.

Member Data Documentation

◆ m_kind

Kind SearchIndexIntf::m_kind
private

Definition at line 192 of file searchindex.h.

Referenced by enabled(), kind(), SearchIndexIntf(), and setKind().

◆ m_variant

SearchIndexVariant SearchIndexIntf::m_variant
private

Definition at line 193 of file searchindex.h.

Referenced by addWord(), setCurrentDoc(), setKind(), and write().


The documentation for this class was generated from the following file: