summaryrefslogtreecommitdiff
path: root/src/xmldocvisitor.cpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-10-15 10:55:23 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-10-15 10:55:23 +0900
commit1ec16d649a01d369eecae2f1225c0ffa1caaf640 (patch)
treeed6cfed60d2438db244a7cddec6d4f0cf5fa93f6 /src/xmldocvisitor.cpp
parent5e552810bc3dfc820036b4b16ae53561bb7cf3c6 (diff)
downloaddoxygen-1ec16d649a01d369eecae2f1225c0ffa1caaf640.tar.gz
doxygen-1ec16d649a01d369eecae2f1225c0ffa1caaf640.tar.bz2
doxygen-1ec16d649a01d369eecae2f1225c0ffa1caaf640.zip
Imported Upstream version 1.8.16upstream/1.8.16
Diffstat (limited to 'src/xmldocvisitor.cpp')
-rw-r--r--src/xmldocvisitor.cpp74
1 files changed, 47 insertions, 27 deletions
diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp
index a65695c..a0afa9d 100644
--- a/src/xmldocvisitor.cpp
+++ b/src/xmldocvisitor.cpp
@@ -60,7 +60,7 @@ static void visitPreStart(FTextStream &t, const char *cmd, bool doCaption,
}
if (!name.isEmpty())
{
- t << " name=\"" << name << "\"";
+ t << " name=\"" << convertToXML(name, TRUE) << "\"";
}
if (!width.isEmpty())
{
@@ -70,7 +70,10 @@ static void visitPreStart(FTextStream &t, const char *cmd, bool doCaption,
{
t << " height=\"" << convertToXML(height) << "\"";
}
- if (inlineImage) t << " inline=\"yes\">";
+ if (inlineImage)
+ {
+ t << " inline=\"yes\"";
+ }
if (doCaption)
{
t << " caption=\"";
@@ -187,9 +190,15 @@ void XmlDocVisitor::visit(DocStyleChange *s)
case DocStyleChange::Strike:
if (s->enable()) m_t << "<strike>"; else m_t << "</strike>";
break;
+ case DocStyleChange::Del:
+ if (s->enable()) m_t << "<del>"; else m_t << "</del>";
+ break;
case DocStyleChange::Underline:
if (s->enable()) m_t << "<underline>"; else m_t << "</underline>";
break;
+ case DocStyleChange::Ins:
+ if (s->enable()) m_t << "<ins>"; else m_t << "</ins>";
+ break;
case DocStyleChange::Italic:
if (s->enable()) m_t << "<emphasis>"; else m_t << "</emphasis>";
break;
@@ -296,20 +305,21 @@ void XmlDocVisitor::visit(DocInclude *inc)
{
m_t << "<programlisting filename=\"" << inc->file() << "\">";
QFileInfo cfi( inc->file() );
- FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
Doxygen::parserManager->getParser(inc->extension())
->parseCode(m_ci,inc->context(),
inc->text(),
langExt,
inc->isExample(),
inc->exampleFile(),
- &fd, // fileDef,
+ fd, // fileDef,
-1, // start line
-1, // end line
FALSE, // inline fragment
0, // memberDef
TRUE // show line numbers
);
+ delete fd;
m_t << "</programlisting>";
}
break;
@@ -331,6 +341,7 @@ void XmlDocVisitor::visit(DocInclude *inc)
m_t << "</programlisting>";
break;
case DocInclude::DontInclude:
+ case DocInclude::DontIncWithLines:
break;
case DocInclude::HtmlInclude:
if (inc->isBlock())
@@ -370,7 +381,7 @@ void XmlDocVisitor::visit(DocInclude *inc)
{
m_t << "<programlisting filename=\"" << inc->file() << "\">";
QFileInfo cfi( inc->file() );
- FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
Doxygen::parserManager->getParser(inc->extension())
->parseCode(m_ci,
inc->context(),
@@ -378,13 +389,14 @@ void XmlDocVisitor::visit(DocInclude *inc)
langExt,
inc->isExample(),
inc->exampleFile(),
- &fd,
+ fd,
lineBlock(inc->text(),inc->blockId()),
-1, // endLine
FALSE, // inlineFragment
0, // memberDef
TRUE // show line number
);
+ delete fd;
m_t << "</programlisting>";
}
break;
@@ -398,7 +410,7 @@ void XmlDocVisitor::visit(DocInclude *inc)
void XmlDocVisitor::visit(DocIncOperator *op)
{
- //printf("DocIncOperator: type=%d first=%d, last=%d text=`%s'\n",
+ //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
// op->type(),op->isFirst(),op->isLast(),op->text().data());
if (op->isFirst())
{
@@ -409,16 +421,33 @@ void XmlDocVisitor::visit(DocIncOperator *op)
pushEnabled();
m_hide = TRUE;
}
- SrcLangExt langExt = getLanguageFromFileName(m_langExt);
+ QCString locLangExt = getFileNameExtension(op->includeFileName());
+ if (locLangExt.isEmpty()) locLangExt = m_langExt;
+ SrcLangExt langExt = getLanguageFromFileName(locLangExt);
if (op->type()!=DocIncOperator::Skip)
{
popEnabled();
if (!m_hide)
{
- Doxygen::parserManager->getParser(m_langExt)
+ FileDef *fd = 0;
+ if (!op->includeFileName().isEmpty())
+ {
+ QFileInfo cfi( op->includeFileName() );
+ fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ }
+
+ Doxygen::parserManager->getParser(locLangExt)
->parseCode(m_ci,op->context(),
op->text(),langExt,op->isExample(),
- op->exampleFile());
+ op->exampleFile(),
+ fd, // fileDef
+ op->line(), // startLine
+ -1, // endLine
+ FALSE, // inline fragment
+ 0, // memberDef
+ op->showLineNo() // show line numbers
+ );
+ if (fd) delete fd;
}
pushEnabled();
m_hide=TRUE;
@@ -767,9 +796,7 @@ void XmlDocVisitor::visitPost(DocInternal *)
void XmlDocVisitor::visitPre(DocHRef *href)
{
if (m_hide) return;
- m_t << "<ulink url=\"";
- filter(href->url());
- m_t << "\">";
+ m_t << "<ulink url=\"" << convertToXML(href->url(), TRUE) << "\">";
}
void XmlDocVisitor::visitPost(DocHRef *)
@@ -971,9 +998,9 @@ void XmlDocVisitor::visitPre(DocParamList *pl)
{
QListIterator<DocNode> li(pl->paramTypes());
DocNode *type;
+ m_t << "<parametertype>";
for (li.toFirst();(type=li.current());++li)
{
- m_t << "<parametertype>";
if (type->kind()==DocNode::Kind_Word)
{
visit((DocWord*)type);
@@ -982,8 +1009,13 @@ void XmlDocVisitor::visitPre(DocParamList *pl)
{
visit((DocLinkedWord*)type);
}
- m_t << "</parametertype>" << endl;
+ else if (type->kind()==DocNode::Kind_Sep)
+ {
+ m_t << "</parametertype>" << endl;
+ m_t << "<parametertype>";
+ }
}
+ m_t << "</parametertype>" << endl;
}
m_t << "<parametername";
if (pl->direction()!=DocParamSect::Unspecified)
@@ -1059,18 +1091,6 @@ void XmlDocVisitor::visitPost(DocInternalRef *)
m_t << " ";
}
-void XmlDocVisitor::visitPre(DocCopy *c)
-{
- if (m_hide) return;
- m_t << "<copydoc link=\"" << convertToXML(c->link()) << "\">";
-}
-
-void XmlDocVisitor::visitPost(DocCopy *)
-{
- if (m_hide) return;
- m_t << "</copydoc>" << endl;
-}
-
void XmlDocVisitor::visitPre(DocText *)
{
}