41 for (
int i=0;i<indent;i++) t <<
" ";
56 Node(
Node *parent_,
const QCString &title_,
const QCString &ref_)
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)
241 p->doc <<
"<filterAttribute>" <<
convertToXML(QCString(attr)) <<
"</filterAttribute>\n";
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)
261 p->doc <<
"<filterAttribute>" <<
convertToXML(QCString(attr)) <<
"</filterAttribute>\n";
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";
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";
365 QCString finalRef =
makeRef(f, anchor);
366 p->sectionTree.addSection(name,finalRef);
382 QCString level1 = context->
name();
384 QCString anchor = !sectionAnchor.
isEmpty() ? sectionAnchor : md->
anchor();
389 QCString
id = level1+
"::"+level2;
391 p->index <<
"<keyword name=\"" <<
convertToXML(level2 + argStr) <<
"\""
400 QCString ref =
makeRef(contRef,sectionAnchor);
402 p->index <<
"<keyword name=\"" <<
convertToXML(level1) <<
"\""
403 <<
" id=\"" <<
convertToXML(level1 +
"_" + sectionAnchor) <<
"\""
410 p->files.insert((
"<file>" +
convertToXML(fileName) +
"</file>").str());
439 return QCString(
"../qch/")
440 + (projectName.
isEmpty() ? QCString(
"index") : projectName)
441 + (versionText.
isEmpty() ? QCString(
"") : QCString(
"-") + versionText)
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.
virtual QCString trISOLang()=0
#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.