#include <memory>
#include <vector>
#include <map>
#include <unordered_map>
#include <string>
#include <array>
#include <functional>
#include "qcstring.h"
浏览源代码.
◆ NUM_SEARCH_INDICES
#define NUM_SEARCH_INDICES 21 |
◆ SearchIndexList
◆ SearchIndexMap
◆ createJavaScriptSearchIndex()
void createJavaScriptSearchIndex |
( |
| ) |
|
在文件 searchindex.cpp 第 751 行定义.
757 if (cd->isLinkable())
790 if (nd->isLinkable())
801 if (cd->isLinkable())
811 for (
const auto &fd : *fn)
814 if (fd->isLinkable())
828 for (
const auto &md : *mn)
841 for (
const auto &md : *mn)
851 if (gd->isLinkable())
853 std::string title = gd->groupTitle().str();
866 if (pd->isLinkable())
868 std::string title = pd->title().str();
891 for (
auto &kv : sii.symbolMap)
894 std::sort(kv.second.begin(),
898 int eq = qstricmp(searchName(d1),searchName(d2));
899 return eq==0 ? qstricmp(d1->name(),d2->name())<0 : eq<0;
引用了 addMemberToSearchIndex(), Doxygen::classLinkedMap, Doxygen::conceptLinkedMap, Config_getBool, convertUTF8ToLower(), ClassDef::Exception, Doxygen::functionNameLinkedMap, g_searchIndexInfo, getUTF8CharAt(), Doxygen::groupLinkedMap, Doxygen::inputNameLinkedMap, ClassDef::Interface, Doxygen::mainPage, Doxygen::memberNameLinkedMap, Doxygen::namespaceLinkedMap, Doxygen::pageLinkedMap, SEARCH_INDEX_ALL, SEARCH_INDEX_CLASSES, SEARCH_INDEX_CONCEPTS, SEARCH_INDEX_EXCEPTIONS, SEARCH_INDEX_FILES, SEARCH_INDEX_GROUPS, SEARCH_INDEX_INTERFACES, SEARCH_INDEX_NAMESPACES, SEARCH_INDEX_PAGES, SEARCH_INDEX_STRUCTS , 以及 ClassDef::Struct.
被这些函数引用 generateOutput().
◆ finalizeSearchIndexer()
void finalizeSearchIndexer |
( |
| ) |
|
◆ getSearchIndices()
◆ initSearchIndexer()
void initSearchIndexer |
( |
| ) |
|
◆ searchId()
◆ searchName()
◆ writeJavaScriptSearchIndex()
void writeJavaScriptSearchIndex |
( |
| ) |
|
在文件 searchindex.cpp 第 905 行定义.
913 for (
const auto &kv : sii.symbolMap)
917 baseName.
sprintf(
"%s_%x",sii.name.data(),p);
920 QCString dataFileName = searchDirName +
"/"+baseName+
".js";
922 std::ofstream t(fileName.
str(), std::ofstream::out | std::ofstream::binary);
923 std::ofstream ti(dataFileName.
str(), std::ofstream::out | std::ofstream::binary);
924 if (t.is_open() && ti.is_open())
927 t <<
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\""
928 " \"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
929 t <<
"<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
930 t <<
"<head><title></title>\n";
931 t <<
"<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n";
932 t <<
"<meta name=\"generator\" content=\"Doxygen " << getDoxygenVersion() <<
"\"/>\n";
933 t <<
"<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n";
934 t <<
"<script type=\"text/javascript\" src=\"" << baseName <<
".js\"></script>\n";
935 t <<
"<script type=\"text/javascript\" src=\"search.js\"></script>\n";
937 t <<
"<body class=\"SRPage\">\n";
938 t <<
"<div id=\"SRIndex\">\n";
940 t <<
"<div id=\"SRResults\"></div>\n";
941 t <<
"<script type=\"text/javascript\">\n";
942 t <<
"/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */\n";
943 t <<
"createResults();\n";
944 t <<
"/* @license-end */\n";
946 t <<
"<div class=\"SRStatus\" id=\"Searching\">"
948 t <<
"<div class=\"SRStatus\" id=\"NoMatches\">"
951 t <<
"<script type=\"text/javascript\">\n";
952 t <<
"/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */\n";
953 t <<
"document.getElementById(\"Loading\").style.display=\"none\";\n";
954 t <<
"document.getElementById(\"NoMatches\").style.display=\"none\";\n";
955 t <<
"var searchResults = new SearchResults(\"searchResults\");\n";
956 t <<
"searchResults.Search();\n";
957 t <<
"window.addEventListener(\"message\", function(event) {\n";
958 t <<
" if (event.data == \"take_focus\") {\n";
959 t <<
" var elem = searchResults.NavNext(0);\n";
960 t <<
" if (elem) elem.focus();\n";
963 t <<
"/* @license-end */\n";
970 ti <<
"var searchData=\n";
982 bool firstEntry=
TRUE;
987 for (
auto it = kv.second.begin(); it!=kv.second.end();)
1002 ti <<
" ['" <<
id <<
"_" << cnt++ <<
"',['" <<
convertToXML(sname) <<
"',[";
1009 const Definition *next = it!=kv.second.end() ? *it : 0;
1023 ti <<
"#" << anchor;
1027 static bool extLinksInWindow =
Config_getBool(EXT_LINKS_IN_WINDOW);
1037 if (lastName!=sname && (next==0 ||
searchName(next)!=sname))
1060 bool overloadedFunction = ((prevScope!=0 && scope==prevScope) ||
1064 if (overloadedFunction)
1092 if (!prefix.
isEmpty()) prefix+=
": ";
1116 ti <<
"'" << name <<
"'";
1131 err(
"Failed to open file '%s' for writing...\n",
qPrint(fileName));
1138 std::ofstream t(searchDirName.
str()+
"/searchdata.js",
1139 std::ofstream::out | std::ofstream::binary);
1142 t <<
"var indexSectionsWithContent =\n";
1147 if (!sii.symbolMap.empty())
1149 if (j>0) t <<
",\n";
1150 t <<
" " << j <<
": \"";
1152 for (
const auto &kv : sii.symbolMap)
1154 if ( kv.first ==
"\"" ) t <<
"\\";
1163 t <<
"var indexSectionNames =\n";
1168 if (!sii.symbolMap.empty())
1170 if (j>0) t <<
",\n";
1171 t <<
" " << j <<
": \"" << sii.name <<
"\"";
1177 t <<
"var indexSectionLabels =\n";
1182 if (!sii.symbolMap.empty())
1184 if (j>0) t <<
",\n";
1185 t <<
" " << j <<
": \"" <<
convertToXML(sii.getText()) <<
"\"";
1197 std::ofstream t(noMatchesFileName.
str(), std::ofstream::out | std::ofstream::binary);
1200 t <<
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" "
1201 "\"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
1202 t <<
"<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
1203 t <<
"<head><title></title>\n";
1204 t <<
"<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n";
1205 t <<
"<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n";
1206 t <<
"<script type=\"text/javascript\" src=\"search.js\"></script>\n";
1208 t <<
"<body class=\"SRPage\">\n";
1209 t <<
"<div id=\"SRIndex\">\n";
1210 t <<
"<div class=\"SRStatus\" id=\"NoMatches\">"
引用了 addHtmlExtensionIfMissing(), IndexList::addStyleSheetFile(), Definition::anchor(), MemberDef::argsString(), Config_getBool, Config_getString, convertToXML(), ResourceMgr::copyResource(), Definition::definitionType(), err(), externalRef(), FALSE, g_searchIndexInfo, Definition::getBodyDef(), MemberDef::getClassDef(), MemberDef::getFileDef(), Definition::getLanguage(), getLanguageSpecificSeparator(), MemberDef::getNamespaceDef(), Definition::getOuterScope(), Definition::getOutputFileBase(), Definition::getReference(), Doxygen::globalScope, Doxygen::htmlFileExtension, Doxygen::indexList, ResourceMgr::instance(), QCString::isEmpty(), MemberDef::isFunction(), MemberDef::isSlot(), Definition::localName(), Definition::name(), qPrint(), Definition::qualifiedName(), MemberDef::resolveAlias(), searchId(), searchName(), QCString::sprintf(), QCString::str(), theTranslator, toClassDef(), toMemberDef(), toNamespaceDef(), Translator::trGlobalNamespace(), Translator::trLoading(), Translator::trNoMatches(), Translator::trSearching(), TRUE, Definition::TypeClass , 以及 Definition::TypeNamespace.
被这些函数引用 generateOutput().
bool copyResource(const QCString &name, const QCString &targetDir) const
Copies a registered resource to a given target directory
static ResourceMgr & instance()
Returns the one and only instance of this class
GroupDef * toGroupDef(Definition *d)
static std::unique_ptr< PageDef > mainPage
virtual QCString argsString() const =0
std::string convertUTF8ToLower(const std::string &input)
Converts the input string into a lower case version, also taking into account non-ASCII characters th...
The common base class of all entity definitions found in the sources.
#define SEARCH_INDEX_NAMESPACES
#define SEARCH_INDEX_CLASSES
static ConceptLinkedMap * conceptLinkedMap
bool isEmpty() const
Returns TRUE iff the string is empty
static PageLinkedMap * pageLinkedMap
static IndexList * indexList
#define SEARCH_INDEX_INTERFACES
void addStyleSheetFile(const QCString &name)
virtual QCString trGlobalNamespace()=0
MemberDef * toMemberDef(Definition *d)
SrcLangExt
Language as given by extension
static NamespaceDefMutable * globalScope
#define SEARCH_INDEX_GROUPS
void err(const char *fmt,...)
Text streaming class that buffers data.
virtual QCString trNoMatches()=0
#define SEARCH_INDEX_PAGES
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
PageDef * toPageDef(Definition *d)
static FileNameLinkedMap * inputNameLinkedMap
virtual const FileDef * getBodyDef() const =0
#define SEARCH_INDEX_CONCEPTS
virtual QCString qualifiedName() const =0
QCString addHtmlExtensionIfMissing(const QCString &fName)
A model of a class/file/namespace member symbol.
static MemberNameLinkedMap * functionNameLinkedMap
virtual bool isSlot() const =0
QCString searchName(const Definition *d)
Translator * theTranslator
virtual QCString name() const =0
static GroupLinkedMap * groupLinkedMap
virtual MemberDef * resolveAlias()=0
virtual const ClassDef * getClassDef() const =0
std::string getUTF8CharAt(const std::string &input, size_t pos)
Returns the UTF8 character found at byte position pos in the input string.
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Returns the scope separator to use given the programming language lang
virtual bool isFunction() const =0
#define SEARCH_INDEX_STRUCTS
virtual QCString getOutputFileBase() const =0
virtual const NamespaceDef * getNamespaceDef() const =0
virtual QCString trSearching()=0
std::string str() const
Return the contents of the buffer as a std::string object
ClassDef * toClassDef(Definition *d)
QCString searchId(const Definition *d)
virtual DefType definitionType() const =0
static std::array< SearchIndexInfo, NUM_SEARCH_INDICES > g_searchIndexInfo
virtual QCString getReference() const =0
static SearchIndexIntf * searchIndex
static MemberNameLinkedMap * memberNameLinkedMap
virtual QCString anchor() const =0
#define SEARCH_INDEX_FILES
#define Config_getBool(name)
NamespaceDef * toNamespaceDef(Definition *d)
static QCString htmlFileExtension
virtual Definition * getOuterScope() const =0
#define SEARCH_INDEX_EXCEPTIONS
const char * qPrint(const char *s)
virtual const FileDef * getFileDef() const =0
#define Config_getString(name)
static NamespaceLinkedMap * namespaceLinkedMap
QCString convertToXML(const QCString &s, bool keepEntities)
A model of a file symbol.
QCString externalRef(const QCString &relPath, const QCString &ref, bool href)
static ClassLinkedMap * classLinkedMap
virtual QCString localName() const =0
static void addMemberToSearchIndex(const MemberDef *md)
QCString & sprintf(const char *format,...)
virtual QCString trLoading()=0
This is an alternative implementation of QCString.