summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@nokia.com>2011-01-12 08:28:22 (GMT)
committerMartin Smith <martin.smith@nokia.com>2011-01-12 08:28:22 (GMT)
commitde01273493d6380ec8eaa2cc801dbe8939788d00 (patch)
treed8fa28d14658b7651b86decca71c8ca3af0c95c3 /tools
parentf9400e81d6e817eb16651e01bb3710cf8562c926 (diff)
downloadQt-de01273493d6380ec8eaa2cc801dbe8939788d00.zip
Qt-de01273493d6380ec8eaa2cc801dbe8939788d00.tar.gz
Qt-de01273493d6380ec8eaa2cc801dbe8939788d00.tar.bz2
qdoc: Replaced many raw-html cases with \div {something}.
Only 27 raw-html uses remaining.
Diffstat (limited to 'tools')
-rw-r--r--tools/qdoc3/ditaxmlgenerator.cpp1665
-rw-r--r--tools/qdoc3/ditaxmlgenerator.h151
-rw-r--r--tools/qdoc3/generator.cpp1
3 files changed, 981 insertions, 836 deletions
diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp
index f9c8cc5..e99af42 100644
--- a/tools/qdoc3/ditaxmlgenerator.cpp
+++ b/tools/qdoc3/ditaxmlgenerator.cpp
@@ -66,226 +66,6 @@ bool DitaXmlGenerator::inSection = false;
bool DitaXmlGenerator::inDetailedDescription = false;
bool DitaXmlGenerator::inLegaleseText = false;
-#define cxxapi_d_xref Doc::alias("cxxapi-d-xref")
-#define cxxclass Doc::alias("cxxclass")
-#define cxxdefine Doc::alias("cxxdefine")
-#define cxxenumeration Doc::alias("cxxenumeration")
-#define cxxfile Doc::alias("cxxfile")
-#define cxxfunction Doc::alias("cxxfunction")
-#define cxxstruct Doc::alias("cxxstruct")
-#define cxxtypedef Doc::alias("cxxtypedef")
-#define cxxunion Doc::alias("cxxunion")
-#define cxxvariable Doc::alias("cxxvariable")
-
-#define CXXAPIMAP Doc::alias("cxxAPIMap")
-#define CXXCLASSREF Doc::alias("cxxClassRef")
-#define CXXDEFINEREF Doc::alias("cxxDefineRef")
-#define CXXENUMERATIONREF Doc::alias("cxxEnumerationRef")
-#define CXXFILEREF Doc::alias("cxxFileRef")
-#define CXXFUNCTIONREF Doc::alias("cxxFunctionRef")
-#define CXXSTRUCTREF Doc::alias("cxxStructRef")
-#define CXXTYPDEFREF Doc::alias("cxxTypedefRef")
-#define CXXUNIONREF Doc::alias("cxxUnionRef")
-#define CXXVARIABLEREF Doc::alias("cxxVariableRef")
-
-#define CXXCLASS Doc::alias("cxxClass")
-#define CXXCLASSABSTRACT Doc::alias("cxxClassAbstract")
-#define CXXCLASSACCESSSPECIFIER Doc::alias("cxxClassAccessSpecifier")
-#define CXXCLASSAPIITEMLOCATION Doc::alias("cxxClassAPIItemLocation")
-#define CXXCLASSBASECLASS Doc::alias("cxxClassBaseClass")
-#define CXXCLASSBASECLASSSTRUCT Doc::alias("cxxClassBaseStruct")
-#define CXXCLASSBASEUNION Doc::alias("cxxClassBaseUnion")
-#define CXXCLASSDECLARATIONFILE Doc::alias("cxxClassDeclarationFile")
-#define CXXCLASSDECLARATIONFILELINE Doc::alias("cxxClassDeclarationFileLine")
-#define CXXCLASSDEFINITION Doc::alias("cxxClassDefinition")
-#define CXXCLASSDEFINITIONFILE Doc::alias("cxxClassDefinitionFile")
-#define CXXCLASSDEFINITIONFILEEND Doc::alias("cxxClassDefinitionFileLineEnd")
-#define CXXCLASSDEFINITIONFILESTART Doc::alias("cxxClassDefinitionFileLineStart")
-#define CXXCLASSDERIVATION Doc::alias("cxxClassDerivation")
-#define CXXCLASSDERIVATIONACCESSSPECIFIER Doc::alias("cxxClassDerivationAccessSpecifier")
-#define CXXCLASSDERIVATIONS Doc::alias("cxxClassDerivations")
-#define CXXCLASSDERIVATIONVIRTUAL Doc::alias("cxxClassDerivationVirtual")
-#define CXXCLASSDETAIL Doc::alias("cxxClassDetail")
-#define CXXCLASSENUMERATIONINHERITED Doc::alias("cxxClassEnumerationInherited")
-#define CXXCLASSENUMERATORINHERITED Doc::alias("cxxClassEnumeratorInherited")
-#define CXXCLASSFUNCTIONINHERITED Doc::alias("cxxClassFunctionInherited")
-#define CXXCLASSINHERITS Doc::alias("cxxClassInherits")
-#define CXXCLASSINHERITSDETAIL Doc::alias("cxxClassInheritsDetail")
-#define CXXCLASSNESTED Doc::alias("cxxClassNested")
-#define CXXCLASSNESTEDCLASS Doc::alias("cxxClassNestedClass")
-#define CXXCLASSNESTEDDETAIL Doc::alias("cxxClassNestedDetail")
-#define CXXCLASSNESTEDSTRUCT Doc::alias("cxxClassNestedStruct")
-#define CXXCLASSNESTEDUNION Doc::alias("cxxClassNestedUnion")
-#define CXXCLASSTEMPLATEPARAMETER Doc::alias("cxxClassTemplateParameter")
-#define CXXCLASSTEMPLATEPARAMETERS Doc::alias("cxxClassTemplateParameters")
-#define CXXCLASSTEMPLATEPARAMETERTYPE Doc::alias("cxxClassTemplateParameterType")
-#define CXXCLASSVARIABLEINHERITED Doc::alias("cxxClassVariableInherited")
-
-#define CXXDEFINE Doc::alias("cxxDefine")
-#define CXXDEFINEACCESSSPECIFIER Doc::alias("cxxDefineAccessSpecifier")
-#define CXXDEFINEAPIITEMLOCATION Doc::alias("cxxDefineAPIItemLocation")
-#define CXXDEFINEDECLARATIONFILE Doc::alias("cxxDefineDeclarationFile")
-#define CXXDEFINEDECLARATIONFILELINE Doc::alias("cxxDefineDeclarationFileLine")
-#define CXXDEFINEDEFINITION Doc::alias("cxxDefineDefinition")
-#define CXXDEFINEDETAIL Doc::alias("cxxDefineDetail")
-#define CXXDEFINENAMELOOKUP Doc::alias("cxxDefineNameLookup")
-#define CXXDEFINEPARAMETER Doc::alias("cxxDefineParameter")
-#define CXXDEFINEPARAMETERDECLARATIONNAME Doc::alias("cxxDefineParameterDeclarationName")
-#define CXXDEFINEPARAMETERS Doc::alias("cxxDefineParameters")
-#define CXXDEFINEPROTOTYPE Doc::alias("cxxDefinePrototype")
-#define CXXDEFINEREIMPLEMENTED Doc::alias("cxxDefineReimplemented")
-
-#define CXXENUMERATION Doc::alias("cxxEnumeration")
-#define CXXENUMERATIONACCESSSPECIFIER Doc::alias("cxxEnumerationAccessSpecifier")
-#define CXXENUMERATIONAPIITEMLOCATION Doc::alias("cxxEnumerationAPIItemLocation")
-#define CXXENUMERATIONDECLARATIONFILE Doc::alias("cxxEnumerationDeclarationFile")
-#define CXXENUMERATIONDECLARATIONFILELINE Doc::alias("cxxEnumerationDeclarationFileLine")
-#define CXXENUMERATIONDEFINITION Doc::alias("cxxEnumerationDefinition")
-#define CXXENUMERATIONDEFINITIONFILE Doc::alias("cxxEnumerationDefinitionFile")
-#define CXXENUMERATIONDEFINITIONFILELINEEND Doc::alias("cxxEnumerationDefinitionFileLineEnd")
-#define CXXENUMERATIONDEFINITIONFILELINESTART Doc::alias("cxxEnumerationDefinitionFileLineStart")
-#define CXXENUMERATIONDETAIL Doc::alias("cxxEnumerationDetail")
-#define CXXENUMERATIONNAMELOOKUP Doc::alias("cxxEnumerationNameLookup")
-#define CXXENUMERATIONPROTOTYPE Doc::alias("cxxEnumerationPrototype")
-#define CXXENUMERATIONREIMPLEMENTED Doc::alias("cxxEnumerationReimplemented")
-#define CXXENUMERATIONSCOPEDNAME Doc::alias("cxxEnumerationScopedName")
-#define CXXENUMERATOR Doc::alias("cxxEnumerator")
-#define CXXENUMERATORAPIITEMLOCATION Doc::alias("cxxEnumeratorAPIItemLocation")
-#define CXXENUMERATORDECLARATIONFILE Doc::alias("cxxEnumeratorDeclarationFile")
-#define CXXENUMERATORDECLARATIONFILELINE Doc::alias("cxxEnumeratorDeclarationFileLine")
-#define CXXENUMERATORINITIALISER Doc::alias("cxxEnumeratorInitialiser")
-#define CXXENUMERATORNAMELOOKUP Doc::alias("cxxEnumeratorNameLookup")
-#define CXXENUMERATORPROTOTYPE Doc::alias("cxxEnumeratorPrototype")
-#define CXXENUMERATORS Doc::alias("cxxEnumerators")
-#define CXXENUMERATORSCOPEDNAME Doc::alias("cxxEnumeratorScopedName")
-
-#define CXXFILE_INFO_TYPES Doc::alias("cxxFile-info-types")
-#define CXXFILE_TYPES_DEFAULT Doc::alias("cxxFile-types-default")
-#define CXXFILE Doc::alias("cxxFile")
-#define CXXFILEAPIITMELOCATION Doc::alias("cxxFileAPIItemLocation")
-#define CXXFILEDECLARATIONFILE Doc::alias("cxxFileDeclarationFile")
-
-#define CXXFUNCTION Doc::alias("cxxFunction")
-#define CXXFUNCTIONACCESSSPECIFIER Doc::alias("cxxFunctionAccessSpecifier")
-#define CXXFUNCTIONAPIITEMLOCATION Doc::alias("cxxFunctionAPIItemLocation")
-#define CXXFUNCTIONCONST Doc::alias("cxxFunctionConst")
-#define CXXFUNCTIONCONSTRUCTOR Doc::alias("cxxFunctionConstructor")
-#define CXXFUNCTIONDECLARATIONFILE Doc::alias("cxxFunctionDeclarationFile")
-#define CXXFUNCTIONDECLARATIONFILELINE Doc::alias("cxxFunctionDeclarationFileLine")
-#define CXXFUNCTIONDECLAREDTYPE Doc::alias("cxxFunctionDeclaredType")
-#define CXXFUNCTIONDEFINITION Doc::alias("cxxFunctionDefinition")
-#define CXXFUNCTIONDEFINITIONFILE Doc::alias("cxxFunctionDefinitionFile")
-#define CXXFUNCTIONDEFINITIONFILELINEEND Doc::alias("cxxFunctionDefinitionFileLineEnd")
-#define CXXFUNCTIONDEFINITIONFILELINESTART Doc::alias("cxxFunctionDefinitionFileLineStart")
-#define CXXFUNCTIONDESTRUCTOR Doc::alias("cxxFunctionDestructor")
-#define CXXFUNCTIONDETAIL Doc::alias("cxxFunctionDetail")
-#define CXXFUNCTIONEXPLICIT Doc::alias("cxxFunctionExplicit")
-#define CXXFUNCTIONINLINE Doc::alias("cxxFunctionInline")
-#define CXXFUNCTIONNAMELOOKUP Doc::alias("cxxFunctionNameLookup")
-#define CXXFUNCTIONPARAMETER Doc::alias("cxxFunctionParameter")
-#define CXXFUNCTIONPARAMETERDECLARATIONNAME Doc::alias("cxxFunctionParameterDeclarationName")
-#define CXXFUNCTIONPARAMETERDECLAREDTYPE Doc::alias("cxxFunctionParameterDeclaredType")
-#define CXXFUNCTIONPARAMETERDEFAULTVALUE Doc::alias("cxxFunctionParameterDefaultValue")
-#define CXXFUNCTIONPARAMETERDEFINITIONNAME Doc::alias("cxxFunctionParameterDefinitionName")
-#define CXXFUNCTIONPARAMETERS Doc::alias("cxxFunctionParameters")
-#define CXXFUNCTIONPROTOTYPE Doc::alias("cxxFunctionPrototype")
-#define CXXFUNCTIONPUREVIRTUAL Doc::alias("cxxFunctionPureVirtual")
-#define CXXFUNCTIONREIMPLEMENTED Doc::alias("cxxFunctionReimplemented")
-#define CXXFUNCTIONRETURNTYPE Doc::alias("cxxFunctionReturnType")
-#define CXXFUNCTIONSCOPEDNAME Doc::alias("cxxFunctionScopedName")
-#define CXXFUNCTIONSTORAGECLASSSPECIFIEREXTERN Doc::alias("cxxFunctionStorageClassSpecifierExtern")
-#define CXXFUNCTIONSTORAGECLASSSPECIFIERMUTABLE Doc::alias("cxxFunctionStorageClassSpecifierMutable")
-#define CXXFUNCTIONSTORAGECLASSSPECIFIERSTATIC Doc::alias("cxxFunctionStorageClassSpecifierStatic")
-#define CXXFUNCTIONTEMPLATEPARAMETER Doc::alias("cxxFunctionTemplateParameter")
-#define CXXFUNCTIONTEMPLATEPARAMETERS Doc::alias("cxxFunctionTemplateParameters")
-#define CXXFUNCTIONTEMPLATEPARAMETERTYPE Doc::alias("cxxFunctionTemplateParameterType")
-#define CXXFUNCTIONVIRTUAL Doc::alias("cxxFunctionVirtual")
-#define CXXFUNCTIONVOLATILE Doc::alias("cxxFunctionVolatile")
-
-#define CXXSTRUCT Doc::alias("cxxStruct")
-#define CXXSTRUCTABSTRACT Doc::alias("cxxStructAbstract")
-#define CXXSTRUCTACCESSSPECIFIER Doc::alias("cxxStructAccessSpecifier")
-#define CXXSTRUCTAPIITEMLOCATION Doc::alias("cxxStructAPIItemLocation")
-#define CXXSTRUCTBASECLASS Doc::alias("cxxStructBaseClass")
-#define CXXSTRUCTBASESTRUCT Doc::alias("cxxStructBaseStruct")
-#define CXXSTRUCTBASEUNION Doc::alias("cxxStructBaseUnion")
-#define CXXSTRUCTDECLARATIONFILE Doc::alias("cxxStructDeclarationFile")
-#define CXXSTRUCTDECLARATIONFILELINE Doc::alias("cxxStructDeclarationFileLine")
-#define CXXSTRUCTDEFINITION Doc::alias("cxxStructDefinition")
-#define CXXSTRUCTDEFINITIONFILE Doc::alias("cxxStructDefinitionFile")
-#define CXXSTRUCTDEFINITIONFILELINEEND Doc::alias("cxxStructDefinitionFileLineEnd")
-#define CXXSTRUCTDEFINITIONFILELINESTART Doc::alias("cxxStructDefinitionFileLineStart")
-#define CXXSTRUCTDERIVATION Doc::alias("cxxStructDerivation")
-#define CXXSTRUCTDERIVATIONACCESSSPECIFIER Doc::alias("cxxStructDerivationAccessSpecifier")
-#define CXXSTRUCTDERIVATIONS Doc::alias("cxxStructDerivations")
-#define CXXSTRUCTDERIVATIONVIRTUAL Doc::alias("cxxStructDerivationVirtual")
-#define CXXSTRUCTDETAIL Doc::alias("cxxStructDetail")
-#define CXXSTRUCTENUMERATIONINHERITED Doc::alias("cxxStructEnumerationInherited")
-#define CXXSTRUCTENUMERATORINHERITED Doc::alias("cxxStructEnumeratorInherited")
-#define CXXSTRUCTFUNCTIONINHERITED Doc::alias("cxxStructFunctionInherited")
-#define CXXSTRUCTINHERITS Doc::alias("cxxStructInherits")
-#define CXXSTRUCTINHERITSDETAIL Doc::alias("cxxStructInheritsDetail")
-#define CXXSTRUCTNESTED Doc::alias("cxxStructNested")
-#define CXXSTRUCTNESTEDCLASS Doc::alias("cxxStructNestedClass")
-#define CXXSTRUCTNESTEDDETAIL Doc::alias("cxxStructNestedDetail")
-#define CXXSTRUCTNESTEDSTRUCT Doc::alias("cxxStructNestedStruct")
-#define CXXSTRUCTNESTEDUNION Doc::alias("cxxStructNestedUnion")
-#define CXXSTRUCTTEMPLATEPARAMETER Doc::alias("cxxStructTemplateParameter")
-#define CXXSTRUCTTEMPLATEPARAMETERS Doc::alias("cxxStructTemplateParameters")
-#define CXXSTRUCTTEMPLATEPARAMETERTYPE Doc::alias("cxxStructTemplateParameterType")
-#define CXXSTRUCTVARIABLEINHERITED Doc::alias("cxxStructVariableInherited")
-
-#define CXXTYPEDEF Doc::alias("cxxTypedef")
-#define CXXTYPEDEFACCESSSPECIFIER Doc::alias("cxxTypedefAccessSpecifier")
-#define CXXTYPEDEFAPIITEMLOCATION Doc::alias("cxxTypedefAPIItemLocation")
-#define CXXTYPEDEFDECLARATIONFILE Doc::alias("cxxTypedefDeclarationFile")
-#define CXXTYPEDEFDECLARATIONFILELINE Doc::alias("cxxTypedefDeclarationFileLine")
-#define CXXTYPEDEFDECLAREDTYPE Doc::alias("cxxTypedefDeclaredType")
-#define CXXTYPEDEFDEFINITION Doc::alias("cxxTypedefDefinition")
-#define CXXTYPEDEFDETAIL Doc::alias("cxxTypedefDetail")
-#define CXXTYPEDEFNAMELOOKUP Doc::alias("cxxTypedefNameLookup")
-#define CXXTYPEDEFPROTOTYPE Doc::alias("cxxTypedefPrototype")
-#define CXXTYPEDEFREIMPLEMENTED Doc::alias("cxxTypedefReimplemented")
-#define CXXTYPEDEFSCOPEDNAME Doc::alias("cxxTypedefScopedName")
-
-#define CXXUNION Doc::alias("cxxUnion")
-#define CXXUNIONABSTRACT Doc::alias("cxxUnionAbstract")
-#define CXXUNIONACCESSSPECIFIER Doc::alias("cxxUnionAccessSpecifier")
-#define CXXUNIONAPIITEMLOCATION Doc::alias("cxxUnionAPIItemLocation")
-#define CXXUNIONDECLARATIONFILE Doc::alias("cxxUnionDeclarationFile")
-#define CXXUNIONDECLARATIONFILELINE Doc::alias("cxxUnionDeclarationFileLine")
-#define CXXUNIONDEFINITION Doc::alias("cxxUnionDefinition")
-#define CXXUNIONDEFINITIONFILE Doc::alias("cxxUnionDefinitionFile")
-#define CXXUNIONDEFINITIONFILELINEEND Doc::alias("cxxUnionDefinitionFileLineEnd")
-#define CXXUNIONDEFINITIONFILELINESTART Doc::alias("cxxUnionDefinitionFileLineStart")
-#define CXXUNIONDETAIL Doc::alias("cxxUnionDetail")
-#define CXXUNIONNESTED Doc::alias("cxxUnionNested")
-#define CXXUNIONNESTEDCLASS Doc::alias("cxxUnionNestedClass")
-#define CXXUNIONNESTEDDETAIL Doc::alias("cxxUnionNestedDetail")
-#define CXXUNIONNESTEDSTRUCT Doc::alias("cxxUnionNestedStruct")
-#define CXXUNIONNESTEDUNION Doc::alias("cxxUnionNestedUnion")
-#define CXXUNIONTEMPLATEPARAMETER Doc::alias("cxxUnionTemplateParameter")
-#define CXXUNIONTEMPLATEPARAMETERS Doc::alias("cxxUnionTemplateParameters")
-#define CXXUNIONTEMPLATEPARAMETERTYPE Doc::alias("cxxUnionTemplateParameterType")
-
-#define CXXVARIABLE Doc::alias("cxxVariable")
-#define CXXVARIABLEACCESSSPECIFIER Doc::alias("cxxVariableAccessSpecifier")
-#define CXXVARIABLEAPIITEMLOCATION Doc::alias("cxxVariableAPIItemLocation")
-#define CXXVARIABLECONST Doc::alias("cxxVariableConst")
-#define CXXVARIABLEDECLARATIONFILE Doc::alias("cxxVariableDeclarationFile")
-#define CXXVARIABLEDECLARATIONFILELINE Doc::alias("cxxVariableDeclarationFileLine")
-#define CXXVARIABLEDECLAREDTYPE Doc::alias("cxxVariableDeclaredType")
-#define CXXVARIABLEDEFINITION Doc::alias("cxxVariableDefinition")
-#define CXXVARIABLEDETAIL Doc::alias("cxxVariableDetail")
-#define CXXVARIABLENAMELOOKUP Doc::alias("cxxVariableNameLookup")
-#define CXXVARIABLEPROTOTYPE Doc::alias("cxxVariablePrototype")
-#define CXXVARIABLEREIMPLEMENTED Doc::alias("cxxVariableReimplemented")
-#define CXXVARIABLESCOPEDNAME Doc::alias("cxxVariableScopedName")
-#define CXXVARIABLESTORAGECLASSSPECIFIEREXTERN Doc::alias("cxxVariableStorageClassSpecifierExtern")
-#define CXXVARIABLESTORAGECLASSSPECIFIERMUTABLE Doc::alias("cxxVariableStorageClassSpecifierMutable")
-#define CXXVARIABLESTORAGECLASSSPECIFIERSTATIC Doc::alias("cxxVariableStorageClassSpecifierStatic")
-#define CXXVARIABLEVOLATILE Doc::alias("cxxVariableVolatile")
-
QString DitaXmlGenerator::sinceTitles[] =
{
" New Namespaces",
@@ -305,6 +85,156 @@ QString DitaXmlGenerator::sinceTitles[] =
""
};
+/*
+ The strings in this array must appear in the same order as
+ the values in enum DitaXmlGenerator::DitaTag.
+ */
+QString DitaXmlGenerator::ditaTags[] =
+ {
+ "alt",
+ "apiDesc",
+ "APIMap",
+ "apiName",
+ "b",
+ "body",
+ "bodydiv",
+ "codeblock",
+ "comment",
+ "cxxAPIMap",
+ "cxxClass",
+ "cxxClassAbstract",
+ "cxxClassAccessSpecifier",
+ "cxxClassAPIItemLocation",
+ "cxxClassBaseClass",
+ "cxxClassDeclarationFile",
+ "cxxClassDeclarationFileLine",
+ "cxxClassDefinition",
+ "cxxClassDerivation",
+ "cxxClassDerivationAccessSpecifier",
+ "cxxClassDerivations",
+ "cxxClassDetail",
+ "cxxClassNested",
+ "cxxClassNestedClass",
+ "cxxClassNestedDetail",
+ "cxxDefine",
+ "cxxDefineAccessSpecifier",
+ "cxxDefineAPIItemLocation",
+ "cxxDefineDeclarationFile",
+ "cxxDefineDeclarationFileLine",
+ "cxxDefineDefinition",
+ "cxxDefineDetail",
+ "cxxDefineNameLookup",
+ "cxxDefineParameter",
+ "cxxDefineParameterDeclarationName",
+ "cxxDefineParameters",
+ "cxxDefinePrototype",
+ "cxxDefineReimplemented",
+ "cxxEnumeration",
+ "cxxEnumerationAccessSpecifier",
+ "cxxEnumerationAPIItemLocation",
+ "cxxEnumerationDeclarationFile",
+ "cxxEnumerationDeclarationFileLine",
+ "cxxEnumerationDefinition",
+ "cxxEnumerationDefinitionFile",
+ "cxxEnumerationDefinitionFileLineStart",
+ "cxxEnumerationDefinitionFileLineEnd",
+ "cxxEnumerationDetail",
+ "cxxEnumerationNameLookup",
+ "cxxEnumerationPrototype",
+ "cxxEnumerationScopedName",
+ "cxxEnumerator",
+ "cxxEnumeratorInitialiser",
+ "cxxEnumeratorNameLookup",
+ "cxxEnumeratorPrototype",
+ "cxxEnumerators",
+ "cxxEnumeratorScopedName",
+ "cxxFunction",
+ "cxxFunctionAccessSpecifier",
+ "cxxFunctionAPIItemLocation",
+ "cxxFunctionConst",
+ "cxxFunctionConstructor",
+ "cxxFunctionDeclarationFile",
+ "cxxFunctionDeclarationFileLine",
+ "cxxFunctionDeclaredType",
+ "cxxFunctionDefinition",
+ "cxxFunctionDestructor",
+ "cxxFunctionDetail",
+ "cxxFunctionNameLookup",
+ "cxxFunctionParameter",
+ "cxxFunctionParameterDeclarationName",
+ "cxxFunctionParameterDeclaredType",
+ "cxxFunctionParameterDefaultValue",
+ "cxxFunctionParameters",
+ "cxxFunctionPrototype",
+ "cxxFunctionPureVirtual",
+ "cxxFunctionReimplemented",
+ "cxxFunctionScopedName",
+ "cxxFunctionStorageClassSpecifierStatic",
+ "cxxFunctionVirtual",
+ "cxxTypedef",
+ "cxxTypedefAccessSpecifier",
+ "cxxTypedefAPIItemLocation",
+ "cxxTypedefDeclarationFile",
+ "cxxTypedefDeclarationFileLine",
+ "cxxTypedefDefinition",
+ "cxxTypedefDetail",
+ "cxxTypedefNameLookup",
+ "cxxTypedefScopedName",
+ "cxxVariable",
+ "cxxVariableAccessSpecifier",
+ "cxxVariableAPIItemLocation",
+ "cxxVariableDeclarationFile",
+ "cxxVariableDeclarationFileLine",
+ "cxxVariableDeclaredType",
+ "cxxVariableDefinition",
+ "cxxVariableDetail",
+ "cxxVariableNameLookup",
+ "cxxVariablePrototype",
+ "cxxVariableReimplemented",
+ "cxxVariableScopedName",
+ "cxxVariableStorageClassSpecifierStatic",
+ "dd",
+ "dl",
+ "dlentry",
+ "dt",
+ "entry",
+ "fig",
+ "i",
+ "image",
+ "li",
+ "link",
+ "linktext",
+ "lq",
+ "ol",
+ "p",
+ "parameter",
+ "pre",
+ "related-links",
+ "row",
+ "section",
+ "sectiondiv",
+ "shortdesc",
+ "simpletable",
+ "stentry",
+ "sthead",
+ "strow",
+ "sub",
+ "sup",
+ "table",
+ "tbody",
+ "tgroup",
+ "thead",
+ "title",
+ "topic",
+ "topicmeta",
+ "topicref",
+ "tt",
+ "ul",
+ "u",
+ "xref",
+ ""
+ };
+
static bool showBrokenLinks = false;
/*!
@@ -330,11 +260,11 @@ void DitaXmlGenerator::addLink(const QString& href,
const QStringRef& text)
{
if (!href.isEmpty()) {
- xmlWriter().writeStartElement("xref");
+ writeStartTag(DT_xref);
// formathtml
xmlWriter().writeAttribute("href", href);
writeCharacters(text.toString());
- xmlWriter().writeEndElement(); // </xref>
+ writeEndTag(); // </xref>
}
else {
writeCharacters(text.toString());
@@ -342,6 +272,35 @@ void DitaXmlGenerator::addLink(const QString& href,
}
/*!
+ Push \a t onto the dita tag stack and write the appropriate
+ start tag to the DITA XML file.
+ */
+void DitaXmlGenerator::writeStartTag(DitaTag t)
+{
+ xmlWriter().writeStartElement(ditaTags[t]);
+ tagStack.push(t);
+}
+
+/*!
+ Pop the current DITA tag off the stack, and write the
+ appropriate end tag to the DITA XML file.
+ */
+void DitaXmlGenerator::writeEndTag()
+{
+ tagStack.pop();
+ xmlWriter().writeEndElement();
+}
+
+/*!
+ Return the current DITA element tag, the one
+ on top of the stack.
+ */
+DitaXmlGenerator::DitaTag DitaXmlGenerator::currentTag()
+{
+ return tagStack.top();
+}
+
+/*!
The default constructor.
*/
DitaXmlGenerator::DitaXmlGenerator()
@@ -380,29 +339,9 @@ DitaXmlGenerator::~DitaXmlGenerator()
*/
void DitaXmlGenerator::initializeGenerator(const Config &config)
{
- static const struct {
- const char *key;
- const char *tag;
- } defaults[] = {
- { ATOM_FORMATTING_BOLD, "b" },
- { ATOM_FORMATTING_INDEX, "<!--" },
- { ATOM_FORMATTING_ITALIC, "i" },
- { ATOM_FORMATTING_PARAMETER, "i" },
- { ATOM_FORMATTING_SUBSCRIPT, "sub" },
- { ATOM_FORMATTING_SUPERSCRIPT, "sup" },
- { ATOM_FORMATTING_TELETYPE, "tt", },
- { ATOM_FORMATTING_UNDERLINE, "u", },
- { 0, 0 }
- };
-
Generator::initializeGenerator(config);
obsoleteLinks = config.getBool(QLatin1String(CONFIG_OBSOLETELINKS));
setImageFileExtensions(QStringList() << "png" << "jpg" << "jpeg" << "gif");
- int i = 0;
- while (defaults[i].key) {
- formattingLeftMap().insert(defaults[i].key, defaults[i].tag);
- i++;
- }
style = config.getString(DitaXmlGenerator::format() +
Config::dot +
@@ -675,12 +614,12 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
//break;
//}
if (inApiDesc || inSection) {
- xmlWriter().writeStartElement("p");
+ writeStartTag(DT_p);
xmlWriter().writeAttribute("outputclass","brief");
}
else {
noLinks = true;
- xmlWriter().writeStartElement("shortdesc");
+ writeStartTag(DT_shortdesc);
}
if (relative->type() == Node::Property ||
relative->type() == Node::Variable) {
@@ -708,62 +647,93 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
break;
case Atom::BriefRight:
// if (relative->type() != Node::Fake)
- xmlWriter().writeEndElement(); // </shortdesc> or </p>
+ writeEndTag(); // </shortdesc> or </p>
noLinks = false;
break;
case Atom::C:
- xmlWriter().writeStartElement(formattingLeftMap()[ATOM_FORMATTING_TELETYPE]);
+ writeStartTag(DT_tt);
if (inLink) {
writeCharacters(protectEnc(plainCode(atom->string())));
}
else {
writeText(atom->string(), marker, relative);
}
- xmlWriter().writeEndElement(); // sse writeStartElement() above
+ writeEndTag(); // see writeStartElement() above
break;
case Atom::Code:
{
- xmlWriter().writeStartElement("codeblock");
+ writeStartTag(DT_codeblock);
QString chars = trimmedTrailing(atom->string());
writeText(chars, marker, relative);
- xmlWriter().writeEndElement(); // </codeblock>
+ writeEndTag(); // </codeblock>
}
break;
case Atom::Qml:
- xmlWriter().writeStartElement("codeblock");
+ writeStartTag(DT_codeblock);
writeText(trimmedTrailing(atom->string()), marker, relative);
- xmlWriter().writeEndElement(); // </codeblock>
+ writeEndTag(); // </codeblock>
break;
case Atom::CodeNew:
- xmlWriter().writeStartElement("p");
+ writeStartTag(DT_p);
xmlWriter().writeCharacters("you can rewrite it as");
- xmlWriter().writeEndElement(); // </p>
- xmlWriter().writeStartElement("codeblock");
+ writeEndTag(); // </p>
+ writeStartTag(DT_codeblock);
writeText(trimmedTrailing(atom->string()), marker, relative);
- xmlWriter().writeEndElement(); // </codeblock>
+ writeEndTag(); // </codeblock>
break;
case Atom::CodeOld:
- xmlWriter().writeStartElement("p");
+ writeStartTag(DT_p);
xmlWriter().writeCharacters("For example, if you have code like");
- xmlWriter().writeEndElement(); // </p>
+ writeEndTag(); // </p>
// fallthrough
case Atom::CodeBad:
- xmlWriter().writeStartElement("codeblock");
+ writeStartTag(DT_codeblock);
writeCharacters(trimmedTrailing(plainCode(atom->string())));
- xmlWriter().writeEndElement(); // </codeblock>
+ writeEndTag(); // </codeblock>
break;
case Atom::DivLeft:
- xmlWriter().writeStartElement("sectiondiv");
- if (!atom->string().isEmpty())
- xmlWriter().writeAttribute("outputclass", atom->string());
+ {
+ QString attr = atom->string();
+ DitaTag t = currentTag();
+ if ((t == DT_section) || (t == DT_sectiondiv))
+ t = DT_sectiondiv;
+ else if ((t == DT_body) || (t == DT_bodydiv))
+ t = DT_bodydiv;
+ else
+ t = DT_p;
+ writeStartTag(t);
+ if (!attr.isEmpty()) {
+ if (attr.contains('=')) {
+ int index = 0;
+ int from = 0;
+ QString values;
+ while (index >= 0) {
+ index = attr.indexOf('"',from);
+ if (index >= 0) {
+ ++index;
+ from = index;
+ index = attr.indexOf('"',from);
+ if (index > from) {
+ if (!values.isEmpty())
+ values.append(' ');
+ values += attr.mid(from,index-from);
+ from = index+1;
+ }
+ }
+ }
+ attr = values;
+ }
+ }
+ xmlWriter().writeAttribute("outputclass", attr);
+ }
break;
case Atom::DivRight:
- xmlWriter().writeEndElement(); // </sectiondiv>
+ writeEndTag(); // </sectiondiv>
break;
case Atom::FootnoteLeft:
// ### For now
if (in_para) {
- xmlWriter().writeEndElement(); // </p>
+ writeEndTag(); // </p>
in_para = false;
}
xmlWriter().writeCharacters("<!-- ");
@@ -777,16 +747,37 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
case Atom::FormatIf:
break;
case Atom::FormattingLeft:
- xmlWriter().writeStartElement(formattingLeftMap()[atom->string()]);
- if (atom->string() == ATOM_FORMATTING_PARAMETER) {
- if (atom->next() != 0 && atom->next()->type() == Atom::String) {
- QRegExp subscriptRegExp("([a-z]+)_([0-9n])");
- if (subscriptRegExp.exactMatch(atom->next()->string())) {
- xmlWriter().writeCharacters(subscriptRegExp.cap(1));
- xmlWriter().writeStartElement("sub");
- xmlWriter().writeCharacters(subscriptRegExp.cap(2));
- xmlWriter().writeEndElement(); // </sub>
- skipAhead = 1;
+ {
+ DitaTag t = DT_LAST;
+ if (atom->string() == ATOM_FORMATTING_BOLD)
+ t = DT_b;
+ else if (atom->string() == ATOM_FORMATTING_PARAMETER)
+ t = DT_i;
+ else if (atom->string() == ATOM_FORMATTING_ITALIC)
+ t = DT_i;
+ else if (atom->string() == ATOM_FORMATTING_TELETYPE)
+ t = DT_tt;
+ else if (atom->string() == ATOM_FORMATTING_UNDERLINE)
+ t = DT_u;
+ else if (atom->string() == ATOM_FORMATTING_INDEX)
+ t = DT_comment;
+ else if (atom->string() == ATOM_FORMATTING_SUBSCRIPT)
+ t = DT_sub;
+ else if (atom->string() == ATOM_FORMATTING_SUPERSCRIPT)
+ t = DT_sup;
+ else
+ qDebug() << "DT_LAST";
+ writeStartTag(t);
+ if (atom->string() == ATOM_FORMATTING_PARAMETER) {
+ if (atom->next() != 0 && atom->next()->type() == Atom::String) {
+ QRegExp subscriptRegExp("([a-z]+)_([0-9n])");
+ if (subscriptRegExp.exactMatch(atom->next()->string())) {
+ xmlWriter().writeCharacters(subscriptRegExp.cap(1));
+ writeStartTag(DT_sub);
+ xmlWriter().writeCharacters(subscriptRegExp.cap(2));
+ writeEndTag(); // </sub>
+ skipAhead = 1;
+ }
}
}
}
@@ -796,7 +787,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
endLink();
}
else {
- xmlWriter().writeEndElement(); // ?
+ writeEndTag(); // ?
}
break;
case Atom::AnnotatedList:
@@ -985,7 +976,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
/*
First generate the table of contents.
*/
- xmlWriter().writeStartElement("ul");
+ writeStartTag(DT_ul);
s = sections.constBegin();
while (s != sections.constEnd()) {
if (!(*s).members.isEmpty()) {
@@ -994,17 +985,17 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
}
++s;
}
- xmlWriter().writeEndElement(); // </ul>
+ writeEndTag(); // </ul>
int idx = 0;
s = sections.constBegin();
while (s != sections.constEnd()) {
if (!(*s).members.isEmpty()) {
- xmlWriter().writeStartElement("p");
+ writeStartTag(DT_p);
writeGuidAttribute(Doc::canonicalTitle((*s).name));
xmlWriter().writeAttribute("outputclass","h3");
writeCharacters(protectEnc((*s).name));
- xmlWriter().writeEndElement(); // </p>
+ writeEndTag(); // </p>
if (idx == Class)
generateCompactList(0, marker, ncmap.value(), false, QString("Q"));
else if (idx == QmlClass)
@@ -1024,16 +1015,16 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
pmap = parentmaps.begin();
while (pmap != parentmaps.end()) {
NodeList nlist = pmap->values();
- xmlWriter().writeStartElement("p");
+ writeStartTag(DT_p);
xmlWriter().writeCharacters("Class ");
- xmlWriter().writeStartElement("xref");
+ writeStartTag(DT_xref);
// formathtml
xmlWriter().writeAttribute("href",linkForNode(pmap.key(), 0));
QStringList pieces = fullName(pmap.key(), 0, marker).split("::");
writeCharacters(protectEnc(pieces.last()));
- xmlWriter().writeEndElement(); // </xref>
+ writeEndTag(); // </xref>
xmlWriter().writeCharacters(":");
- xmlWriter().writeEndElement(); // </p>
+ writeEndTag(); // </p>
generateSection(nlist, 0, marker, CodeMarker::Summary);
++pmap;
@@ -1065,8 +1056,8 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
fileName = QLatin1String("images/") + protectEnc(atom->string());
}
- xmlWriter().writeStartElement("fig");
- xmlWriter().writeStartElement("image");
+ writeStartTag(DT_fig);
+ writeStartTag(DT_image);
xmlWriter().writeAttribute("href",protectEnc(fileName));
if (atom->type() == Atom::InlineImage)
xmlWriter().writeAttribute("placement","inline");
@@ -1075,12 +1066,12 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
xmlWriter().writeAttribute("align","center");
}
if (!text.isEmpty()) {
- xmlWriter().writeStartElement("alt");
+ writeStartTag(DT_alt);
writeCharacters(protectEnc(text));
- xmlWriter().writeEndElement(); // </alt>
+ writeEndTag(); // </alt>
}
- xmlWriter().writeEndElement(); // </image>
- xmlWriter().writeEndElement(); // </fig>
+ writeEndTag(); // </image>
+ writeEndTag(); // </fig>
}
break;
case Atom::ImageText:
@@ -1134,47 +1125,47 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
break;
case Atom::ListLeft:
if (in_para) {
- xmlWriter().writeEndElement(); // </p>
+ writeEndTag(); // </p>
in_para = false;
}
if (atom->string() == ATOM_LIST_BULLET) {
- xmlWriter().writeStartElement("ul");
+ writeStartTag(DT_ul);
}
else if (atom->string() == ATOM_LIST_TAG) {
- xmlWriter().writeStartElement("dl");
+ writeStartTag(DT_dl);
}
else if (atom->string() == ATOM_LIST_VALUE) {
threeColumnEnumValueTable = isThreeColumnEnumValueTable(atom);
if (threeColumnEnumValueTable) {
- xmlWriter().writeStartElement("simpletable");
+ writeStartTag(DT_simpletable);
xmlWriter().writeAttribute("outputclass","valuelist");
- xmlWriter().writeStartElement("sthead");
- xmlWriter().writeStartElement("stentry");
+ writeStartTag(DT_sthead);
+ writeStartTag(DT_stentry);
xmlWriter().writeCharacters("Constant");
- xmlWriter().writeEndElement(); // </stentry>
- xmlWriter().writeStartElement("stentry");
+ writeEndTag(); // </stentry>
+ writeStartTag(DT_stentry);
xmlWriter().writeCharacters("Value");
- xmlWriter().writeEndElement(); // </stentry>
- xmlWriter().writeStartElement("stentry");
+ writeEndTag(); // </stentry>
+ writeStartTag(DT_stentry);
xmlWriter().writeCharacters("Description");
- xmlWriter().writeEndElement(); // </stentry>
- xmlWriter().writeEndElement(); // </sthead>
+ writeEndTag(); // </stentry>
+ writeEndTag(); // </sthead>
}
else {
- xmlWriter().writeStartElement("simpletable");
+ writeStartTag(DT_simpletable);
xmlWriter().writeAttribute("outputclass","valuelist");
- xmlWriter().writeStartElement("sthead");
- xmlWriter().writeStartElement("stentry");
+ writeStartTag(DT_sthead);
+ writeStartTag(DT_stentry);
xmlWriter().writeCharacters("Constant");
- xmlWriter().writeEndElement(); // </stentry>
- xmlWriter().writeStartElement("stentry");
+ writeEndTag(); // </stentry>
+ writeStartTag(DT_stentry);
xmlWriter().writeCharacters("Value");
- xmlWriter().writeEndElement(); // </stentry>
- xmlWriter().writeEndElement(); // </sthead>
+ writeEndTag(); // </stentry>
+ writeEndTag(); // </sthead>
}
}
else {
- xmlWriter().writeStartElement("ol");
+ writeStartTag(DT_ol);
if (atom->string() == ATOM_LIST_UPPERALPHA)
xmlWriter().writeAttribute("outputclass","upperalpha");
else if (atom->string() == ATOM_LIST_LOWERALPHA)
@@ -1196,17 +1187,17 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
break;
case Atom::ListTagLeft:
if (atom->string() == ATOM_LIST_TAG) {
- xmlWriter().writeStartElement("dt");
+ writeStartTag(DT_dt);
}
else { // (atom->string() == ATOM_LIST_VALUE)
- xmlWriter().writeStartElement("strow");
- xmlWriter().writeStartElement("stentry");
- xmlWriter().writeStartElement("tt");
+ writeStartTag(DT_strow);
+ writeStartTag(DT_stentry);
+ writeStartTag(DT_tt);
writeCharacters(protectEnc(plainCode(marker->markedUpEnumValue(atom->next()->string(),
relative))));
- xmlWriter().writeEndElement(); // </tt>
- xmlWriter().writeEndElement(); // </stentry>
- xmlWriter().writeStartElement("stentry");
+ writeEndTag(); // </tt>
+ writeEndTag(); // </stentry>
+ writeStartTag(DT_stentry);
QString itemValue;
if (relative->type() == Node::Enum) {
@@ -1217,64 +1208,64 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
if (itemValue.isEmpty())
xmlWriter().writeCharacters("?");
else {
- xmlWriter().writeStartElement("tt");
+ writeStartTag(DT_tt);
writeCharacters(protectEnc(itemValue));
- xmlWriter().writeEndElement(); // </tt>
+ writeEndTag(); // </tt>
}
skipAhead = 1;
}
break;
case Atom::ListTagRight:
if (atom->string() == ATOM_LIST_TAG)
- xmlWriter().writeEndElement(); // </dt>
+ writeEndTag(); // </dt>
break;
case Atom::ListItemLeft:
if (atom->string() == ATOM_LIST_TAG) {
- xmlWriter().writeStartElement("dd");
+ writeStartTag(DT_dd);
}
else if (atom->string() == ATOM_LIST_VALUE) {
if (threeColumnEnumValueTable) {
- xmlWriter().writeEndElement(); // </stentry>
- xmlWriter().writeStartElement("stentry");
+ writeEndTag(); // </stentry>
+ writeStartTag(DT_stentry);
}
}
else {
- xmlWriter().writeStartElement("li");
+ writeStartTag(DT_li);
}
if (matchAhead(atom, Atom::ParaLeft))
skipAhead = 1;
break;
case Atom::ListItemRight:
if (atom->string() == ATOM_LIST_TAG) {
- xmlWriter().writeEndElement(); // </dd>
+ writeEndTag(); // </dd>
}
else if (atom->string() == ATOM_LIST_VALUE) {
- xmlWriter().writeEndElement(); // </stentry>
- xmlWriter().writeEndElement(); // </strow>
+ writeEndTag(); // </stentry>
+ writeEndTag(); // </strow>
}
else {
- xmlWriter().writeEndElement(); // </li>
+ writeEndTag(); // </li>
}
break;
case Atom::ListRight:
if (atom->string() == ATOM_LIST_BULLET) {
- xmlWriter().writeEndElement(); // </ul>
+ writeEndTag(); // </ul>
}
else if (atom->string() == ATOM_LIST_TAG) {
- xmlWriter().writeEndElement(); // </dl>
+ writeEndTag(); // </dl>
}
else if (atom->string() == ATOM_LIST_VALUE) {
- xmlWriter().writeEndElement(); // </simpletable>
+ writeEndTag(); // </simpletable>
}
else {
- xmlWriter().writeEndElement(); // </ol>
+ writeEndTag(); // </ol>
}
break;
case Atom::Nop:
// nothing
break;
case Atom::ParaLeft:
- xmlWriter().writeStartElement("p");
+ writeStartTag(DT_p);
if (inLegaleseText)
xmlWriter().writeAttribute("outputclass","legalese");
in_para = true;
@@ -1282,15 +1273,15 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
case Atom::ParaRight:
endLink();
if (in_para) {
- xmlWriter().writeEndElement(); // </p>
+ writeEndTag(); // </p>
in_para = false;
}
break;
case Atom::QuotationLeft:
- xmlWriter().writeStartElement("lq");
+ writeStartTag(DT_lq);
break;
case Atom::QuotationRight:
- xmlWriter().writeEndElement(); // </lq>
+ writeEndTag(); // </lq>
break;
case Atom::RawString:
if (atom->string() == " ")
@@ -1298,41 +1289,41 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
if (atom->string().startsWith("&"))
writeCharacters(atom->string());
else if (atom->string() == "<sup>*</sup>") {
- xmlWriter().writeStartElement("sup");
+ writeStartTag(DT_sup);
writeCharacters("*");
- xmlWriter().writeEndElement(); // </sup>
+ writeEndTag(); // </sup>
}
else {
- xmlWriter().writeStartElement("pre");
+ writeStartTag(DT_pre);
xmlWriter().writeAttribute("outputclass","raw-html");
writeCharacters(atom->string());
- xmlWriter().writeEndElement(); // </pre>
+ writeEndTag(); // </pre>
}
break;
case Atom::SectionLeft:
if (inSection || inApiDesc) {
inApiDesc = false;
- xmlWriter().writeEndElement(); // </section> or </apiDesc>
+ writeEndTag(); // </section> or </apiDesc>
}
inSection = true;
- xmlWriter().writeStartElement("section");
+ writeStartTag(DT_section);
writeGuidAttribute(Doc::canonicalTitle(Text::sectionHeading(atom).toString()));
xmlWriter().writeAttribute("outputclass","details");
break;
case Atom::SectionRight:
if (inSection) {
inSection = false;
- xmlWriter().writeEndElement(); // </section>
+ writeEndTag(); // </section>
}
break;
case Atom::SectionHeadingLeft:
- xmlWriter().writeStartElement("title");
+ writeStartTag(DT_title);
hx = "h" + QString::number(atom->string().toInt() + hOffset(relative));
xmlWriter().writeAttribute("outputclass",hx);
inSectionHeading = true;
break;
case Atom::SectionHeadingRight:
- xmlWriter().writeEndElement(); // </title> (see case Atom::SectionHeadingLeft)
+ writeEndTag(); // </title> (see case Atom::SectionHeadingLeft)
inSectionHeading = false;
break;
case Atom::SidebarLeft:
@@ -1352,79 +1343,79 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
case Atom::TableLeft:
{
if (in_para) {
- xmlWriter().writeEndElement(); // </p>
+ writeEndTag(); // </p>
in_para = false;
}
- xmlWriter().writeStartElement("table");
+ writeStartTag(DT_table);
numTableRows = 0;
if (tableColumnCount != 0) {
qDebug() << "ERROR: Nested tables!";
tableColumnCount = 0;
}
tableColumnCount = countTableColumns(atom->next());
- xmlWriter().writeStartElement("tgroup");
+ writeStartTag(DT_tgroup);
xmlWriter().writeAttribute("cols",QString::number(tableColumnCount));
inTableHeader = false;
inTableBody = false;
}
break;
case Atom::TableRight:
- xmlWriter().writeEndElement(); // </tbody>
- xmlWriter().writeEndElement(); // </tgroup>
- xmlWriter().writeEndElement(); // </table>
+ writeEndTag(); // </tbody>
+ writeEndTag(); // </tgroup>
+ writeEndTag(); // </table>
inTableHeader = false;
inTableBody = false;
tableColumnCount = 0;
break;
case Atom::TableHeaderLeft:
if (inTableBody) {
- xmlWriter().writeEndElement(); // </tbody>
- xmlWriter().writeEndElement(); // </tgroup>
- xmlWriter().writeEndElement(); // </table>
+ writeEndTag(); // </tbody>
+ writeEndTag(); // </tgroup>
+ writeEndTag(); // </table>
inTableHeader = false;
inTableBody = false;
tableColumnCount = 0;
- xmlWriter().writeStartElement("table");
+ writeStartTag(DT_table);
numTableRows = 0;
tableColumnCount = countTableColumns(atom);
- xmlWriter().writeStartElement("tgroup");
+ writeStartTag(DT_tgroup);
xmlWriter().writeAttribute("cols",QString::number(tableColumnCount));
}
- xmlWriter().writeStartElement("thead");
+ writeStartTag(DT_thead);
xmlWriter().writeAttribute("valign","top");
- xmlWriter().writeStartElement("row");
+ writeStartTag(DT_row);
xmlWriter().writeAttribute("valign","top");
inTableHeader = true;
inTableBody = false;
break;
case Atom::TableHeaderRight:
- xmlWriter().writeEndElement(); // </row>
+ writeEndTag(); // </row>
if (matchAhead(atom, Atom::TableHeaderLeft)) {
skipAhead = 1;
- xmlWriter().writeStartElement("row");
+ writeStartTag(DT_row);
xmlWriter().writeAttribute("valign","top");
}
else {
- xmlWriter().writeEndElement(); // </thead>
+ writeEndTag(); // </thead>
inTableHeader = false;
inTableBody = true;
- xmlWriter().writeStartElement("tbody");
+ writeStartTag(DT_tbody);
}
break;
case Atom::TableRowLeft:
if (!inTableHeader && !inTableBody) {
inTableBody = true;
- xmlWriter().writeStartElement("tbody");
+ writeStartTag(DT_tbody);
}
- xmlWriter().writeStartElement("row");
+ writeStartTag(DT_row);
xmlWriter().writeAttribute("valign","top");
break;
case Atom::TableRowRight:
- xmlWriter().writeEndElement(); // </row>
+ writeEndTag(); // </row>
break;
case Atom::TableItemLeft:
{
- xmlWriter().writeStartElement("entry");
+ writeStartTag(DT_entry);
QStringList spans = atom->string().split(",");
if (spans.size() == 2) {
if (inTableHeader ||
@@ -1440,9 +1431,9 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
break;
case Atom::TableItemRight:
if (inTableHeader)
- xmlWriter().writeEndElement(); // </entry>
+ writeEndTag(); // </entry>
else {
- xmlWriter().writeEndElement(); // </entry>
+ writeEndTag(); // </entry>
}
if (matchAhead(atom, Atom::ParaLeft))
skipAhead = 1;
@@ -1478,26 +1469,26 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
break;
case Atom::Target:
if (in_para) {
- xmlWriter().writeEndElement(); // </p>
+ writeEndTag(); // </p>
in_para = false;
}
- xmlWriter().writeStartElement("p");
+ writeStartTag(DT_p);
writeGuidAttribute(Doc::canonicalTitle(atom->string()));
xmlWriter().writeAttribute("outputclass","target");
//xmlWriter().writeCharacters(protectEnc(atom->string()));
- xmlWriter().writeEndElement(); // </p>
+ writeEndTag(); // </p>
break;
case Atom::UnhandledFormat:
- xmlWriter().writeStartElement("b");
+ writeStartTag(DT_b);
xmlWriter().writeAttribute("outputclass","error");
xmlWriter().writeCharacters("<Missing DITAXML>");
- xmlWriter().writeEndElement(); // </b>
+ writeEndTag(); // </b>
break;
case Atom::UnknownCommand:
- xmlWriter().writeStartElement("b");
+ writeStartTag(DT_b);
xmlWriter().writeAttribute("outputclass","error unknown-command");
writeCharacters(protectEnc(atom->string()));
- xmlWriter().writeEndElement(); // </b>
+ writeEndTag(); // </b>
break;
case Atom::QmlText:
case Atom::EndQmlText:
@@ -1540,24 +1531,24 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark
// not included: <prolog>
- xmlWriter().writeStartElement(CXXCLASSDETAIL);
- xmlWriter().writeStartElement(CXXCLASSDEFINITION);
+ writeStartTag(DT_cxxClassDetail);
+ writeStartTag(DT_cxxClassDefinition);
writeLocation(nsn);
- xmlWriter().writeEndElement(); // <cxxClassDefinition>
+ writeEndTag(); // <cxxClassDefinition>
- xmlWriter().writeStartElement("apiDesc");
+ writeStartTag(DT_apiDesc);
xmlWriter().writeAttribute("spectitle",title);
Text brief = nsn->doc().briefText(); // zzz
if (!brief.isEmpty()) {
- xmlWriter().writeStartElement("p");
+ writeStartTag(DT_p);
generateText(brief, nsn, marker);
- xmlWriter().writeEndElement(); // </p>
+ writeEndTag(); // </p>
}
generateIncludes(nsn, marker);
generateStatus(nsn, marker);
generateThreadSafeness(nsn, marker);
generateSince(nsn, marker);
- xmlWriter().writeEndElement(); // </apiDesc>
+ writeEndTag(); // </apiDesc>
bool needOtherSection = false;
QList<Section> summarySections;
@@ -1571,51 +1562,51 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark
else {
QString attr;
if (!s->members.isEmpty()) {
- xmlWriter().writeStartElement("section");
+ writeStartTag(DT_section);
attr = cleanRef((*s).name).toLower() + " redundant";
xmlWriter().writeAttribute("outputclass",attr);
- xmlWriter().writeStartElement("title");
+ writeStartTag(DT_title);
xmlWriter().writeAttribute("outputclass","h2");
writeCharacters(protectEnc((*s).name));
- xmlWriter().writeEndElement(); // </title>
+ writeEndTag(); // </title>
generateSection(s->members, inner, marker, CodeMarker::Summary);
generateSectionInheritedList(*s, inner, marker);
- xmlWriter().writeEndElement(); // </section>
+ writeEndTag(); // </section>
}
if (!s->reimpMembers.isEmpty()) {
QString name = QString("Reimplemented ") + (*s).name;
attr = cleanRef(name).toLower() + " redundant";
- xmlWriter().writeStartElement("section");
+ writeStartTag(DT_section);
xmlWriter().writeAttribute("outputclass",attr);
- xmlWriter().writeStartElement("title");
+ writeStartTag(DT_title);
xmlWriter().writeAttribute("outputclass","h2");
writeCharacters(protectEnc(name));
- xmlWriter().writeEndElement(); // </title>
+ writeEndTag(); // </title>
generateSection(s->reimpMembers, inner, marker, CodeMarker::Summary);
generateSectionInheritedList(*s, inner, marker);
- xmlWriter().writeEndElement(); // </section>
+ writeEndTag(); // </section>
}
}
++s;
}
if (needOtherSection) {
- xmlWriter().writeStartElement("section");
+ writeStartTag(DT_section);
xmlWriter().writeAttribute("outputclass","additional-inherited-members redundant");
- xmlWriter().writeStartElement("title");
+ writeStartTag(DT_title);
xmlWriter().writeAttribute("outputclass","h3");
xmlWriter().writeCharacters("Additional Inherited Members");
- xmlWriter().writeEndElement(); // </title>
+ writeEndTag(); // </title>
s = summarySections.begin();
while (s != summarySections.end()) {
if (s->members.isEmpty())
generateSectionInheritedList(*s, inner, marker);
++s;
}
- xmlWriter().writeEndElement(); // </section>
+ writeEndTag(); // </section>
}
writeDetailedDescription(nsn, marker, false, QString("Detailed Description"));
- xmlWriter().writeEndElement(); // </cxxClassDetail>
+ writeEndTag(); // </cxxClassDetail>
// not included: <related-links>
// not included: <cxxClassNested>
@@ -1651,7 +1642,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark
generateLowStatusMembers(inner,marker,CodeMarker::Obsolete);
generateLowStatusMembers(inner,marker,CodeMarker::Compat);
- xmlWriter().writeEndElement(); // </cxxClass>
+ writeEndTag(); // </cxxClass>
}
else if (inner->type() == Node::Class) {
const ClassNode* cn = const_cast<ClassNode*>(static_cast<const ClassNode*>(inner));
@@ -1664,31 +1655,31 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark
// not included: <prolog>
- xmlWriter().writeStartElement(CXXCLASSDETAIL);
- xmlWriter().writeStartElement(CXXCLASSDEFINITION);
- xmlWriter().writeStartElement(CXXCLASSACCESSSPECIFIER);
+ writeStartTag(DT_cxxClassDetail);
+ writeStartTag(DT_cxxClassDefinition);
+ writeStartTag(DT_cxxClassAccessSpecifier);
xmlWriter().writeAttribute("value",inner->accessString());
- xmlWriter().writeEndElement(); // <cxxClassAccessSpecifier>
+ writeEndTag(); // <cxxClassAccessSpecifier>
if (cn->isAbstract()) {
- xmlWriter().writeStartElement(CXXCLASSABSTRACT);
+ writeStartTag(DT_cxxClassAbstract);
xmlWriter().writeAttribute("name","abstract");
xmlWriter().writeAttribute("value","abstract");
- xmlWriter().writeEndElement(); // </cxxClassAbstract>
+ writeEndTag(); // </cxxClassAbstract>
}
writeDerivations(cn, marker); // <cxxClassDerivations>
// not included: <cxxClassTemplateParameters>
writeLocation(cn);
- xmlWriter().writeEndElement(); // <cxxClassDefinition>
+ writeEndTag(); // <cxxClassDefinition>
- xmlWriter().writeStartElement("apiDesc");
+ writeStartTag(DT_apiDesc);
xmlWriter().writeAttribute("spectitle",title);
Text brief = cn->doc().briefText(); // zzz
if (!brief.isEmpty()) {
- xmlWriter().writeStartElement("p");
+ writeStartTag(DT_p);
generateText(brief, cn, marker);
- xmlWriter().writeEndElement(); // </p>
+ writeEndTag(); // </p>
}
generateIncludes(cn, marker);
generateStatus(cn, marker);
@@ -1696,7 +1687,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark
generateInheritedBy(cn, marker);
generateThreadSafeness(cn, marker);
generateSince(cn, marker);
- xmlWriter().writeEndElement(); // </apiDesc>
+ writeEndTag(); // </apiDesc>
bool needOtherSection = false;
QList<Section> summarySections;
@@ -1710,54 +1701,54 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark
else {
QString attr;
if (!s->members.isEmpty()) {
- xmlWriter().writeStartElement("section");
+ writeStartTag(DT_section);
attr = cleanRef((*s).name).toLower() + " redundant";
xmlWriter().writeAttribute("outputclass",attr);
- xmlWriter().writeStartElement("title");
+ writeStartTag(DT_title);
xmlWriter().writeAttribute("outputclass","h2");
writeCharacters(protectEnc((*s).name));
- xmlWriter().writeEndElement(); // </title>
+ writeEndTag(); // </title>
generateSection(s->members, inner, marker, CodeMarker::Summary);
generateSectionInheritedList(*s, inner, marker);
- xmlWriter().writeEndElement(); // </section>
+ writeEndTag(); // </section>
}
if (!s->reimpMembers.isEmpty()) {
QString name = QString("Reimplemented ") + (*s).name;
attr = cleanRef(name).toLower() + " redundant";
- xmlWriter().writeStartElement("section");
+ writeStartTag(DT_section);
xmlWriter().writeAttribute("outputclass",attr);
- xmlWriter().writeStartElement("title");
+ writeStartTag(DT_title);
xmlWriter().writeAttribute("outputclass","h2");
writeCharacters(protectEnc(name));
- xmlWriter().writeEndElement(); // </title>
+ writeEndTag(); // </title>
generateSection(s->reimpMembers, inner, marker, CodeMarker::Summary);
generateSectionInheritedList(*s, inner, marker);
- xmlWriter().writeEndElement(); // </section>
+ writeEndTag(); // </section>
}
}
++s;
}
if (needOtherSection) {
- xmlWriter().writeStartElement("section");
+ writeStartTag(DT_section);
xmlWriter().writeAttribute("outputclass","additional-inherited-members redundant");
- xmlWriter().writeStartElement("title");
+ writeStartTag(DT_title);
xmlWriter().writeAttribute("outputclass","h3");
xmlWriter().writeCharacters("Additional Inherited Members");
- xmlWriter().writeEndElement(); // </title>
+ writeEndTag(); // </title>
s = summarySections.begin();
while (s != summarySections.end()) {
if (s->members.isEmpty())
generateSectionInheritedList(*s, inner, marker);
++s;
}
- xmlWriter().writeEndElement(); // </section>
+ writeEndTag(); // </section>
}
writeDetailedDescription(cn, marker, false, QString("Detailed Description"));
// not included: <example> or <apiImpl>
- xmlWriter().writeEndElement(); // </cxxClassDetail>
+ writeEndTag(); // </cxxClassDetail>
// not included: <related-links>
// not included: <cxxClassNested>
@@ -1787,7 +1778,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark
generateLowStatusMembers(inner,marker,CodeMarker::Obsolete);
generateLowStatusMembers(inner,marker,CodeMarker::Compat);
- xmlWriter().writeEndElement(); // </cxxClass>
+ writeEndTag(); // </cxxClass>
}
else if ((inner->type() == Node::Fake) && (inner->subType() == Node::HeaderFile)) {
const FakeNode* fn = const_cast<FakeNode*>(static_cast<const FakeNode*>(inner));
@@ -1803,20 +1794,20 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark
*/
generateHeader(inner, fullTitle);
generateBrief(inner, marker); // <shortdesc>
- xmlWriter().writeStartElement(CXXCLASSDETAIL);
- xmlWriter().writeStartElement("apiDesc");
+ writeStartTag(DT_cxxClassDetail);
+ writeStartTag(DT_apiDesc);
xmlWriter().writeAttribute("spectitle",title);
Text brief = fn->doc().briefText(); // zzz
if (!brief.isEmpty()) {
- xmlWriter().writeStartElement("p");
+ writeStartTag(DT_p);
generateText(brief, fn, marker);
- xmlWriter().writeEndElement(); // </p>
+ writeEndTag(); // </p>
}
generateIncludes(fn, marker);
generateStatus(fn, marker);
generateThreadSafeness(fn, marker);
generateSince(fn, marker);
- xmlWriter().writeEndElement(); // </apiDesc>
+ writeEndTag(); // </apiDesc>
bool needOtherSection = false;
QList<Section> summarySections;
@@ -1830,51 +1821,51 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark
else {
QString attr;
if (!s->members.isEmpty()) {
- xmlWriter().writeStartElement("section");
+ writeStartTag(DT_section);
attr = cleanRef((*s).name).toLower() + " redundant";
xmlWriter().writeAttribute("outputclass",attr);
- xmlWriter().writeStartElement("title");
+ writeStartTag(DT_title);
xmlWriter().writeAttribute("outputclass","h2");
writeCharacters(protectEnc((*s).name));
- xmlWriter().writeEndElement(); // </title>
+ writeEndTag(); // </title>
generateSection(s->members, inner, marker, CodeMarker::Summary);
generateSectionInheritedList(*s, inner, marker);
- xmlWriter().writeEndElement(); // </section>
+ writeEndTag(); // </section>
}
if (!s->reimpMembers.isEmpty()) {
QString name = QString("Reimplemented ") + (*s).name;
attr = cleanRef(name).toLower() + " redundant";
- xmlWriter().writeStartElement("section");
+ writeStartTag(DT_section);
xmlWriter().writeAttribute("outputclass",attr);
- xmlWriter().writeStartElement("title");
+ writeStartTag(DT_title);
xmlWriter().writeAttribute("outputclass","h2");
writeCharacters(protectEnc(name));
- xmlWriter().writeEndElement(); // </title>
+ writeEndTag(); // </title>
generateSection(s->reimpMembers, inner, marker, CodeMarker::Summary);
generateSectionInheritedList(*s, inner, marker);
- xmlWriter().writeEndElement(); // </section>
+ writeEndTag(); // </section>
}
}
++s;
}
if (needOtherSection) {
- xmlWriter().writeStartElement("section");
+ writeStartTag(DT_section);
xmlWriter().writeAttribute("outputclass","additional-inherited-members redundant");
- xmlWriter().writeStartElement("title");
+ writeStartTag(DT_title);
xmlWriter().writeAttribute("outputclass","h3");
xmlWriter().writeCharacters("Additional Inherited Members");
- xmlWriter().writeEndElement(); // </title>
+ writeEndTag(); // </title>
s = summarySections.begin();
while (s != summarySections.end()) {
if (s->members.isEmpty())
generateSectionInheritedList(*s, inner, marker);
++s;
}
- xmlWriter().writeEndElement(); // </section>
+ writeEndTag(); // </section>
}
writeDetailedDescription(fn, marker, false, QString("Detailed Description"));
- xmlWriter().writeEndElement(); // </cxxClassDetail>
+ writeEndTag(); // </cxxClassDetail>
// not included: <related-links>
// not included: <cxxClassNested>
@@ -1909,7 +1900,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark
}
generateLowStatusMembers(inner,marker,CodeMarker::Obsolete);
generateLowStatusMembers(inner,marker,CodeMarker::Compat);
- xmlWriter().writeEndElement(); // </cxxClass>
+ writeEndTag(); // </cxxClass>
}
else if ((inner->type() == Node::Fake) && (inner->subType() == Node::QmlClass)) {
const QmlClassNode* qcn = const_cast<QmlClassNode*>(static_cast<const QmlClassNode*>(inner));
@@ -1925,20 +1916,20 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark
// not included: <prolog>
- xmlWriter().writeStartElement(CXXCLASSDETAIL);
- xmlWriter().writeStartElement("apiDesc");
+ writeStartTag(DT_cxxClassDetail);
+ writeStartTag(DT_apiDesc);
xmlWriter().writeAttribute("spectitle",title);
Text brief = qcn->doc().briefText(); // zzz
if (!brief.isEmpty()) {
- xmlWriter().writeStartElement("p");
+ writeStartTag(DT_p);
generateText(brief, qcn, marker);
- xmlWriter().writeEndElement(); // </p>
+ writeEndTag(); // </p>
}
generateQmlInstantiates(qcn, marker);
generateQmlInherits(qcn, marker);
generateQmlInheritedBy(qcn, marker);
generateSince(qcn, marker);
- xmlWriter().writeEndElement(); // </apiDesc>
+ writeEndTag(); // </apiDesc>
QList<Section> summarySections;
summarySections = marker->qmlSections(qcn,CodeMarker::Summary,0);
@@ -1946,17 +1937,17 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark
while (s != summarySections.end()) {
QString attr;
if (!s->members.isEmpty()) {
- xmlWriter().writeStartElement("section");
+ writeStartTag(DT_section);
attr = cleanRef((*s).name).toLower() + " redundant";
xmlWriter().writeAttribute("outputclass",attr);
- xmlWriter().writeStartElement("title");
+ writeStartTag(DT_title);
xmlWriter().writeAttribute("outputclass","h2");
writeCharacters(protectEnc((*s).name));
- xmlWriter().writeEndElement(); // </title>
+ writeEndTag(); // </title>
generateQmlSummary(*s,qcn,marker);
//generateSection(s->members, inner, marker, CodeMarker::Summary);
//generateSectionInheritedList(*s, inner, marker);
- xmlWriter().writeEndElement(); // </section>
+ writeEndTag(); // </section>
}
++s;
}
@@ -1972,26 +1963,26 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark
if (!s->members.isEmpty()) {
QString attr;
inSection = true;
- xmlWriter().writeStartElement("section");
+ writeStartTag(DT_section);
attr = cleanRef((*s).name).toLower();
xmlWriter().writeAttribute("outputclass",attr);
- xmlWriter().writeStartElement("title");
+ writeStartTag(DT_title);
xmlWriter().writeAttribute("outputclass","h2");
writeCharacters(protectEnc((*s).name));
- xmlWriter().writeEndElement(); // </title>
+ writeEndTag(); // </title>
NodeList::ConstIterator m = (*s).members.begin();
while (m != (*s).members.end()) {
generateDetailedQmlMember(*m, qcn, marker);
++m;
}
- xmlWriter().writeEndElement(); // </section>
+ writeEndTag(); // </section>
inSection = false;
}
++s;
}
- xmlWriter().writeEndElement(); // </cxxClassDetail>
- xmlWriter().writeEndElement(); // </cxxClass>
+ writeEndTag(); // </cxxClassDetail>
+ writeEndTag(); // </cxxClass>
}
}
@@ -2001,13 +1992,13 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark
*/
void DitaXmlGenerator::writeXrefListItem(const QString& link, const QString& text)
{
- xmlWriter().writeStartElement("li");
- xmlWriter().writeStartElement("xref");
+ writeStartTag(DT_li);
+ writeStartTag(DT_xref);
// formathtml
xmlWriter().writeAttribute("href",link);
writeCharacters(text);
- xmlWriter().writeEndElement(); // </xref>
- xmlWriter().writeEndElement(); // </li>
+ writeEndTag(); // </xref>
+ writeEndTag(); // </li>
}
/*!
@@ -2033,28 +2024,28 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode* fake, CodeMarker* marker
generateHeader(fake, fullTitle);
generateBrief(fake, marker); // <shortdesc>
- xmlWriter().writeStartElement("body");
+ writeStartTag(DT_body);
if (fake->subType() == Node::Module) {
generateStatus(fake, marker);
if (moduleNamespaceMap.contains(fake->name())) {
- xmlWriter().writeStartElement("section");
+ writeStartTag(DT_section);
xmlWriter().writeAttribute("outputclass","namespaces");
- xmlWriter().writeStartElement("title");
+ writeStartTag(DT_title);
xmlWriter().writeAttribute("outputclass","h2");
xmlWriter().writeCharacters("Namespaces");
- xmlWriter().writeEndElement(); // </title>
+ writeEndTag(); // </title>
generateAnnotatedList(fake, marker, moduleNamespaceMap[fake->name()]);
- xmlWriter().writeEndElement(); // </section>
+ writeEndTag(); // </section>
}
if (moduleClassMap.contains(fake->name())) {
- xmlWriter().writeStartElement("section");
+ writeStartTag(DT_section);
xmlWriter().writeAttribute("outputclass","classes");
- xmlWriter().writeStartElement("title");
+ writeStartTag(DT_title);
xmlWriter().writeAttribute("outputclass","h2");
xmlWriter().writeCharacters("Classes");
- xmlWriter().writeEndElement(); // </title>
+ writeEndTag(); // </title>
generateAnnotatedList(fake, marker, moduleClassMap[fake->name()]);
- xmlWriter().writeEndElement(); // </section>
+ writeEndTag(); // </section>
}
}
@@ -2062,11 +2053,11 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode* fake, CodeMarker* marker
if (fake->subType() == Node::File) {
Text text;
Quoter quoter;
- xmlWriter().writeStartElement("p");
+ writeStartTag(DT_p);
xmlWriter().writeAttribute("outputclass", "small-subtitle");
text << fake->subTitle();
generateText(text, fake, marker);
- xmlWriter().writeEndElement(); // </p>
+ writeEndTag(); // </p>
Doc::quoteFromFile(fake->doc().location(), quoter, fake->name());
QString code = quoter.quoteTo(fake->location(), "", "");
text.clear();
@@ -2091,9 +2082,9 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode* fake, CodeMarker* marker
generateAnnotatedList(fake, marker, groupMembersMap);
}
}
- xmlWriter().writeEndElement(); // </body>
+ writeEndTag(); // </body>
writeRelatedLinks(fake, marker);
- xmlWriter().writeEndElement(); // </topic>
+ writeEndTag(); // </topic>
}
/*!
@@ -2108,13 +2099,13 @@ void DitaXmlGenerator::writeLink(const Node* node,
{
if (node) {
QString link = fileName(node) + "#" + node->guid();
- xmlWriter().writeStartElement("link");
+ writeStartTag(DT_link);
xmlWriter().writeAttribute("href", link);
xmlWriter().writeAttribute("role", role);
- xmlWriter().writeStartElement("linktext");
+ writeStartTag(DT_linktext);
writeCharacters(text);
- xmlWriter().writeEndElement(); // </linktext>
- xmlWriter().writeEndElement(); // </link>
+ writeEndTag(); // </linktext>
+ writeEndTag(); // </link>
}
}
@@ -2130,7 +2121,7 @@ void DitaXmlGenerator::writeRelatedLinks(const FakeNode* node, CodeMarker* marke
const Node* linkNode = 0;
QPair<QString,QString> linkPair;
if (node && !node->links().empty()) {
- xmlWriter().writeStartElement("related-links");
+ writeStartTag(DT_relatedLinks);
if (node->links().contains(Node::PreviousLink)) {
linkPair = node->links()[Node::PreviousLink];
linkNode = findNodeForTarget(linkPair.first, node, marker);
@@ -2146,7 +2137,7 @@ void DitaXmlGenerator::writeRelatedLinks(const FakeNode* node, CodeMarker* marke
linkNode = findNodeForTarget(linkPair.first, node, marker);
writeLink(linkNode, linkPair.second, "parent");
}
- xmlWriter().writeEndElement(); // </related-links>
+ writeEndTag(); // </related-links>
}
}
@@ -2172,59 +2163,59 @@ void DitaXmlGenerator::generateHeader(const Node* node,
if (!node)
return;
+ DitaTag mainTag = DT_cxxClass;
+ DitaTag nameTag = DT_apiName;
QString doctype;
- QString mainElement;
- QString nameElement;
QString dtd;
QString base;
QString version;
QString outputclass;
if (node->type() == Node::Class) {
- mainElement = "cxxClass";
- nameElement = "apiName";
+ mainTag = DT_cxxClass;
+ nameTag = DT_apiName;
dtd = "dtd/cxxClass.dtd";
version = "0.6.0";
- doctype = "<!DOCTYPE " + mainElement +
+ doctype = "<!DOCTYPE " + ditaTags[mainTag] +
" PUBLIC \"-//NOKIA//DTD DITA C++ API Class Reference Type v" +
version + "//EN\" \"" + dtd + "\">";
}
else if (node->type() == Node::Namespace) {
- mainElement = "cxxClass";
- nameElement = "apiName";
+ mainTag = DT_cxxClass;
+ nameTag = DT_apiName;
dtd = "dtd/cxxClass.dtd";
version = "0.6.0";
- doctype = "<!DOCTYPE " + mainElement +
+ doctype = "<!DOCTYPE " + ditaTags[mainTag] +
" PUBLIC \"-//NOKIA//DTD DITA C++ API Class Reference Type v" +
version + "//EN\" \"" + dtd + "\">";
outputclass = "namespace";
}
else if (node->type() == Node::Fake || subpage) {
if (node->subType() == Node::HeaderFile) {
- mainElement = "cxxClass";
- nameElement = "apiName";
+ mainTag = DT_cxxClass;
+ nameTag = DT_apiName;
dtd = "dtd/cxxClass.dtd";
version = "0.6.0";
- doctype = "<!DOCTYPE " + mainElement +
+ doctype = "<!DOCTYPE " + ditaTags[mainTag] +
" PUBLIC \"-//NOKIA//DTD DITA C++ API Class Reference Type v" +
version + "//EN\" \"" + dtd + "\">";
outputclass = "headerfile";
}
else if (node->subType() == Node::QmlClass) {
- mainElement = "cxxClass";
- nameElement = "apiName";
+ mainTag = DT_cxxClass;
+ nameTag = DT_apiName;
dtd = "dtd/cxxClass.dtd";
version = "0.6.0";
- doctype = "<!DOCTYPE " + mainElement +
+ doctype = "<!DOCTYPE " + ditaTags[mainTag] +
" PUBLIC \"-//NOKIA//DTD DITA C++ API Class Reference Type v" +
version + "//EN\" \"" + dtd + "\">";
outputclass = "QML-class";
}
else {
- mainElement = "topic";
- nameElement = "title";
+ mainTag = DT_topic;
+ nameTag = DT_title;
dtd = "dtd/topic.dtd";
- doctype = "<!DOCTYPE " + mainElement +
+ doctype = "<!DOCTYPE " + ditaTags[mainTag] +
" PUBLIC \"-//OASIS//DTD DITA Topic//EN\" \"" + dtd + "\">";
switch (node->subType()) {
case Node::Page:
@@ -2256,13 +2247,13 @@ void DitaXmlGenerator::generateHeader(const Node* node,
xmlWriter().writeDTD(doctype);
xmlWriter().writeComment(node->doc().location().fileName());
- xmlWriter().writeStartElement(mainElement);
+ writeStartTag(mainTag);
xmlWriter().writeAttribute("id",node->guid());
if (!outputclass.isEmpty())
xmlWriter().writeAttribute("outputclass",outputclass);
- xmlWriter().writeStartElement(nameElement); // <title> or <apiName>
+ writeStartTag(nameTag); // <title> or <apiName>
writeCharacters(name);
- xmlWriter().writeEndElement(); // </title> or </apiName>
+ writeEndTag(); // </title> or </apiName>
}
/*!
@@ -2283,9 +2274,9 @@ void DitaXmlGenerator::generateBrief(const Node* node, CodeMarker* marker)
void DitaXmlGenerator::generateIncludes(const InnerNode* inner, CodeMarker* marker)
{
if (!inner->includes().isEmpty()) {
- xmlWriter().writeStartElement("codeblock");
+ writeStartTag(DT_codeblock);
writeText(marker->markedUpIncludes(inner->includes()), marker, inner);
- xmlWriter().writeEndElement(); // </codeblock>
+ writeEndTag(); // </codeblock>
}
}
@@ -2557,20 +2548,20 @@ void DitaXmlGenerator::generateClassHierarchy(const Node* relative,
QStack<NodeMap > stack;
stack.push(topLevel);
- xmlWriter().writeStartElement("ul");
+ writeStartTag(DT_ul);
while (!stack.isEmpty()) {
if (stack.top().isEmpty()) {
stack.pop();
- xmlWriter().writeEndElement(); // </ul>
+ writeEndTag(); // </ul>
if (!stack.isEmpty())
- xmlWriter().writeEndElement(); // </li>
+ writeEndTag(); // </li>
}
else {
const ClassNode *child =
static_cast<const ClassNode *>(*stack.top().begin());
- xmlWriter().writeStartElement("li");
+ writeStartTag(DT_li);
generateFullName(child, relative, marker);
- xmlWriter().writeEndElement(); // </li>
+ writeEndTag(); // </li>
stack.top().erase(stack.top().begin());
NodeMap newTop;
@@ -2580,8 +2571,8 @@ void DitaXmlGenerator::generateClassHierarchy(const Node* relative,
}
if (!newTop.isEmpty()) {
stack.push(newTop);
- xmlWriter().writeStartElement("li");
- xmlWriter().writeStartElement("ul");
+ writeStartTag(DT_li);
+ writeStartTag(DT_ul);
}
}
}
@@ -2597,11 +2588,11 @@ void DitaXmlGenerator::generateAnnotatedList(const Node* relative,
{
if (nodeMap.isEmpty())
return;
- xmlWriter().writeStartElement("table");
+ writeStartTag(DT_table);
xmlWriter().writeAttribute("outputclass","annotated");
- xmlWriter().writeStartElement("tgroup");
+ writeStartTag(DT_tgroup);
xmlWriter().writeAttribute("cols","2");
- xmlWriter().writeStartElement("tbody");
+ writeStartTag(DT_tbody);
foreach (const QString& name, nodeMap.keys()) {
const Node* node = nodeMap[name];
@@ -2609,35 +2600,35 @@ void DitaXmlGenerator::generateAnnotatedList(const Node* relative,
if (node->status() == Node::Obsolete)
continue;
- xmlWriter().writeStartElement("row");
- xmlWriter().writeStartElement("entry");
- xmlWriter().writeStartElement("p");
+ writeStartTag(DT_row);
+ writeStartTag(DT_entry);
+ writeStartTag(DT_p);
generateFullName(node, relative, marker);
- xmlWriter().writeEndElement(); // </p>
- xmlWriter().writeEndElement(); // <entry>
+ writeEndTag(); // </p>
+ writeEndTag(); // <entry>
if (!(node->type() == Node::Fake)) {
Text brief = node->doc().trimmedBriefText(name);
if (!brief.isEmpty()) {
- xmlWriter().writeStartElement("entry");
- xmlWriter().writeStartElement("p");
+ writeStartTag(DT_entry);
+ writeStartTag(DT_p);
generateText(brief, node, marker);
- xmlWriter().writeEndElement(); // </p>
- xmlWriter().writeEndElement(); // <entry>
+ writeEndTag(); // </p>
+ writeEndTag(); // <entry>
}
}
else {
- xmlWriter().writeStartElement("entry");
- xmlWriter().writeStartElement("p");
+ writeStartTag(DT_entry);
+ writeStartTag(DT_p);
writeCharacters(protectEnc(node->doc().briefText().toString())); // zzz
- xmlWriter().writeEndElement(); // </p>
- xmlWriter().writeEndElement(); // <entry>
+ writeEndTag(); // </p>
+ writeEndTag(); // <entry>
}
- xmlWriter().writeEndElement(); // </row>
+ writeEndTag(); // </row>
}
- xmlWriter().writeEndElement(); // </tbody>
- xmlWriter().writeEndElement(); // </tgroup>
- xmlWriter().writeEndElement(); // </table>
+ writeEndTag(); // </tbody>
+ writeEndTag(); // </tgroup>
+ writeEndTag(); // </table>
}
/*!
@@ -2774,27 +2765,27 @@ void DitaXmlGenerator::generateCompactList(const Node* relative,
Output the alphabet as a row of links.
*/
if (includeAlphabet) {
- xmlWriter().writeStartElement("p");
+ writeStartTag(DT_p);
xmlWriter().writeAttribute("outputclass","alphabet");
for (int i = 0; i < 26; i++) {
QChar ch('a' + i);
if (usedParagraphNames.contains(char('a' + i))) {
- xmlWriter().writeStartElement("xref");
+ writeStartTag(DT_xref);
// formathtml
QString guid = lookupGuid(outFileName(),QString(ch));
QString attr = outFileName() + QString("#%1").arg(guid);
xmlWriter().writeAttribute("href", attr);
xmlWriter().writeCharacters(QString(ch.toUpper()));
- xmlWriter().writeEndElement(); // </xref>
+ writeEndTag(); // </xref>
}
}
- xmlWriter().writeEndElement(); // </p>
+ writeEndTag(); // </p>
}
/*
Output a <p> element to contain all the <dl> elements.
*/
- xmlWriter().writeStartElement("p");
+ writeStartTag(DT_p);
xmlWriter().writeAttribute("outputclass","compactlist");
for (int i=0; i<classMap.count()-1; i++) {
@@ -2809,25 +2800,25 @@ void DitaXmlGenerator::generateCompactList(const Node* relative,
*/
if (curParOffset == 0) {
if (i > 0) {
- xmlWriter().writeEndElement(); // </dlentry>
- xmlWriter().writeEndElement(); // </dl>
+ writeEndTag(); // </dlentry>
+ writeEndTag(); // </dl>
}
- xmlWriter().writeStartElement("dl");
- xmlWriter().writeStartElement("dlentry");
- xmlWriter().writeStartElement("dt");
+ writeStartTag(DT_dl);
+ writeStartTag(DT_dlentry);
+ writeStartTag(DT_dt);
if (includeAlphabet) {
QChar c = paragraphName[curParNr][0].toLower();
writeGuidAttribute(QString(c));
}
xmlWriter().writeAttribute("outputclass","sublist-header");
xmlWriter().writeCharacters(paragraphName[curParNr]);
- xmlWriter().writeEndElement(); // </dt>
+ writeEndTag(); // </dt>
}
/*
Output a <dd> for the current offset in the current paragraph.
*/
- xmlWriter().writeStartElement("dd");
+ writeStartTag(DT_dd);
if ((curParNr < NumParagraphs) &&
!paragraphName[curParNr].isEmpty()) {
NodeMap::Iterator it;
@@ -2839,7 +2830,7 @@ void DitaXmlGenerator::generateCompactList(const Node* relative,
Previously, we used generateFullName() for this, but we
require some special formatting.
*/
- xmlWriter().writeStartElement("xref");
+ writeStartTag(DT_xref);
// formathtml
xmlWriter().writeAttribute("href",linkForNode(it.value(), relative));
@@ -2849,19 +2840,19 @@ void DitaXmlGenerator::generateCompactList(const Node* relative,
else
pieces = fullName(it.value(), relative, marker).split("::");
xmlWriter().writeCharacters(protectEnc(pieces.last()));
- xmlWriter().writeEndElement(); // </xref>
+ writeEndTag(); // </xref>
if (pieces.size() > 1) {
xmlWriter().writeCharacters(" (");
generateFullName(it.value()->parent(),relative,marker);
xmlWriter().writeCharacters(")");
}
}
- xmlWriter().writeEndElement(); // </dd>
+ writeEndTag(); // </dd>
curParOffset++;
}
- xmlWriter().writeEndElement(); // </dlentry>
- xmlWriter().writeEndElement(); // </dl>
- xmlWriter().writeEndElement(); // </p>
+ writeEndTag(); // </dlentry>
+ writeEndTag(); // </dl>
+ writeEndTag(); // </p>
}
/*!
@@ -2870,35 +2861,35 @@ void DitaXmlGenerator::generateCompactList(const Node* relative,
void DitaXmlGenerator::generateFunctionIndex(const Node* relative,
CodeMarker* marker)
{
- xmlWriter().writeStartElement("p");
+ writeStartTag(DT_p);
xmlWriter().writeAttribute("outputclass","alphabet");
for (int i = 0; i < 26; i++) {
QChar ch('a' + i);
- xmlWriter().writeStartElement("xref");
+ writeStartTag(DT_xref);
// formathtml
QString guid = lookupGuid(outFileName(),QString(ch));
QString attr = outFileName() + QString("#%1").arg(guid);
xmlWriter().writeAttribute("href", attr);
xmlWriter().writeCharacters(QString(ch.toUpper()));
- xmlWriter().writeEndElement(); // </xref>
+ writeEndTag(); // </xref>
}
- xmlWriter().writeEndElement(); // </p>
+ writeEndTag(); // </p>
char nextLetter = 'a';
char currentLetter;
- xmlWriter().writeStartElement("ul");
+ writeStartTag(DT_ul);
QMap<QString, NodeMap >::ConstIterator f = funcIndex.begin();
while (f != funcIndex.end()) {
- xmlWriter().writeStartElement("li");
+ writeStartTag(DT_li);
currentLetter = f.key()[0].unicode();
while (islower(currentLetter) && currentLetter >= nextLetter) {
- xmlWriter().writeStartElement("p");
+ writeStartTag(DT_p);
writeGuidAttribute(QString(nextLetter));
xmlWriter().writeAttribute("outputclass","target");
xmlWriter().writeCharacters(QString(nextLetter));
- xmlWriter().writeEndElement(); // </p>
+ writeEndTag(); // </p>
nextLetter++;
}
xmlWriter().writeCharacters(protectEnc(f.key()));
@@ -2909,10 +2900,10 @@ void DitaXmlGenerator::generateFunctionIndex(const Node* relative,
generateFullName((*s)->parent(), relative, marker, *s);
++s;
}
- xmlWriter().writeEndElement(); // </li>
+ writeEndTag(); // </li>
++f;
}
- xmlWriter().writeEndElement(); // </ul>
+ writeEndTag(); // </ul>
}
/*!
@@ -2925,14 +2916,14 @@ void DitaXmlGenerator::generateLegaleseList(const Node* relative,
while (it != legaleseTexts.end()) {
Text text = it.key();
generateText(text, relative, marker);
- xmlWriter().writeStartElement("ul");
+ writeStartTag(DT_ul);
do {
- xmlWriter().writeStartElement("li");
+ writeStartTag(DT_li);
generateFullName(it.value(), relative, marker);
- xmlWriter().writeEndElement(); // </li>
+ writeEndTag(); // </li>
++it;
} while (it != legaleseTexts.end() && it.key() == text);
- xmlWriter().writeEndElement(); //</ul>
+ writeEndTag(); //</ul>
}
}
@@ -3053,53 +3044,53 @@ void DitaXmlGenerator::generateOverviewList(const Node* relative, CodeMarker* /*
if (!fakeNodeMap.isEmpty()) {
foreach (const QString& groupTitle, groupTitlesMap.keys()) {
const FakeNode* groupNode = groupTitlesMap[groupTitle];
- xmlWriter().writeStartElement("p");
+ writeStartTag(DT_p);
xmlWriter().writeAttribute("outputclass","h3");
- xmlWriter().writeStartElement("xref");
+ writeStartTag(DT_xref);
// formathtml
xmlWriter().writeAttribute("href",linkForNode(groupNode, relative));
writeCharacters(protectEnc(groupNode->fullTitle()));
- xmlWriter().writeEndElement(); // </xref>
- xmlWriter().writeEndElement(); // </p>
+ writeEndTag(); // </xref>
+ writeEndTag(); // </p>
if (fakeNodeMap[groupNode].count() == 0)
continue;
- xmlWriter().writeStartElement("ul");
+ writeStartTag(DT_ul);
foreach (const FakeNode* fakeNode, fakeNodeMap[groupNode]) {
QString title = fakeNode->fullTitle();
if (title.startsWith("The "))
title.remove(0, 4);
- xmlWriter().writeStartElement("li");
- xmlWriter().writeStartElement("xref");
+ writeStartTag(DT_li);
+ writeStartTag(DT_xref);
// formathtml
xmlWriter().writeAttribute("href",linkForNode(fakeNode, relative));
writeCharacters(protectEnc(title));
- xmlWriter().writeEndElement(); // </xref>
- xmlWriter().writeEndElement(); // </li>
+ writeEndTag(); // </xref>
+ writeEndTag(); // </li>
}
- xmlWriter().writeEndElement(); // </ul>
+ writeEndTag(); // </ul>
}
}
if (!uncategorizedNodeMap.isEmpty()) {
- xmlWriter().writeStartElement("p");
+ writeStartTag(DT_p);
xmlWriter().writeAttribute("outputclass","h3");
xmlWriter().writeCharacters("Miscellaneous");
- xmlWriter().writeEndElement(); // </p>
- xmlWriter().writeStartElement("ul");
+ writeEndTag(); // </p>
+ writeStartTag(DT_ul);
foreach (const FakeNode *fakeNode, uncategorizedNodeMap) {
QString title = fakeNode->fullTitle();
if (title.startsWith("The "))
title.remove(0, 4);
- xmlWriter().writeStartElement("li");
- xmlWriter().writeStartElement("xref");
+ writeStartTag(DT_li);
+ writeStartTag(DT_xref);
// formathtml
xmlWriter().writeAttribute("href",linkForNode(fakeNode, relative));
writeCharacters(protectEnc(title));
- xmlWriter().writeEndElement(); // </xref>
- xmlWriter().writeEndElement(); // </li>
+ writeEndTag(); // </xref>
+ writeEndTag(); // </li>
}
- xmlWriter().writeEndElement(); // </ul>
+ writeEndTag(); // </ul>
}
}
@@ -3114,18 +3105,18 @@ void DitaXmlGenerator::generateSection(const NodeList& nl,
CodeMarker::SynopsisStyle style)
{
if (!nl.isEmpty()) {
- xmlWriter().writeStartElement("ul");
+ writeStartTag(DT_ul);
NodeList::ConstIterator m = nl.begin();
while (m != nl.end()) {
if ((*m)->access() != Node::Private) {
- xmlWriter().writeStartElement("li");
+ writeStartTag(DT_li);
QString marked = getMarkedUpSynopsis(*m, relative, marker, style);
writeText(marked, marker, relative);
- xmlWriter().writeEndElement(); // </li>
+ writeEndTag(); // </li>
}
++m;
}
- xmlWriter().writeEndElement(); // </ul>
+ writeEndTag(); // </ul>
}
}
@@ -3138,10 +3129,10 @@ void DitaXmlGenerator::generateSectionInheritedList(const Section& section,
{
if (section.inherited.isEmpty())
return;
- xmlWriter().writeStartElement("ul");
+ writeStartTag(DT_ul);
QList<QPair<ClassNode*,int> >::ConstIterator p = section.inherited.begin();
while (p != section.inherited.end()) {
- xmlWriter().writeStartElement("li");
+ writeStartTag(DT_li);
QString text;
text.setNum((*p).second);
text += " ";
@@ -3151,7 +3142,7 @@ void DitaXmlGenerator::generateSectionInheritedList(const Section& section,
text += section.pluralMember;
text += " inherited from ";
writeCharacters(text);
- xmlWriter().writeStartElement("xref");
+ writeStartTag(DT_xref);
// formathtml
// zzz
text = fileName((*p).first) + "#";
@@ -3159,11 +3150,11 @@ void DitaXmlGenerator::generateSectionInheritedList(const Section& section,
xmlWriter().writeAttribute("href",text);
text = protectEnc(marker->plainFullName((*p).first, relative));
writeCharacters(text);
- xmlWriter().writeEndElement(); // </xref>
- xmlWriter().writeEndElement(); // </li>
+ writeEndTag(); // </xref>
+ writeEndTag(); // </li>
++p;
}
- xmlWriter().writeEndElement(); // </ul>
+ writeEndTag(); // </ul>
}
/*!
@@ -3312,18 +3303,18 @@ void DitaXmlGenerator::writeText(const QString& markedCode,
writeCharacters(html);
html.clear();
}
- xmlWriter().writeStartElement("i");
+ writeStartTag(DT_i);
writeCharacters(arg.toString());
- xmlWriter().writeEndElement(); // </i>
+ writeEndTag(); // </i>
}
else if (k == 5) { // <@extra>
if (!html.isEmpty()) {
writeCharacters(html);
html.clear();
}
- xmlWriter().writeStartElement("tt");
+ writeStartTag(DT_tt);
writeCharacters(arg.toString());
- xmlWriter().writeEndElement(); // </tt>
+ writeEndTag(); // </tt>
}
else {
if (!html.isEmpty()) {
@@ -3375,10 +3366,10 @@ void DitaXmlGenerator::generateLink(const Atom* atom,
writeCharacters(protectEnc(atom->string().left(k)));
if (link.isEmpty()) {
if (showBrokenLinks)
- xmlWriter().writeEndElement(); // </i>
+ writeEndTag(); // </i>
}
else
- xmlWriter().writeEndElement(); // </xref>
+ writeEndTag(); // </xref>
inLink = false;
writeCharacters(protectEnc(atom->string().mid(k)));
}
@@ -3387,12 +3378,12 @@ void DitaXmlGenerator::generateLink(const Atom* atom,
bool func = atom->string().endsWith("()");
bool tt = (func || atom->string().contains(camelCase));
if (tt)
- xmlWriter().writeStartElement("tt");
+ writeStartTag(DT_tt);
if (func)
writeCharacters(protectEnc(atom->string().left(atom->string().length() - 2)));
else
writeCharacters(protectEnc(atom->string()));
- xmlWriter().writeEndElement(); // </tt>
+ writeEndTag(); // </tt>
}
else
writeCharacters(protectEnc(atom->string()));
@@ -3727,12 +3718,12 @@ void DitaXmlGenerator::generateFullName(const Node* apparentNode,
{
if (actualNode == 0)
actualNode = apparentNode;
- xmlWriter().writeStartElement("xref");
+ writeStartTag(DT_xref);
// formathtml
QString href = linkForNode(actualNode, relative);
xmlWriter().writeAttribute("href",href);
writeCharacters(protectEnc(fullName(apparentNode, relative, marker)));
- xmlWriter().writeEndElement(); // </xref>
+ writeEndTag(); // </xref>
}
void DitaXmlGenerator::findAllClasses(const InnerNode* node)
@@ -4156,7 +4147,7 @@ void DitaXmlGenerator::beginLink(const QString& link)
this->link = link;
if (link.isEmpty())
return;
- xmlWriter().writeStartElement("xref");
+ writeStartTag(DT_xref);
// formathtml
xmlWriter().writeAttribute("href",link);
inLink = true;
@@ -4167,15 +4158,15 @@ void DitaXmlGenerator::endLink()
if (inLink) {
if (link.isEmpty()) {
if (showBrokenLinks)
- xmlWriter().writeEndElement(); // </i>
+ writeEndTag(); // </i>
}
else {
if (inObsoleteLink) {
- xmlWriter().writeStartElement("sup");
+ writeStartTag(DT_sup);
xmlWriter().writeCharacters("(obsolete)");
- xmlWriter().writeEndElement(); // </sup>
+ writeEndTag(); // </sup>
}
- xmlWriter().writeEndElement(); // </xref>
+ writeEndTag(); // </xref>
}
}
inLink = false;
@@ -4193,16 +4184,16 @@ void DitaXmlGenerator::generateQmlSummary(const Section& section,
CodeMarker* marker)
{
if (!section.members.isEmpty()) {
- xmlWriter().writeStartElement("ul");
+ writeStartTag(DT_ul);
NodeList::ConstIterator m;
m = section.members.begin();
while (m != section.members.end()) {
- xmlWriter().writeStartElement("li");
+ writeStartTag(DT_li);
generateQmlItem(*m,relative,marker,true);
- xmlWriter().writeEndElement(); // </li>
+ writeEndTag(); // </li>
++m;
}
- xmlWriter().writeEndElement(); // </ul>
+ writeEndTag(); // </ul>
}
}
@@ -4220,11 +4211,11 @@ void DitaXmlGenerator::generateDetailedQmlMember(const Node* node,
if (node->subType() == Node::QmlPropertyGroup) {
const QmlPropGroupNode* qpgn = static_cast<const QmlPropGroupNode*>(node);
NodeList::ConstIterator p = qpgn->childNodes().begin();
- xmlWriter().writeStartElement("ul");
+ writeStartTag(DT_ul);
while (p != qpgn->childNodes().end()) {
if ((*p)->type() == Node::QmlProperty) {
qpn = static_cast<const QmlPropertyNode*>(*p);
- xmlWriter().writeStartElement("li");
+ writeStartTag(DT_li);
writeGuidAttribute((Node*)qpn);
QString attr;
if (!qpn->isWritable(myTree))
@@ -4237,31 +4228,31 @@ void DitaXmlGenerator::generateDetailedQmlMember(const Node* node,
if (!attr.isEmpty())
xmlWriter().writeAttribute("outputclass",attr);
generateQmlItem(qpn, relative, marker, false);
- xmlWriter().writeEndElement(); // </li>
+ writeEndTag(); // </li>
}
++p;
}
- xmlWriter().writeEndElement(); // </ul>
+ writeEndTag(); // </ul>
}
else if (node->type() == Node::QmlSignal) {
Node* n = const_cast<Node*>(node);
- xmlWriter().writeStartElement("ul");
- xmlWriter().writeStartElement("li");
+ writeStartTag(DT_ul);
+ writeStartTag(DT_li);
writeGuidAttribute(n);
marked = getMarkedUpSynopsis(n, relative, marker, CodeMarker::Detailed);
writeText(marked, marker, relative);
- xmlWriter().writeEndElement(); // </li>
- xmlWriter().writeEndElement(); // </ul>
+ writeEndTag(); // </li>
+ writeEndTag(); // </ul>
}
else if (node->type() == Node::QmlMethod) {
Node* n = const_cast<Node*>(node);
- xmlWriter().writeStartElement("ul");
- xmlWriter().writeStartElement("li");
+ writeStartTag(DT_ul);
+ writeStartTag(DT_li);
writeGuidAttribute(n);
marked = getMarkedUpSynopsis(n, relative, marker, CodeMarker::Detailed);
writeText(marked, marker, relative);
- xmlWriter().writeEndElement(); // </li>
- xmlWriter().writeEndElement(); // </ul>
+ writeEndTag(); // </li>
+ writeEndTag(); // </ul>
}
generateStatus(node, marker);
generateBody(node, marker);
@@ -4285,7 +4276,7 @@ void DitaXmlGenerator::generateQmlInherits(const QmlClassNode* cn,
const Node* n = myTree->findNode(strList,Node::Fake);
if (n && n->subType() == Node::QmlClass) {
const QmlClassNode* qcn = static_cast<const QmlClassNode*>(n);
- xmlWriter().writeStartElement("p");
+ writeStartTag(DT_p);
xmlWriter().writeAttribute("outputclass","inherits");
Text text;
text << "[Inherits ";
@@ -4295,7 +4286,7 @@ void DitaXmlGenerator::generateQmlInherits(const QmlClassNode* cn,
text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
text << "]";
generateText(text, cn, marker);
- xmlWriter().writeEndElement(); // </p>
+ writeEndTag(); // </p>
}
}
}
@@ -4333,7 +4324,7 @@ void DitaXmlGenerator::generateQmlInstantiates(const QmlClassNode* qcn,
{
const ClassNode* cn = qcn->classNode();
if (cn && (cn->status() != Node::Internal)) {
- xmlWriter().writeStartElement("p");
+ writeStartTag(DT_p);
xmlWriter().writeAttribute("outputclass","instantiates");
Text text;
text << "[";
@@ -4348,7 +4339,7 @@ void DitaXmlGenerator::generateQmlInstantiates(const QmlClassNode* qcn,
text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
text << "]";
generateText(text, qcn, marker);
- xmlWriter().writeEndElement(); // </p>
+ writeEndTag(); // </p>
}
}
@@ -4365,7 +4356,7 @@ void DitaXmlGenerator::generateInstantiatedBy(const ClassNode* cn,
if (cn && cn->status() != Node::Internal && !cn->qmlElement().isEmpty()) {
const Node* n = myTree->root()->findNode(cn->qmlElement(),Node::Fake);
if (n && n->subType() == Node::QmlClass) {
- xmlWriter().writeStartElement("p");
+ writeStartTag(DT_p);
xmlWriter().writeAttribute("outputclass","instantiated-by");
Text text;
text << "[";
@@ -4380,7 +4371,7 @@ void DitaXmlGenerator::generateInstantiatedBy(const ClassNode* cn,
text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
text << "]";
generateText(text, cn, marker);
- xmlWriter().writeEndElement(); // </p>
+ writeEndTag(); // </p>
}
}
}
@@ -4436,32 +4427,32 @@ void DitaXmlGenerator::writeDerivations(const ClassNode* cn, CodeMarker* marker)
int index;
if (!cn->baseClasses().isEmpty()) {
- xmlWriter().writeStartElement(CXXCLASSDERIVATIONS);
+ writeStartTag(DT_cxxClassDerivations);
r = cn->baseClasses().begin();
index = 0;
while (r != cn->baseClasses().end()) {
- xmlWriter().writeStartElement(CXXCLASSDERIVATION);
- xmlWriter().writeStartElement(CXXCLASSDERIVATIONACCESSSPECIFIER);
+ writeStartTag(DT_cxxClassDerivation);
+ writeStartTag(DT_cxxClassDerivationAccessSpecifier);
xmlWriter().writeAttribute("value",(*r).accessString());
- xmlWriter().writeEndElement(); // </cxxClassDerivationAccessSpecifier>
+ writeEndTag(); // </cxxClassDerivationAccessSpecifier>
// not included: <cxxClassDerivationVirtual>
- xmlWriter().writeStartElement(CXXCLASSBASECLASS);
+ writeStartTag(DT_cxxClassBaseClass);
QString attr = fileName((*r).node) + "#" + (*r).node->guid();
xmlWriter().writeAttribute("href",attr);
writeCharacters(marker->plainFullName((*r).node));
- xmlWriter().writeEndElement(); // </cxxClassBaseClass>
+ writeEndTag(); // </cxxClassBaseClass>
// not included: <ClassBaseStruct> or <cxxClassBaseUnion>
- xmlWriter().writeEndElement(); // </cxxClassDerivation>
+ writeEndTag(); // </cxxClassDerivation>
// not included: <cxxStructDerivation>
++r;
}
- xmlWriter().writeEndElement(); // </cxxClassDerivations>
+ writeEndTag(); // </cxxClassDerivations>
}
}
@@ -4472,73 +4463,77 @@ void DitaXmlGenerator::writeDerivations(const ClassNode* cn, CodeMarker* marker)
*/
void DitaXmlGenerator::writeLocation(const Node* n)
{
- QString s1, s2, s3, s4, s5, s6;
+ DitaTag s1, s2, s3, s4, s5, s6;
+ s1 = DT_cxxClassAPIItemLocation;
+ s2 = DT_cxxClassDeclarationFile;
+ s3 = DT_cxxClassDeclarationFileLine;
+ s4 = DT_LAST;
if (n->type() == Node::Class || n->type() == Node::Namespace) {
- s1 = CXXCLASSAPIITEMLOCATION;
- s2 = CXXCLASSDECLARATIONFILE;
- s3 = CXXCLASSDECLARATIONFILELINE;
+ s1 = DT_cxxClassAPIItemLocation;
+ s2 = DT_cxxClassDeclarationFile;
+ s3 = DT_cxxClassDeclarationFileLine;
}
else if (n->type() == Node::Function) {
FunctionNode* fn = const_cast<FunctionNode*>(static_cast<const FunctionNode*>(n));
if (fn->isMacro()) {
- s1 = CXXDEFINEAPIITEMLOCATION;
- s2 = CXXDEFINEDECLARATIONFILE;
- s3 = CXXDEFINEDECLARATIONFILELINE;
+ s1 = DT_cxxDefineAPIItemLocation;
+ s2 = DT_cxxDefineDeclarationFile;
+ s3 = DT_cxxDefineDeclarationFileLine;
}
else {
- s1 = CXXFUNCTIONAPIITEMLOCATION;
- s2 = CXXFUNCTIONDECLARATIONFILE;
- s3 = CXXFUNCTIONDECLARATIONFILELINE;
+ s1 = DT_cxxFunctionAPIItemLocation;
+ s2 = DT_cxxFunctionDeclarationFile;
+ s3 = DT_cxxFunctionDeclarationFileLine;
}
}
else if (n->type() == Node::Enum) {
- s1 = CXXENUMERATIONAPIITEMLOCATION;
- s2 = CXXENUMERATIONDECLARATIONFILE;
- s3 = CXXENUMERATIONDECLARATIONFILELINE;
- s4 = CXXENUMERATIONDEFINITIONFILE;
- s5 = CXXENUMERATIONDEFINITIONFILELINESTART;
- s6 = CXXENUMERATIONDEFINITIONFILELINEEND;
+ s1 = DT_cxxEnumerationAPIItemLocation;
+ s2 = DT_cxxEnumerationDeclarationFile;
+ s3 = DT_cxxEnumerationDeclarationFileLine;
+ s4 = DT_cxxEnumerationDefinitionFile;
+ s5 = DT_cxxEnumerationDefinitionFileLineStart;
+ s6 = DT_cxxEnumerationDefinitionFileLineEnd;
}
else if (n->type() == Node::Typedef) {
- s1 = CXXTYPEDEFAPIITEMLOCATION;
- s2 = CXXTYPEDEFDECLARATIONFILE;
- s3 = CXXTYPEDEFDECLARATIONFILELINE;
+ s1 = DT_cxxTypedefAPIItemLocation;
+ s2 = DT_cxxTypedefDeclarationFile;
+ s3 = DT_cxxTypedefDeclarationFileLine;
}
else if ((n->type() == Node::Property) ||
(n->type() == Node::Variable)) {
- s1 = CXXVARIABLEAPIITEMLOCATION;
- s2 = CXXVARIABLEDECLARATIONFILE;
- s3 = CXXVARIABLEDECLARATIONFILELINE;
+ s1 = DT_cxxVariableAPIItemLocation;
+ s2 = DT_cxxVariableDeclarationFile;
+ s3 = DT_cxxVariableDeclarationFileLine;
}
- xmlWriter().writeStartElement(s1);
- xmlWriter().writeStartElement(s2);
+ writeStartTag(s1);
+ writeStartTag(s2);
xmlWriter().writeAttribute("name","filePath");
xmlWriter().writeAttribute("value",n->location().filePath());
- xmlWriter().writeEndElement(); // </cxx<s2>DeclarationFile>
- xmlWriter().writeStartElement(s3);
+ writeEndTag(); // </cxx<s2>DeclarationFile>
+ writeStartTag(s3);
xmlWriter().writeAttribute("name","lineNumber");
QString lineNr;
xmlWriter().writeAttribute("value",lineNr.setNum(n->location().lineNo()));
- xmlWriter().writeEndElement(); // </cxx<s3>DeclarationFileLine>
- if (!s4.isEmpty()) { // zzz This stuff is temporary, I think.
- xmlWriter().writeStartElement(s4);
+ writeEndTag(); // </cxx<s3>DeclarationFileLine>
+ if (s4 != DT_LAST) { // zzz This stuff is temporary, I think.
+ writeStartTag(s4);
xmlWriter().writeAttribute("name","filePath");
xmlWriter().writeAttribute("value",n->location().filePath());
- xmlWriter().writeEndElement(); // </cxx<s4>DefinitionFile>
- xmlWriter().writeStartElement(s5);
+ writeEndTag(); // </cxx<s4>DefinitionFile>
+ writeStartTag(s5);
xmlWriter().writeAttribute("name","lineNumber");
xmlWriter().writeAttribute("value",lineNr.setNum(n->location().lineNo()));
- xmlWriter().writeEndElement(); // </cxx<s5>DefinitionFileLineStart>
- xmlWriter().writeStartElement(s6);
+ writeEndTag(); // </cxx<s5>DefinitionFileLineStart>
+ writeStartTag(s6);
xmlWriter().writeAttribute("name","lineNumber");
xmlWriter().writeAttribute("value",lineNr.setNum(n->location().lineNo()));
- xmlWriter().writeEndElement(); // </cxx<s6>DefinitionFileLineEnd>
+ writeEndTag(); // </cxx<s6>DefinitionFileLineEnd>
}
// not included: <cxxXXXDefinitionFile>, <cxxXXXDefinitionFileLineStart>,
// and <cxxXXXDefinitionFileLineEnd>
- xmlWriter().writeEndElement(); // </cxx<s1>ApiItemLocation>
+ writeEndTag(); // </cxx<s1>ApiItemLocation>
}
/*!
@@ -4553,90 +4548,90 @@ void DitaXmlGenerator::writeFunctions(const Section& s,
while (m != s.members.end()) {
if ((*m)->type() == Node::Function) {
FunctionNode* fn = const_cast<FunctionNode*>(static_cast<const FunctionNode*>(*m));
- xmlWriter().writeStartElement(CXXFUNCTION);
+ writeStartTag(DT_cxxFunction);
xmlWriter().writeAttribute("id",fn->guid());
if (!attribute.isEmpty())
xmlWriter().writeAttribute("outputclass",attribute);
- xmlWriter().writeStartElement("apiName");
+ writeStartTag(DT_apiName);
if (fn->metaness() == FunctionNode::Signal)
xmlWriter().writeAttribute("class","signal");
else if (fn->metaness() == FunctionNode::Slot)
xmlWriter().writeAttribute("class","slot");
writeCharacters(fn->name());
- xmlWriter().writeEndElement(); // </apiName>
+ writeEndTag(); // </apiName>
generateBrief(fn,marker);
// not included: <prolog>
- xmlWriter().writeStartElement(CXXFUNCTIONDETAIL);
- xmlWriter().writeStartElement(CXXFUNCTIONDEFINITION);
- xmlWriter().writeStartElement(CXXFUNCTIONACCESSSPECIFIER);
+ writeStartTag(DT_cxxFunctionDetail);
+ writeStartTag(DT_cxxFunctionDefinition);
+ writeStartTag(DT_cxxFunctionAccessSpecifier);
xmlWriter().writeAttribute("value",fn->accessString());
- xmlWriter().writeEndElement(); // <cxxFunctionAccessSpecifier>
+ writeEndTag(); // <cxxFunctionAccessSpecifier>
// not included: <cxxFunctionStorageClassSpecifierExtern>
if (fn->isStatic()) {
- xmlWriter().writeStartElement(CXXFUNCTIONSTORAGECLASSSPECIFIERSTATIC);
+ writeStartTag(DT_cxxFunctionStorageClassSpecifierStatic);
xmlWriter().writeAttribute("name","static");
xmlWriter().writeAttribute("value","static");
- xmlWriter().writeEndElement(); // <cxxFunctionStorageClassSpecifierStatic>
+ writeEndTag(); // <cxxFunctionStorageClassSpecifierStatic>
}
// not included: <cxxFunctionStorageClassSpecifierMutable>,
if (fn->isConst()) {
- xmlWriter().writeStartElement(CXXFUNCTIONCONST);
+ writeStartTag(DT_cxxFunctionConst);
xmlWriter().writeAttribute("name","const");
xmlWriter().writeAttribute("value","const");
- xmlWriter().writeEndElement(); // <cxxFunctionConst>
+ writeEndTag(); // <cxxFunctionConst>
}
// not included: <cxxFunctionExplicit>
// <cxxFunctionInline
if (fn->virtualness() != FunctionNode::NonVirtual) {
- xmlWriter().writeStartElement(CXXFUNCTIONVIRTUAL);
+ writeStartTag(DT_cxxFunctionVirtual);
xmlWriter().writeAttribute("name","virtual");
xmlWriter().writeAttribute("value","virtual");
- xmlWriter().writeEndElement(); // <cxxFunctionVirtual>
+ writeEndTag(); // <cxxFunctionVirtual>
if (fn->virtualness() == FunctionNode::PureVirtual) {
- xmlWriter().writeStartElement(CXXFUNCTIONPUREVIRTUAL);
+ writeStartTag(DT_cxxFunctionPureVirtual);
xmlWriter().writeAttribute("name","pure virtual");
xmlWriter().writeAttribute("value","pure virtual");
- xmlWriter().writeEndElement(); // <cxxFunctionPureVirtual>
+ writeEndTag(); // <cxxFunctionPureVirtual>
}
}
if (fn->name() == n->name()) {
- xmlWriter().writeStartElement(CXXFUNCTIONCONSTRUCTOR);
+ writeStartTag(DT_cxxFunctionConstructor);
xmlWriter().writeAttribute("name","constructor");
xmlWriter().writeAttribute("value","constructor");
- xmlWriter().writeEndElement(); // <cxxFunctionConstructor>
+ writeEndTag(); // <cxxFunctionConstructor>
}
else if (fn->name()[0] == QChar('~')) {
- xmlWriter().writeStartElement(CXXFUNCTIONDESTRUCTOR);
+ writeStartTag(DT_cxxFunctionDestructor);
xmlWriter().writeAttribute("name","destructor");
xmlWriter().writeAttribute("value","destructor");
- xmlWriter().writeEndElement(); // <cxxFunctionDestructor>
+ writeEndTag(); // <cxxFunctionDestructor>
}
else {
- xmlWriter().writeStartElement(CXXFUNCTIONDECLAREDTYPE);
+ writeStartTag(DT_cxxFunctionDeclaredType);
writeCharacters(fn->returnType());
- xmlWriter().writeEndElement(); // <cxxFunctionDeclaredType>
+ writeEndTag(); // <cxxFunctionDeclaredType>
}
// not included: <cxxFunctionReturnType>
QString fq = fullQualification(fn);
if (!fq.isEmpty()) {
- xmlWriter().writeStartElement(CXXFUNCTIONSCOPEDNAME);
+ writeStartTag(DT_cxxFunctionScopedName);
writeCharacters(fq);
- xmlWriter().writeEndElement(); // <cxxFunctionScopedName>
+ writeEndTag(); // <cxxFunctionScopedName>
}
- xmlWriter().writeStartElement(CXXFUNCTIONPROTOTYPE);
+ writeStartTag(DT_cxxFunctionPrototype);
writeCharacters(fn->signature(true));
- xmlWriter().writeEndElement(); // <cxxFunctionPrototype>
+ writeEndTag(); // <cxxFunctionPrototype>
QString fnl = fn->signature(false);
int idx = fnl.indexOf(' ');
@@ -4645,30 +4640,30 @@ void DitaXmlGenerator::writeFunctions(const Section& s,
else
++idx;
fnl = fn->parent()->name() + "::" + fnl.mid(idx);
- xmlWriter().writeStartElement(CXXFUNCTIONNAMELOOKUP);
+ writeStartTag(DT_cxxFunctionNameLookup);
writeCharacters(fnl);
- xmlWriter().writeEndElement(); // <cxxFunctionNameLookup>
+ writeEndTag(); // <cxxFunctionNameLookup>
if (!fn->isInternal() && fn->isReimp() && fn->reimplementedFrom() != 0) {
FunctionNode* rfn = (FunctionNode*)fn->reimplementedFrom();
if (rfn && !rfn->isInternal()) {
- xmlWriter().writeStartElement(CXXFUNCTIONREIMPLEMENTED);
+ writeStartTag(DT_cxxFunctionReimplemented);
xmlWriter().writeAttribute("href",rfn->ditaXmlHref());
writeCharacters(marker->plainFullName(rfn));
- xmlWriter().writeEndElement(); // </cxxFunctionReimplemented>
+ writeEndTag(); // </cxxFunctionReimplemented>
}
}
writeParameters(fn);
writeLocation(fn);
- xmlWriter().writeEndElement(); // <cxxFunctionDefinition>
+ writeEndTag(); // <cxxFunctionDefinition>
writeDetailedDescription(fn, marker, true, QString());
// generateAlsoList(inner, marker);
// not included: <example> or <apiImpl>
- xmlWriter().writeEndElement(); // </cxxFunctionDetail>
- xmlWriter().writeEndElement(); // </cxxFunction>
+ writeEndTag(); // </cxxFunctionDetail>
+ writeEndTag(); // </cxxFunction>
if (fn->metaness() == FunctionNode::Ctor ||
fn->metaness() == FunctionNode::Dtor ||
@@ -4686,33 +4681,33 @@ void DitaXmlGenerator::writeParameters(const FunctionNode* fn)
{
const QList<Parameter>& parameters = fn->parameters();
if (!parameters.isEmpty()) {
- xmlWriter().writeStartElement(CXXFUNCTIONPARAMETERS);
+ writeStartTag(DT_cxxFunctionParameters);
QList<Parameter>::ConstIterator p = parameters.begin();
while (p != parameters.end()) {
- xmlWriter().writeStartElement(CXXFUNCTIONPARAMETER);
- xmlWriter().writeStartElement(CXXFUNCTIONPARAMETERDECLAREDTYPE);
+ writeStartTag(DT_cxxFunctionParameter);
+ writeStartTag(DT_cxxFunctionParameterDeclaredType);
writeCharacters((*p).leftType());
if (!(*p).rightType().isEmpty())
writeCharacters((*p).rightType());
- xmlWriter().writeEndElement(); // <cxxFunctionParameterDeclaredType>
- xmlWriter().writeStartElement(CXXFUNCTIONPARAMETERDECLARATIONNAME);
+ writeEndTag(); // <cxxFunctionParameterDeclaredType>
+ writeStartTag(DT_cxxFunctionParameterDeclarationName);
writeCharacters((*p).name());
- xmlWriter().writeEndElement(); // <cxxFunctionParameterDeclarationName>
+ writeEndTag(); // <cxxFunctionParameterDeclarationName>
// not included: <cxxFunctionParameterDefinitionName>
if (!(*p).defaultValue().isEmpty()) {
- xmlWriter().writeStartElement(CXXFUNCTIONPARAMETERDEFAULTVALUE);
+ writeStartTag(DT_cxxFunctionParameterDefaultValue);
writeCharacters((*p).defaultValue());
- xmlWriter().writeEndElement(); // <cxxFunctionParameterDefaultValue>
+ writeEndTag(); // <cxxFunctionParameterDefaultValue>
}
// not included: <apiDefNote>
- xmlWriter().writeEndElement(); // <cxxFunctionParameter>
+ writeEndTag(); // <cxxFunctionParameter>
++p;
}
- xmlWriter().writeEndElement(); // <cxxFunctionParameters>
+ writeEndTag(); // <cxxFunctionParameters>
}
}
@@ -4727,32 +4722,32 @@ void DitaXmlGenerator::writeEnumerations(const Section& s,
while (m != s.members.end()) {
if ((*m)->type() == Node::Enum) {
const EnumNode* en = static_cast<const EnumNode*>(*m);
- xmlWriter().writeStartElement(CXXENUMERATION);
+ writeStartTag(DT_cxxEnumeration);
xmlWriter().writeAttribute("id",en->guid());
if (!attribute.isEmpty())
xmlWriter().writeAttribute("outputclass",attribute);
- xmlWriter().writeStartElement("apiName");
+ writeStartTag(DT_apiName);
writeCharacters(en->name());
- xmlWriter().writeEndElement(); // </apiName>
+ writeEndTag(); // </apiName>
generateBrief(en,marker);
// not included <prolog>
- xmlWriter().writeStartElement(CXXENUMERATIONDETAIL);
- xmlWriter().writeStartElement(CXXENUMERATIONDEFINITION);
- xmlWriter().writeStartElement(CXXENUMERATIONACCESSSPECIFIER);
+ writeStartTag(DT_cxxEnumerationDetail);
+ writeStartTag(DT_cxxEnumerationDefinition);
+ writeStartTag(DT_cxxEnumerationAccessSpecifier);
xmlWriter().writeAttribute("value",en->accessString());
- xmlWriter().writeEndElement(); // <cxxEnumerationAccessSpecifier>
+ writeEndTag(); // <cxxEnumerationAccessSpecifier>
QString fq = fullQualification(en);
if (!fq.isEmpty()) {
- xmlWriter().writeStartElement(CXXENUMERATIONSCOPEDNAME);
+ writeStartTag(DT_cxxEnumerationScopedName);
writeCharacters(fq);
- xmlWriter().writeEndElement(); // <cxxEnumerationScopedName>
+ writeEndTag(); // <cxxEnumerationScopedName>
}
const QList<EnumItem>& items = en->items();
if (!items.isEmpty()) {
- xmlWriter().writeStartElement(CXXENUMERATIONPROTOTYPE);
+ writeStartTag(DT_cxxEnumerationPrototype);
writeCharacters(en->name());
xmlWriter().writeCharacters(" = { ");
QList<EnumItem>::ConstIterator i = items.begin();
@@ -4767,68 +4762,68 @@ void DitaXmlGenerator::writeEnumerations(const Section& s,
xmlWriter().writeCharacters(", ");
}
xmlWriter().writeCharacters(" }");
- xmlWriter().writeEndElement(); // <cxxEnumerationPrototype>
+ writeEndTag(); // <cxxEnumerationPrototype>
}
- xmlWriter().writeStartElement(CXXENUMERATIONNAMELOOKUP);
+ writeStartTag(DT_cxxEnumerationNameLookup);
writeCharacters(en->parent()->name() + "::" + en->name());
- xmlWriter().writeEndElement(); // <cxxEnumerationNameLookup>
+ writeEndTag(); // <cxxEnumerationNameLookup>
// not included: <cxxEnumerationReimplemented>
if (!items.isEmpty()) {
- xmlWriter().writeStartElement(CXXENUMERATORS);
+ writeStartTag(DT_cxxEnumerators);
QList<EnumItem>::ConstIterator i = items.begin();
while (i != items.end()) {
- xmlWriter().writeStartElement(CXXENUMERATOR);
- xmlWriter().writeStartElement("apiName");
+ writeStartTag(DT_cxxEnumerator);
+ writeStartTag(DT_apiName);
writeCharacters((*i).name());
- xmlWriter().writeEndElement(); // </apiName>
+ writeEndTag(); // </apiName>
QString fq = fullQualification(en->parent());
if (!fq.isEmpty()) {
- xmlWriter().writeStartElement(CXXENUMERATORSCOPEDNAME);
+ writeStartTag(DT_cxxEnumeratorScopedName);
writeCharacters(fq + "::" + (*i).name());
- xmlWriter().writeEndElement(); // <cxxEnumeratorScopedName>
+ writeEndTag(); // <cxxEnumeratorScopedName>
}
- xmlWriter().writeStartElement(CXXENUMERATORPROTOTYPE);
+ writeStartTag(DT_cxxEnumeratorPrototype);
writeCharacters((*i).name());
- xmlWriter().writeEndElement(); // <cxxEnumeratorPrototype>
- xmlWriter().writeStartElement(CXXENUMERATORNAMELOOKUP);
+ writeEndTag(); // <cxxEnumeratorPrototype>
+ writeStartTag(DT_cxxEnumeratorNameLookup);
writeCharacters(en->parent()->name() + "::" + (*i).name());
- xmlWriter().writeEndElement(); // <cxxEnumeratorNameLookup>
+ writeEndTag(); // <cxxEnumeratorNameLookup>
if (!(*i).value().isEmpty()) {
- xmlWriter().writeStartElement(CXXENUMERATORINITIALISER);
+ writeStartTag(DT_cxxEnumeratorInitialiser);
xmlWriter().writeAttribute("value", (*i).value());
- xmlWriter().writeEndElement(); // <cxxEnumeratorInitialiser>
+ writeEndTag(); // <cxxEnumeratorInitialiser>
}
// not included: <cxxEnumeratorAPIItemLocation>
if (!(*i).text().isEmpty()) {
- xmlWriter().writeStartElement("apiDesc");
+ writeStartTag(DT_apiDesc);
generateText((*i).text(), en, marker);
- xmlWriter().writeEndElement(); // </apiDesc>
+ writeEndTag(); // </apiDesc>
}
- xmlWriter().writeEndElement(); // <cxxEnumerator>
+ writeEndTag(); // <cxxEnumerator>
++i;
}
- xmlWriter().writeEndElement(); // <cxxEnumerators>
+ writeEndTag(); // <cxxEnumerators>
}
writeLocation(en);
- xmlWriter().writeEndElement(); // <cxxEnumerationDefinition>
+ writeEndTag(); // <cxxEnumerationDefinition>
writeDetailedDescription(en, marker, true, QString());
// not included: <example> or <apiImpl>
- xmlWriter().writeEndElement(); // </cxxEnumerationDetail>
+ writeEndTag(); // </cxxEnumerationDetail>
// not included: <related-links>
- xmlWriter().writeEndElement(); // </cxxEnumeration>
+ writeEndTag(); // </cxxEnumeration>
}
++m;
}
@@ -4846,52 +4841,52 @@ void DitaXmlGenerator::writeTypedefs(const Section& s,
while (m != s.members.end()) {
if ((*m)->type() == Node::Typedef) {
const TypedefNode* tn = static_cast<const TypedefNode*>(*m);
- xmlWriter().writeStartElement(CXXTYPEDEF);
+ writeStartTag(DT_cxxTypedef);
xmlWriter().writeAttribute("id",tn->guid());
if (!attribute.isEmpty())
xmlWriter().writeAttribute("outputclass",attribute);
- xmlWriter().writeStartElement("apiName");
+ writeStartTag(DT_apiName);
writeCharacters(tn->name());
- xmlWriter().writeEndElement(); // </apiName>
+ writeEndTag(); // </apiName>
generateBrief(tn,marker);
// not included: <prolog>
- xmlWriter().writeStartElement(CXXTYPEDEFDETAIL);
- xmlWriter().writeStartElement(CXXTYPEDEFDEFINITION);
- xmlWriter().writeStartElement(CXXTYPEDEFACCESSSPECIFIER);
+ writeStartTag(DT_cxxTypedefDetail);
+ writeStartTag(DT_cxxTypedefDefinition);
+ writeStartTag(DT_cxxTypedefAccessSpecifier);
xmlWriter().writeAttribute("value",tn->accessString());
- xmlWriter().writeEndElement(); // <cxxTypedefAccessSpecifier>
+ writeEndTag(); // <cxxTypedefAccessSpecifier>
// not included: <cxxTypedefDeclaredType>
QString fq = fullQualification(tn);
if (!fq.isEmpty()) {
- xmlWriter().writeStartElement(CXXTYPEDEFSCOPEDNAME);
+ writeStartTag(DT_cxxTypedefScopedName);
writeCharacters(fq);
- xmlWriter().writeEndElement(); // <cxxTypedefScopedName>
+ writeEndTag(); // <cxxTypedefScopedName>
}
// not included: <cxxTypedefPrototype>
- xmlWriter().writeStartElement(CXXTYPEDEFNAMELOOKUP);
+ writeStartTag(DT_cxxTypedefNameLookup);
writeCharacters(tn->parent()->name() + "::" + tn->name());
- xmlWriter().writeEndElement(); // <cxxTypedefNameLookup>
+ writeEndTag(); // <cxxTypedefNameLookup>
// not included: <cxxTypedefReimplemented>
writeLocation(tn);
- xmlWriter().writeEndElement(); // <cxxTypedefDefinition>
+ writeEndTag(); // <cxxTypedefDefinition>
writeDetailedDescription(tn, marker, true, QString());
// not included: <example> or <apiImpl>
- xmlWriter().writeEndElement(); // </cxxTypedefDetail>
+ writeEndTag(); // </cxxTypedefDetail>
// not included: <related-links>
- xmlWriter().writeEndElement(); // </cxxTypedef>
+ writeEndTag(); // </cxxTypedef>
}
++m;
}
@@ -4909,22 +4904,22 @@ void DitaXmlGenerator::writeProperties(const Section& s,
while (m != s.members.end()) {
if ((*m)->type() == Node::Property) {
const PropertyNode* pn = static_cast<const PropertyNode*>(*m);
- xmlWriter().writeStartElement(CXXVARIABLE);
+ writeStartTag(DT_cxxVariable);
xmlWriter().writeAttribute("id",pn->guid());
if (!attribute.isEmpty())
xmlWriter().writeAttribute("outputclass",attribute);
- xmlWriter().writeStartElement("apiName");
+ writeStartTag(DT_apiName);
writeCharacters(pn->name());
- xmlWriter().writeEndElement(); // </apiName>
+ writeEndTag(); // </apiName>
generateBrief(pn,marker);
// not included: <prolog>
- xmlWriter().writeStartElement(CXXVARIABLEDETAIL);
- xmlWriter().writeStartElement(CXXVARIABLEDEFINITION);
- xmlWriter().writeStartElement(CXXVARIABLEACCESSSPECIFIER);
+ writeStartTag(DT_cxxVariableDetail);
+ writeStartTag(DT_cxxVariableDefinition);
+ writeStartTag(DT_cxxVariableAccessSpecifier);
xmlWriter().writeAttribute("value",pn->accessString());
- xmlWriter().writeEndElement(); // <cxxVariableAccessSpecifier>
+ writeEndTag(); // <cxxVariableAccessSpecifier>
// not included: <cxxVariableStorageClassSpecifierExtern>,
// <cxxVariableStorageClassSpecifierStatic>,
@@ -4932,18 +4927,18 @@ void DitaXmlGenerator::writeProperties(const Section& s,
// <cxxVariableConst>, <cxxVariableVolatile>
if (!pn->qualifiedDataType().isEmpty()) {
- xmlWriter().writeStartElement(CXXVARIABLEDECLAREDTYPE);
+ writeStartTag(DT_cxxVariableDeclaredType);
writeCharacters(pn->qualifiedDataType());
- xmlWriter().writeEndElement(); // <cxxVariableDeclaredType>
+ writeEndTag(); // <cxxVariableDeclaredType>
}
QString fq = fullQualification(pn);
if (!fq.isEmpty()) {
- xmlWriter().writeStartElement(CXXVARIABLESCOPEDNAME);
+ writeStartTag(DT_cxxVariableScopedName);
writeCharacters(fq);
- xmlWriter().writeEndElement(); // <cxxVariableScopedName>
+ writeEndTag(); // <cxxVariableScopedName>
}
- xmlWriter().writeStartElement(CXXVARIABLEPROTOTYPE);
+ writeStartTag(DT_cxxVariablePrototype);
xmlWriter().writeCharacters("Q_PROPERTY(");
writeCharacters(pn->qualifiedDataType());
xmlWriter().writeCharacters(" ");
@@ -4979,32 +4974,32 @@ void DitaXmlGenerator::writeProperties(const Section& s,
if (pn->isFinal())
xmlWriter().writeCharacters(" FINAL");
xmlWriter().writeCharacters(")");
- xmlWriter().writeEndElement(); // <cxxVariablePrototype>
+ writeEndTag(); // <cxxVariablePrototype>
- xmlWriter().writeStartElement(CXXVARIABLENAMELOOKUP);
+ writeStartTag(DT_cxxVariableNameLookup);
writeCharacters(pn->parent()->name() + "::" + pn->name());
- xmlWriter().writeEndElement(); // <cxxVariableNameLookup>
+ writeEndTag(); // <cxxVariableNameLookup>
if (pn->overriddenFrom() != 0) {
PropertyNode* opn = (PropertyNode*)pn->overriddenFrom();
- xmlWriter().writeStartElement(CXXVARIABLEREIMPLEMENTED);
+ writeStartTag(DT_cxxVariableReimplemented);
xmlWriter().writeAttribute("href",opn->ditaXmlHref());
writeCharacters(marker->plainFullName(opn));
- xmlWriter().writeEndElement(); // </cxxVariableReimplemented>
+ writeEndTag(); // </cxxVariableReimplemented>
}
writeLocation(pn);
- xmlWriter().writeEndElement(); // <cxxVariableDefinition>
+ writeEndTag(); // <cxxVariableDefinition>
writeDetailedDescription(pn, marker, true, QString());
// not included: <example> or <apiImpl>
- xmlWriter().writeEndElement(); // </cxxVariableDetail>
+ writeEndTag(); // </cxxVariableDetail>
// not included: <related-links>
- xmlWriter().writeEndElement(); // </cxxVariable>
+ writeEndTag(); // </cxxVariable>
}
++m;
}
@@ -5021,74 +5016,74 @@ void DitaXmlGenerator::writeDataMembers(const Section& s,
while (m != s.members.end()) {
if ((*m)->type() == Node::Variable) {
const VariableNode* vn = static_cast<const VariableNode*>(*m);
- xmlWriter().writeStartElement(CXXVARIABLE);
+ writeStartTag(DT_cxxVariable);
xmlWriter().writeAttribute("id",vn->guid());
if (!attribute.isEmpty())
xmlWriter().writeAttribute("outputclass",attribute);
- xmlWriter().writeStartElement("apiName");
+ writeStartTag(DT_apiName);
writeCharacters(vn->name());
- xmlWriter().writeEndElement(); // </apiName>
+ writeEndTag(); // </apiName>
generateBrief(vn,marker);
// not included: <prolog>
- xmlWriter().writeStartElement(CXXVARIABLEDETAIL);
- xmlWriter().writeStartElement(CXXVARIABLEDEFINITION);
- xmlWriter().writeStartElement(CXXVARIABLEACCESSSPECIFIER);
+ writeStartTag(DT_cxxVariableDetail);
+ writeStartTag(DT_cxxVariableDefinition);
+ writeStartTag(DT_cxxVariableAccessSpecifier);
xmlWriter().writeAttribute("value",vn->accessString());
- xmlWriter().writeEndElement(); // <cxxVariableAccessSpecifier>
+ writeEndTag(); // <cxxVariableAccessSpecifier>
// not included: <cxxVAriableStorageClassSpecifierExtern>
if (vn->isStatic()) {
- xmlWriter().writeStartElement(CXXVARIABLESTORAGECLASSSPECIFIERSTATIC);
+ writeStartTag(DT_cxxVariableStorageClassSpecifierStatic);
xmlWriter().writeAttribute("name","static");
xmlWriter().writeAttribute("value","static");
- xmlWriter().writeEndElement(); // <cxxVariableStorageClassSpecifierStatic>
+ writeEndTag(); // <cxxVariableStorageClassSpecifierStatic>
}
// not included: <cxxVAriableStorageClassSpecifierMutable>,
// <cxxVariableConst>, <cxxVariableVolatile>
- xmlWriter().writeStartElement(CXXVARIABLEDECLAREDTYPE);
+ writeStartTag(DT_cxxVariableDeclaredType);
writeCharacters(vn->leftType());
if (!vn->rightType().isEmpty())
writeCharacters(vn->rightType());
- xmlWriter().writeEndElement(); // <cxxVariableDeclaredType>
+ writeEndTag(); // <cxxVariableDeclaredType>
QString fq = fullQualification(vn);
if (!fq.isEmpty()) {
- xmlWriter().writeStartElement(CXXVARIABLESCOPEDNAME);
+ writeStartTag(DT_cxxVariableScopedName);
writeCharacters(fq);
- xmlWriter().writeEndElement(); // <cxxVariableScopedName>
+ writeEndTag(); // <cxxVariableScopedName>
}
- xmlWriter().writeStartElement(CXXVARIABLEPROTOTYPE);
+ writeStartTag(DT_cxxVariablePrototype);
writeCharacters(vn->leftType() + " ");
//writeCharacters(vn->parent()->name() + "::" + vn->name());
writeCharacters(vn->name());
if (!vn->rightType().isEmpty())
writeCharacters(vn->rightType());
- xmlWriter().writeEndElement(); // <cxxVariablePrototype>
+ writeEndTag(); // <cxxVariablePrototype>
- xmlWriter().writeStartElement(CXXVARIABLENAMELOOKUP);
+ writeStartTag(DT_cxxVariableNameLookup);
writeCharacters(vn->parent()->name() + "::" + vn->name());
- xmlWriter().writeEndElement(); // <cxxVariableNameLookup>
+ writeEndTag(); // <cxxVariableNameLookup>
// not included: <cxxVariableReimplemented>
writeLocation(vn);
- xmlWriter().writeEndElement(); // <cxxVariableDefinition>
+ writeEndTag(); // <cxxVariableDefinition>
writeDetailedDescription(vn, marker, true, QString());
// not included: <example> or <apiImpl>
- xmlWriter().writeEndElement(); // </cxxVariableDetail>
+ writeEndTag(); // </cxxVariableDetail>
// not included: <related-links>
- xmlWriter().writeEndElement(); // </cxxVariable>
+ writeEndTag(); // </cxxVariable>
}
++m;
}
@@ -5106,24 +5101,24 @@ void DitaXmlGenerator::writeMacros(const Section& s,
if ((*m)->type() == Node::Function) {
const FunctionNode* fn = static_cast<const FunctionNode*>(*m);
if (fn->isMacro()) {
- xmlWriter().writeStartElement(CXXDEFINE);
+ writeStartTag(DT_cxxDefine);
xmlWriter().writeAttribute("id",fn->guid());
if (!attribute.isEmpty())
xmlWriter().writeAttribute("outputclass",attribute);
- xmlWriter().writeStartElement("apiName");
+ writeStartTag(DT_apiName);
writeCharacters(fn->name());
- xmlWriter().writeEndElement(); // </apiName>
+ writeEndTag(); // </apiName>
generateBrief(fn,marker);
// not included: <prolog>
- xmlWriter().writeStartElement(CXXDEFINEDETAIL);
- xmlWriter().writeStartElement(CXXDEFINEDEFINITION);
- xmlWriter().writeStartElement(CXXDEFINEACCESSSPECIFIER);
+ writeStartTag(DT_cxxDefineDetail);
+ writeStartTag(DT_cxxDefineDefinition);
+ writeStartTag(DT_cxxDefineAccessSpecifier);
xmlWriter().writeAttribute("value",fn->accessString());
- xmlWriter().writeEndElement(); // <cxxDefineAccessSpecifier>
+ writeEndTag(); // <cxxDefineAccessSpecifier>
- xmlWriter().writeStartElement(CXXDEFINEPROTOTYPE);
+ writeStartTag(DT_cxxDefinePrototype);
xmlWriter().writeCharacters("#define ");
writeCharacters(fn->name());
if (fn->metaness() == FunctionNode::MacroWithParams) {
@@ -5141,50 +5136,50 @@ void DitaXmlGenerator::writeMacros(const Section& s,
xmlWriter().writeCharacters(")");
}
}
- xmlWriter().writeEndElement(); // <cxxDefinePrototype>
+ writeEndTag(); // <cxxDefinePrototype>
- xmlWriter().writeStartElement(CXXDEFINENAMELOOKUP);
+ writeStartTag(DT_cxxDefineNameLookup);
writeCharacters(fn->name());
- xmlWriter().writeEndElement(); // <cxxDefineNameLookup>
+ writeEndTag(); // <cxxDefineNameLookup>
if (fn->reimplementedFrom() != 0) {
FunctionNode* rfn = (FunctionNode*)fn->reimplementedFrom();
- xmlWriter().writeStartElement(CXXDEFINEREIMPLEMENTED);
+ writeStartTag(DT_cxxDefineReimplemented);
xmlWriter().writeAttribute("href",rfn->ditaXmlHref());
writeCharacters(marker->plainFullName(rfn));
- xmlWriter().writeEndElement(); // </cxxDefineReimplemented>
+ writeEndTag(); // </cxxDefineReimplemented>
}
if (fn->metaness() == FunctionNode::MacroWithParams) {
QStringList params = fn->parameterNames();
if (!params.isEmpty()) {
- xmlWriter().writeStartElement(CXXDEFINEPARAMETERS);
+ writeStartTag(DT_cxxDefineParameters);
for (int i = 0; i < params.size(); ++i) {
- xmlWriter().writeStartElement(CXXDEFINEPARAMETER);
- xmlWriter().writeStartElement(CXXDEFINEPARAMETERDECLARATIONNAME);
+ writeStartTag(DT_cxxDefineParameter);
+ writeStartTag(DT_cxxDefineParameterDeclarationName);
writeCharacters(params[i]);
- xmlWriter().writeEndElement(); // <cxxDefineParameterDeclarationName>
+ writeEndTag(); // <cxxDefineParameterDeclarationName>
// not included: <apiDefNote>
- xmlWriter().writeEndElement(); // <cxxDefineParameter>
+ writeEndTag(); // <cxxDefineParameter>
}
- xmlWriter().writeEndElement(); // <cxxDefineParameters>
+ writeEndTag(); // <cxxDefineParameters>
}
}
writeLocation(fn);
- xmlWriter().writeEndElement(); // <cxxDefineDefinition>
+ writeEndTag(); // <cxxDefineDefinition>
writeDetailedDescription(fn, marker, true, QString());
// not included: <example> or <apiImpl>
- xmlWriter().writeEndElement(); // </cxxDefineDetail>
+ writeEndTag(); // </cxxDefineDetail>
// not included: <related-links>
- xmlWriter().writeEndElement(); // </cxxDefine>
+ writeEndTag(); // </cxxDefine>
}
}
++m;
@@ -5271,7 +5266,7 @@ void DitaXmlGenerator::writeDetailedDescription(const Node* node,
inDetailedDescription = true;
if (apiDesc) {
inApiDesc = true;
- xmlWriter().writeStartElement("apiDesc");
+ writeStartTag(DT_apiDesc);
if (!title.isEmpty()) {
writeGuidAttribute(title);
xmlWriter().writeAttribute("spectitle",title);
@@ -5282,14 +5277,14 @@ void DitaXmlGenerator::writeDetailedDescription(const Node* node,
}
else {
inSection = true;
- xmlWriter().writeStartElement("section");
+ writeStartTag(DT_section);
if (!title.isEmpty()) {
writeGuidAttribute(title);
xmlWriter().writeAttribute("outputclass","details");
- xmlWriter().writeStartElement("title");
+ writeStartTag(DT_title);
xmlWriter().writeAttribute("outputclass","h2");
writeCharacters(title);
- xmlWriter().writeEndElement(); // </title>
+ writeEndTag(); // </title>
}
else {
writeGuidAttribute("Detailed Description");
@@ -5298,11 +5293,11 @@ void DitaXmlGenerator::writeDetailedDescription(const Node* node,
}
generateBody(node, marker);
if (inApiDesc) {
- xmlWriter().writeEndElement(); // </apiDesc>
+ writeEndTag(); // </apiDesc>
inApiDesc = false;
}
else if (inSection) {
- xmlWriter().writeEndElement(); // </section>
+ writeEndTag(); // </section>
inSection = false;
}
}
@@ -5317,23 +5312,23 @@ void DitaXmlGenerator::writeNestedClasses(const Section& s,
{
if (s.members.isEmpty())
return;
- xmlWriter().writeStartElement("cxxClassNested");
- xmlWriter().writeStartElement("cxxClassNestedDetail");
+ writeStartTag(DT_cxxClassNested);
+ writeStartTag(DT_cxxClassNestedDetail);
NodeList::ConstIterator m = s.members.begin();
while (m != s.members.end()) {
if ((*m)->type() == Node::Class) {
- xmlWriter().writeStartElement("cxxClassNestedClass");
+ writeStartTag(DT_cxxClassNestedClass);
QString link = linkForNode((*m), n);
xmlWriter().writeAttribute("href", link);
QString name = n->name() + "::" + (*m)->name();
writeCharacters(name);
- xmlWriter().writeEndElement(); // <cxxClassNestedClass>
+ writeEndTag(); // <cxxClassNestedClass>
}
++m;
}
- xmlWriter().writeEndElement(); // <cxxClassNestedDetail>
- xmlWriter().writeEndElement(); // <cxxClassNested>
+ writeEndTag(); // <cxxClassNestedDetail>
+ writeEndTag(); // <cxxClassNested>
}
/*!
@@ -5404,20 +5399,20 @@ void DitaXmlGenerator::writeDitaMap()
doctype = "<!DOCTYPE cxxAPIMap PUBLIC \"-//NOKIA//DTD DITA C++ API Map Reference Type v0.6.0//EN\" \"dtd/cxxAPIMap.dtd\">";
xmlWriter().writeDTD(doctype);
- xmlWriter().writeStartElement("cxxAPIMap");
+ writeStartTag(DT_cxxAPIMap);
xmlWriter().writeAttribute("id","Qt-DITA-Map");
xmlWriter().writeAttribute("title","Qt DITA Map");
- xmlWriter().writeStartElement("topicmeta");
- xmlWriter().writeStartElement("shortdesc");
+ writeStartTag(DT_topicmeta);
+ writeStartTag(DT_shortdesc);
xmlWriter().writeCharacters("The top level map for the Qt documentation");
- xmlWriter().writeEndElement(); // </shortdesc>
- xmlWriter().writeEndElement(); // </topicmeta>
+ writeEndTag(); // </shortdesc>
+ writeEndTag(); // </topicmeta>
GuidMaps::iterator i = guidMaps.begin();
while (i != guidMaps.end()) {
- xmlWriter().writeStartElement("topicref");
+ writeStartTag(DT_topicref);
xmlWriter().writeAttribute("href",i.key());
xmlWriter().writeAttribute("type","topic");
- xmlWriter().writeEndElement(); // </topicref>
+ writeEndTag(); // </topicref>
++i;
}
endSubPage();
diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h
index 1a42e5f..599844f 100644
--- a/tools/qdoc3/ditaxmlgenerator.h
+++ b/tools/qdoc3/ditaxmlgenerator.h
@@ -81,6 +81,151 @@ class DitaXmlGenerator : public PageGenerator
LastSinceType
};
+ enum DitaTag {
+ DT_alt,
+ DT_apiDesc,
+ DT_APIMap,
+ DT_apiName,
+ DT_b,
+ DT_body,
+ DT_bodydiv,
+ DT_codeblock,
+ DT_comment,
+ DT_cxxAPIMap,
+ DT_cxxClass,
+ DT_cxxClassAbstract,
+ DT_cxxClassAccessSpecifier,
+ DT_cxxClassAPIItemLocation,
+ DT_cxxClassBaseClass,
+ DT_cxxClassDeclarationFile,
+ DT_cxxClassDeclarationFileLine,
+ DT_cxxClassDefinition,
+ DT_cxxClassDerivation,
+ DT_cxxClassDerivationAccessSpecifier,
+ DT_cxxClassDerivations,
+ DT_cxxClassDetail,
+ DT_cxxClassNested,
+ DT_cxxClassNestedClass,
+ DT_cxxClassNestedDetail,
+ DT_cxxDefine,
+ DT_cxxDefineAccessSpecifier,
+ DT_cxxDefineAPIItemLocation,
+ DT_cxxDefineDeclarationFile,
+ DT_cxxDefineDeclarationFileLine,
+ DT_cxxDefineDefinition,
+ DT_cxxDefineDetail,
+ DT_cxxDefineNameLookup,
+ DT_cxxDefineParameter,
+ DT_cxxDefineParameterDeclarationName,
+ DT_cxxDefineParameters,
+ DT_cxxDefinePrototype,
+ DT_cxxDefineReimplemented,
+ DT_cxxEnumeration,
+ DT_cxxEnumerationAccessSpecifier,
+ DT_cxxEnumerationAPIItemLocation,
+ DT_cxxEnumerationDeclarationFile,
+ DT_cxxEnumerationDeclarationFileLine,
+ DT_cxxEnumerationDefinition,
+ DT_cxxEnumerationDefinitionFile,
+ DT_cxxEnumerationDefinitionFileLineStart,
+ DT_cxxEnumerationDefinitionFileLineEnd,
+ DT_cxxEnumerationDetail,
+ DT_cxxEnumerationNameLookup,
+ DT_cxxEnumerationPrototype,
+ DT_cxxEnumerationScopedName,
+ DT_cxxEnumerator,
+ DT_cxxEnumeratorInitialiser,
+ DT_cxxEnumeratorNameLookup,
+ DT_cxxEnumeratorPrototype,
+ DT_cxxEnumerators,
+ DT_cxxEnumeratorScopedName,
+ DT_cxxFunction,
+ DT_cxxFunctionAccessSpecifier,
+ DT_cxxFunctionAPIItemLocation,
+ DT_cxxFunctionConst,
+ DT_cxxFunctionConstructor,
+ DT_cxxFunctionDeclarationFile,
+ DT_cxxFunctionDeclarationFileLine,
+ DT_cxxFunctionDeclaredType,
+ DT_cxxFunctionDefinition,
+ DT_cxxFunctionDestructor,
+ DT_cxxFunctionDetail,
+ DT_cxxFunctionNameLookup,
+ DT_cxxFunctionParameter,
+ DT_cxxFunctionParameterDeclarationName,
+ DT_cxxFunctionParameterDeclaredType,
+ DT_cxxFunctionParameterDefaultValue,
+ DT_cxxFunctionParameters,
+ DT_cxxFunctionPrototype,
+ DT_cxxFunctionPureVirtual,
+ DT_cxxFunctionReimplemented,
+ DT_cxxFunctionScopedName,
+ DT_cxxFunctionStorageClassSpecifierStatic,
+ DT_cxxFunctionVirtual,
+ DT_cxxTypedef,
+ DT_cxxTypedefAccessSpecifier,
+ DT_cxxTypedefAPIItemLocation,
+ DT_cxxTypedefDeclarationFile,
+ DT_cxxTypedefDeclarationFileLine,
+ DT_cxxTypedefDefinition,
+ DT_cxxTypedefDetail,
+ DT_cxxTypedefNameLookup,
+ DT_cxxTypedefScopedName,
+ DT_cxxVariable,
+ DT_cxxVariableAccessSpecifier,
+ DT_cxxVariableAPIItemLocation,
+ DT_cxxVariableDeclarationFile,
+ DT_cxxVariableDeclarationFileLine,
+ DT_cxxVariableDeclaredType,
+ DT_cxxVariableDefinition,
+ DT_cxxVariableDetail,
+ DT_cxxVariableNameLookup,
+ DT_cxxVariablePrototype,
+ DT_cxxVariableReimplemented,
+ DT_cxxVariableScopedName,
+ DT_cxxVariableStorageClassSpecifierStatic,
+ DT_dd,
+ DT_dl,
+ DT_dlentry,
+ DT_dt,
+ DT_entry,
+ DT_fig,
+ DT_i,
+ DT_image,
+ DT_li,
+ DT_link,
+ DT_linktext,
+ DT_lq,
+ DT_ol,
+ DT_p,
+ DT_parameter,
+ DT_pre,
+ DT_relatedLinks,
+ DT_row,
+ DT_section,
+ DT_sectiondiv,
+ DT_shortdesc,
+ DT_simpletable,
+ DT_stentry,
+ DT_sthead,
+ DT_strow,
+ DT_sub,
+ DT_sup,
+ DT_table,
+ DT_tbody,
+ DT_tgroup,
+ DT_thead,
+ DT_title,
+ DT_topic,
+ DT_topicmeta,
+ DT_topicref,
+ DT_tt,
+ DT_ul,
+ DT_u,
+ DT_xref,
+ DT_LAST
+ };
+
public:
DitaXmlGenerator();
~DitaXmlGenerator();
@@ -260,6 +405,9 @@ class DitaXmlGenerator : public PageGenerator
const QString& title);
void addLink(const QString& href, const QStringRef& text);
void writeDitaMap();
+ void writeStartTag(DitaTag t);
+ void writeEndTag();
+ DitaTag currentTag();
private:
QMap<QString, QString> refMap;
@@ -317,8 +465,9 @@ class DitaXmlGenerator : public PageGenerator
static bool inSection;
static bool inDetailedDescription;
static bool inLegaleseText;
-
+ static QString ditaTags[];
QStack<QXmlStreamWriter*> xmlWriterStack;
+ QStack<DitaTag> tagStack;
};
#define DITAXMLGENERATOR_ADDRESS "address"
diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp
index 65b9a09..26f8de1 100644
--- a/tools/qdoc3/generator.cpp
+++ b/tools/qdoc3/generator.cpp
@@ -262,6 +262,7 @@ void Generator::initialize(const Config &config)
}
else {
int paramPos = def.indexOf("\1");
+ qDebug() << "ZZZZZ:" << *n << def.left(paramPos) << def.mid(paramPos + 1);
fmtLeftMaps[*f].insert(*n, def.left(paramPos));
fmtRightMaps[*f].insert(*n, def.mid(paramPos + 1));
}