41 for (
int i=0;i<indent;i++) t <<
" ";
86 size_t numChildren = root.
children.size();
130 m_current->children.push_back(std::unique_ptr<Node>(newNode));
165 if (projectName.
isEmpty()) projectName=
"Root";
166 if (!versionText.
isEmpty()) projectName+=
" "+versionText;
175 if (result.
at(0)==
'!')
177 result=result.
mid(1);
192 if (anchor.
isEmpty())
return result;
193 return result+
"#"+anchor;
216 if (!
p->docFile.is_open())
218 term(
"Could not open file %s for writing\n", fileName.
data());
220 p->doc.setStream(&
p->docFile);
222 p->doc <<
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
223 p->doc <<
"<QtHelpProject version=\"1.0\">\n";
234 p->doc <<
"<customFilter name=\"" <<
convertToXML(filterName) <<
"\">\n";
238 for (
const auto &attr : customFilterAttributes)
244 p->doc <<
"</customFilter>\n";
248 p->doc <<
"<filterSection>\n";
253 if (std::find(sectionFilterAttributes.begin(), sectionFilterAttributes.end(),
"doxygen") ==
254 sectionFilterAttributes.end())
256 sectionFilterAttributes.emplace_back(
"doxygen");
258 for (
const auto &attr : sectionFilterAttributes)
266 p->sectionTree.incLevel();
269 p->index <<
"<keywords>\n";
275 p->sectionTree.decLevel();
278 p->sectionTree.writeToc(
p->doc);
282 p->index <<
"</keywords>\n";
283 p->doc <<
p->index.str();
287 p->doc <<
"<files>\n";
288 for (
auto &s :
p->files)
291 p->doc << s.c_str() <<
"\n";
294 p->doc <<
"</files>\n";
297 p->doc <<
"</filterSection>\n";
298 p->doc <<
"</QtHelpProject>\n";
306 p->sectionTree.incLevel();
311 p->sectionTree.decLevel();
331 if (!f.
isEmpty() && f.
at(0)==
'^')
return;
341 if (!blankFile.is_open())
343 term(
"Could not open file %s for writing\n",
qPrint(fileName));
347 blank <<
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
348 blank <<
"<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"" +
theTranslator->trISOLang() +
"\">\n";
350 blank <<
"<title>Validator / crawler helper</title>\n";
351 blank <<
"<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n";
352 blank <<
"<meta http-equiv=\"X-UA-Compatible\" content=\"IE=11\"/>\n";
354 blank <<
"<meta name=\"generator\" content=\"Doxygen " + getDoxygenVersion() +
"\"/>\n";
355 blank <<
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>\n";
356 blank <<
"</head>\n";
358 blank <<
"</body>\n";
359 blank <<
"</html>\n";
366 p->sectionTree.addSection(name,finalRef);
391 p->index <<
"<keyword name=\"" <<
convertToXML(level2 + argStr) <<
"\""
402 p->index <<
"<keyword name=\"" <<
convertToXML(level1) <<
"\""
403 <<
" id=\"" <<
convertToXML(level1 +
"_" + sectionAnchor) <<
"\""
410 p->files.insert((
"<file>" +
convertToXML(fileName) +
"</file>").str());
static bool isFlagSet(const DebugMask mask)
The common base class of all entity definitions found in the sources.
virtual QCString anchor() const =0
virtual QCString getOutputFileBase() const =0
virtual const QCString & name() const =0
static QCString htmlFileExtension
A model of a class/file/namespace member symbol.
virtual QCString argsString() const =0
This is an alternative implementation of QCString.
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
char & at(size_t i)
Returns a reference to the character at index i.
bool isEmpty() const
Returns TRUE iff the string is empty.
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
QhpSectionTree sectionTree
void addImageFile(const QCString &name)
void addIndexFile(const QCString &name)
void addStyleSheetFile(const QCString &name)
static const QCString qhpFileName
void addFile(const QCString &)
static QCString getQchFileName()
void addContentsItem(bool isDir, const QCString &name, const QCString &ref, const QCString &file, const QCString &anchor, bool separateIndex, bool addToNavIndex, const Definition *def)
std::unique_ptr< Private > p
void addIndexItem(const Definition *context, const MemberDef *md, const QCString §ionAnchor, const QCString &title)
void addSection(const QCString &title, const QCString &ref)
void writeToc(TextStream &t) const
void traverse(const Node &root, TextStream &t, int indent) const
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.
#define Config_getString(name)
std::set< std::string > StringSet
std::vector< std::string > StringVector
Translator * theTranslator
std::ofstream openOutputStream(const QCString &name, bool append=false)
Portable versions of functions that are platform dependent.
const char * qPrint(const char *s)
static QCString makeRef(const QCString &withoutExtension, const QCString &anchor)
static std::once_flag g_blankWritten
static QCString makeFileName(const QCString &withoutExtension)
static void writeIndent(TextStream &t, int indent)
static QCString getFullProjectName()
std::vector< std::unique_ptr< Node > > children
Node(Node *parent_, const QCString &title_, const QCString &ref_)
QCString convertToXML(const QCString &s, bool keepEntities)
StringVector split(const std::string &s, const std::string &delimiter)
split input string s by string delimiter delimiter.
void addHtmlExtensionIfMissing(QCString &fName)
A bunch of utility functions.