From 1d5e87b0451fd770395c1344af4b56cf790ca0e0 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 22 Jun 2010 10:10:44 +0200 Subject: doc: Added more DITA output to the XML generator The rest of the cxxEnumeration stuff for enum types. Task-number: QTBUG-11391 --- tools/qdoc3/ditaxmlgenerator.cpp | 44 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index e5481a0..e1e1b91 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1409,13 +1409,13 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark QString rawTitle; QString fullTitle; if (inner->type() == Node::Namespace) { - namespasse = static_cast(inner); + namespasse = const_cast(static_cast(inner)); rawTitle = marker->plainName(inner); fullTitle = marker->plainFullName(inner); title = rawTitle + " Namespace"; } else if (inner->type() == Node::Class) { - cn = static_cast(inner); + cn = const_cast(static_cast(inner)); rawTitle = marker->plainName(inner); fullTitle = marker->plainFullName(inner); title = rawTitle + " Class Reference"; @@ -4588,7 +4588,7 @@ void DitaXmlGenerator::writeFunctions(const Section& s, NodeList::ConstIterator m = s.members.begin(); while (m != s.members.end()) { if ((*m)->type() == Node::Function) { - FunctionNode* fn = static_cast(*m); + FunctionNode* fn = const_cast(static_cast(*m)); writer.writeStartElement(CXXFUNCTION); writer.writeAttribute("id",fn->guid()); writer.writeStartElement(APINAME); @@ -4778,6 +4778,44 @@ void DitaXmlGenerator::writeEnumerations(const Section& s, writer.writeCharacters(en->parent()->name() + "::" + en->name()); writer.writeEndElement(); // + if (!items.isEmpty()) { + writer.writeStartElement(CXXENUMERATORS); + QList::ConstIterator i = items.begin(); + while (i != items.end()) { + writer.writeStartElement(CXXENUMERATOR); + writer.writeStartElement(APINAME); + writer.writeCharacters((*i).name()); + writer.writeEndElement(); // + + QString fq = fullQualification(en->parent()); + if (!fq.isEmpty()) { + writer.writeStartElement(CXXENUMERATORSCOPEDNAME); + writer.writeCharacters(fq + "::" + (*i).name()); + writer.writeEndElement(); // + } + writer.writeStartElement(CXXENUMERATORPROTOTYPE); + writer.writeCharacters((*i).name()); + writer.writeEndElement(); // + writer.writeStartElement(CXXENUMERATORNAMELOOKUP); + writer.writeCharacters(en->parent()->name() + "::" + (*i).name()); + writer.writeEndElement(); // + + if (!(*i).value().isEmpty()) { + writer.writeStartElement(CXXENUMERATORINITIALISER); + writer.writeAttribute("value", (*i).value()); + writer.writeEndElement(); // + } + if (!(*i).text().isEmpty()) { + writer.writeStartElement(APIDESC); + generateText((*i).text(), en, marker); + writer.writeEndElement(); // + } + writer.writeEndElement(); // + ++i; + } + writer.writeEndElement(); // + } + writeLocation(en, marker); writer.writeEndElement(); // writer.writeStartElement(APIDESC); -- cgit v0.12