42 for (
int i=0;i<indent;i++) t <<
" ";
87 size_t numChildren = root.
children.size();
166 if (projectName.
empty()) projectName=
"Root";
167 if (!versionText.
empty()) projectName+=
" "+versionText;
173 DString result=withoutExtension;
176 if (result.
at(0)==
'!')
178 result=result.
mid(1);
193 if (anchor.
empty())
return result;
194 return result+
"#"+anchor;
217 if (!
p->docFile.is_open())
219 term(
"Could not open file {} for writing\n",fileName);
221 p->doc.setStream(&
p->docFile);
223 p->doc <<
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
224 p->doc <<
"<QtHelpProject version=\"1.0\">\n";
232 if (!filterName.
empty())
235 p->doc <<
"<customFilter name=\"" <<
convertToXML(filterName) <<
"\">\n";
239 for (
const auto &attr : customFilterAttributes)
242 p->doc <<
"<filterAttribute>" <<
convertToXML(attr) <<
"</filterAttribute>\n";
245 p->doc <<
"</customFilter>\n";
249 p->doc <<
"<filterSection>\n";
254 if (std::find(sectionFilterAttributes.begin(), sectionFilterAttributes.end(),
"doxygen") ==
255 sectionFilterAttributes.end())
257 sectionFilterAttributes.emplace_back(
"doxygen");
259 for (
const auto &attr : sectionFilterAttributes)
262 p->doc <<
"<filterAttribute>" <<
convertToXML(attr) <<
"</filterAttribute>\n";
267 p->sectionTree.incLevel();
270 p->index <<
"<keywords>\n";
276 p->sectionTree.decLevel();
279 p->sectionTree.writeToc(
p->doc);
283 p->index <<
"</keywords>\n";
284 p->doc <<
p->index.str();
288 p->doc <<
"<files>\n";
289 for (
auto &s :
p->files)
295 p->doc <<
"</files>\n";
298 p->doc <<
"</filterSection>\n";
299 p->doc <<
"</QtHelpProject>\n";
307 p->sectionTree.incLevel();
312 p->sectionTree.decLevel();
330 if (!f.
empty() && f.
at(0)==
'^')
return;
340 if (!blankFile.is_open())
342 term(
"Could not open file {} for writing\n",fileName);
346 blank <<
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
349 blank <<
"<title>Validator / crawler helper</title>\n";
350 blank <<
"<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n";
351 blank <<
"<meta http-equiv=\"X-UA-Compatible\" content=\"IE=11\"/>\n";
353 blank <<
"<meta name=\"generator\" content=\"Doxygen " + getDoxygenVersion() +
"\"/>\n";
354 blank <<
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>\n";
355 blank <<
"</head>\n";
357 blank <<
"</body>\n";
358 blank <<
"</html>\n";
365 p->sectionTree.addSection(name,finalRef);
388 DString id = level1+
"::"+level2;
390 p->index <<
"<keyword name=\"" <<
convertToXML(level2 + argStr) <<
"\""
401 p->index <<
"<keyword name=\"" <<
convertToXML(level1) <<
"\""
402 <<
" id=\"" <<
convertToXML(level1 +
"_" + sectionAnchor) <<
"\""
409 p->files.insert((
"<file>" +
convertToXML(fileName) +
"</file>").str());
430 if (!qchFile.
empty())
439 + (projectName.
empty() ?
DString(
"index") : projectName)
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
DString mid(size_t index, size_t len=npos) const
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
char & at(size_t i)
Returns a reference to the character at index i.
static bool isFlagSet(const DebugMask mask)
The common base class of all entity definitions found in the sources.
virtual const DString & name() const =0
virtual bool hasDocumentation() const =0
virtual DString anchor() const =0
virtual DString getOutputFileBase() const =0
Class representing a directory in the file system.
static DString htmlFileExtension
A model of a class/file/namespace member symbol.
virtual DString argsString() const =0
QhpSectionTree sectionTree
void addIndexFile(const DString &name)
std::unique_ptr< Private > p
static DString getQchFileName()
void addContentsItem(bool isDir, const DString &name, const DString &ref, const DString &file, const DString &anchor, bool separateIndex, bool addToNavIndex, const Definition *def, const DString &)
void addIndexItem(const Definition *context, const MemberDef *md, const DString §ionAnchor, const DString &title)
void addStyleSheetFile(const DString &name)
void addFile(const DString &)
static const DString qhpFileName
void addImageFile(const DString &name)
void writeToc(TextStream &t) const
void traverse(const Node &root, TextStream &t, int indent) const
void addSection(const DString &title, const DString &ref)
Text streaming class that buffers data.
void setStream(std::ostream *s)
Sets or changes the std::ostream to write to.
void flush()
Flushes the buffer.
virtual DString trISOLang()=0
#define Config_getString(name)
std::set< std::string > StringSet
std::vector< std::string > StringVector
Translator * theTranslator
std::ofstream openOutputStream(const DString &name, bool append=false)
Portable versions of functions that are platform dependent.
static DString makeFileName(const DString &withoutExtension)
static DString getFullProjectName()
static DString makeRef(const DString &withoutExtension, const DString &anchor)
static std::once_flag g_blankWritten
static void writeIndent(TextStream &t, int indent)
Some helper functions for std::string.
StringVector split(const std::string &s, const std::string &delimiter)
split input string s by string delimiter delimiter.
Node(Node *parent_, const DString &title_, const DString &ref_)
std::vector< std::unique_ptr< Node > > children
void addHtmlExtensionIfMissing(DString &fName)
DString convertToXML(const DString &s, bool keepEntities, const bool citeEntry)
A bunch of utility functions.