diff options
author | Martin Smith <martin.smith@nokia.com> | 2010-06-22 08:10:44 (GMT) |
---|---|---|
committer | Martin Smith <martin.smith@nokia.com> | 2010-06-22 08:10:44 (GMT) |
commit | 1d5e87b0451fd770395c1344af4b56cf790ca0e0 (patch) | |
tree | 2b599905ad091636d250666dcb61517f1238976c /tools | |
parent | f34f4ea2d35b92631e98a772e02a1b77ce26681e (diff) | |
download | Qt-1d5e87b0451fd770395c1344af4b56cf790ca0e0.zip Qt-1d5e87b0451fd770395c1344af4b56cf790ca0e0.tar.gz Qt-1d5e87b0451fd770395c1344af4b56cf790ca0e0.tar.bz2 |
doc: Added more DITA output to the XML generator
The rest of the cxxEnumeration stuff for enum types.
Task-number: QTBUG-11391
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qdoc3/ditaxmlgenerator.cpp | 44 |
1 files 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<const NamespaceNode*>(inner); + namespasse = const_cast<NamespaceNode*>(static_cast<const NamespaceNode*>(inner)); rawTitle = marker->plainName(inner); fullTitle = marker->plainFullName(inner); title = rawTitle + " Namespace"; } else if (inner->type() == Node::Class) { - cn = static_cast<const ClassNode*>(inner); + cn = const_cast<ClassNode*>(static_cast<const ClassNode*>(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<const FunctionNode*>(*m); + FunctionNode* fn = const_cast<FunctionNode*>(static_cast<const FunctionNode*>(*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(); // <cxxEnumerationNameLookup> + if (!items.isEmpty()) { + writer.writeStartElement(CXXENUMERATORS); + QList<EnumItem>::ConstIterator i = items.begin(); + while (i != items.end()) { + writer.writeStartElement(CXXENUMERATOR); + writer.writeStartElement(APINAME); + writer.writeCharacters((*i).name()); + writer.writeEndElement(); // </apiName> + + QString fq = fullQualification(en->parent()); + if (!fq.isEmpty()) { + writer.writeStartElement(CXXENUMERATORSCOPEDNAME); + writer.writeCharacters(fq + "::" + (*i).name()); + writer.writeEndElement(); // <cxxEnumeratorScopedName> + } + writer.writeStartElement(CXXENUMERATORPROTOTYPE); + writer.writeCharacters((*i).name()); + writer.writeEndElement(); // <cxxEnumeratorPrototype> + writer.writeStartElement(CXXENUMERATORNAMELOOKUP); + writer.writeCharacters(en->parent()->name() + "::" + (*i).name()); + writer.writeEndElement(); // <cxxEnumeratorNameLookup> + + if (!(*i).value().isEmpty()) { + writer.writeStartElement(CXXENUMERATORINITIALISER); + writer.writeAttribute("value", (*i).value()); + writer.writeEndElement(); // <cxxEnumeratorInitialiser> + } + if (!(*i).text().isEmpty()) { + writer.writeStartElement(APIDESC); + generateText((*i).text(), en, marker); + writer.writeEndElement(); // </apiDesc> + } + writer.writeEndElement(); // <cxxEnumerator> + ++i; + } + writer.writeEndElement(); // <cxxEnumerators> + } + writeLocation(en, marker); writer.writeEndElement(); // <cxxEnumerationDefinition> writer.writeStartElement(APIDESC); |