Skip to main content

SearchTerm Struct

Searchable term. More...

Declaration​

struct SearchTerm { ... }

Included Headers​

Public Member Typedefs Index​

usingLinkInfo = std::variant< std::monostate, const Definition *, const SectionInfo * >

Public Constructors Index​

SearchTerm (const QCString &w, const Definition *d)
SearchTerm (const QCString &w, const SectionInfo *s)

Public Member Functions Index​

QCStringtermEncoded () const

encoded version of the search term More...

Private Member Functions Index​

voidmakeTitle ()

Public Member Attributes Index​

QCStringword

lower case word that is indexed (e.g. name of a symbol, or word from a title) More...

QCStringtitle

title to show in the output for this search result More...

LinkInfoinfo

definition to link to More...

Description​

Searchable term.

Definition at line 42 of file searchindex_js.h.

Public Member Typedefs​

LinkInfo​

using SearchTerm::LinkInfo = std::variant<std::monostate,const Definition *,const SectionInfo *>

Definition at line 44 of file searchindex_js.h.

44 using LinkInfo = std::variant<std::monostate,const Definition *,const SectionInfo *>;

Public Constructors​

SearchTerm()​

SearchTerm::SearchTerm (const QCString & w, const Definition * d)
inline

Definition at line 45 of file searchindex_js.h.

45 SearchTerm(const QCString &w,const Definition *d) : word(w.str()), info(d) { makeTitle(); }

References info, makeTitle and word.

SearchTerm()​

SearchTerm::SearchTerm (const QCString & w, const SectionInfo * s)
inline

Definition at line 46 of file searchindex_js.h.

46 SearchTerm(const QCString &w,const SectionInfo *s) : word(w.str()), info(s) { makeTitle(); }

References info, makeTitle and word.

Public Member Functions​

termEncoded()​

QCString SearchTerm::termEncoded ()

encoded version of the search term

Declaration at line 50 of file searchindex_js.h, definition at line 62 of file searchindex_js.cpp.

63{
65 for (size_t i=0;i<word.length();i++)
66 {
67 if (isIdJS(word.at(i)))
68 {
69 t << word.at(i);
70 }
71 else // escape non-identifier characters
72 {
73 static const char *hex = "0123456789ABCDEF";
74 unsigned char uc = static_cast<unsigned char>(word.at(i));
75 t << '_';
76 t << hex[uc>>4];
77 t << hex[uc&0xF];
78 }
79 }
80
81 return convertUTF8ToLower(t.str());
82}

References convertUTF8ToLower, hex, isIdJS, TextStream::str and word.

Private Member Functions​

makeTitle()​

void SearchTerm::makeTitle ()

Declaration at line 52 of file searchindex_js.h, definition at line 41 of file searchindex_js.cpp.

42{
43 if (std::holds_alternative<const Definition *>(info))
44 {
45 const Definition *def = std::get<const Definition *>(info);
47 title = type==Definition::TypeGroup ? parseCommentAsHtml(def,nullptr,toGroupDef(def)->groupTitle(),def->getDefFileName(),def->getDefLine()) :
48 type==Definition::TypePage ? parseCommentAsHtml(def,nullptr,toPageDef(def)->title(),def->getDefFileName(),def->getDefLine()) :
49 def->localName();
50 }
51 else if (std::holds_alternative<const SectionInfo *>(info))
52 {
53 const SectionInfo *si = std::get<const SectionInfo *>(info);
54 title = parseCommentAsHtml(si->definition(),nullptr,si->title(),si->fileName(),si->lineNr());
55 }
56 else
57 {
58 assert(false);
59 }
60}

References SectionInfo::definition, Definition::definitionType, SectionInfo::fileName, Definition::getDefFileName, Definition::getDefLine, info, SectionInfo::lineNr, Definition::localName, parseCommentAsHtml, title, SectionInfo::title, toGroupDef, toPageDef, Definition::TypeGroup and Definition::TypePage.

Referenced by SearchTerm and SearchTerm.

Public Member Attributes​

info​

LinkInfo SearchTerm::info

definition to link to

Definition at line 49 of file searchindex_js.h.

49 LinkInfo info; //!< definition to link to

Referenced by makeTitle, SearchTerm and SearchTerm.

title​

QCString SearchTerm::title

title to show in the output for this search result

Definition at line 48 of file searchindex_js.h.

48 QCString title; //!< title to show in the output for this search result

Referenced by makeTitle.

word​

QCString SearchTerm::word

lower case word that is indexed (e.g. name of a symbol, or word from a title)

Definition at line 47 of file searchindex_js.h.

47 QCString word; //!< lower case word that is indexed (e.g. name of a symbol, or word from a title)

Referenced by SearchTerm, SearchTerm and termEncoded.


The documentation for this struct was generated from the following files:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.14.0.