diff options
author | Martin Smith <martin.smith@nokia.com> | 2010-06-25 11:29:45 (GMT) |
---|---|---|
committer | Martin Smith <martin.smith@nokia.com> | 2010-06-25 11:29:45 (GMT) |
commit | 451a017e4d819a53d22b5dd5b562f99bda7ac087 (patch) | |
tree | a030d0a896727d604371ed7a2ebaf768435136eb /tools | |
parent | 7d52e7a2c9cdcdb16ae3d91b7be147a926489fbc (diff) | |
download | Qt-451a017e4d819a53d22b5dd5b562f99bda7ac087.zip Qt-451a017e4d819a53d22b5dd5b562f99bda7ac087.tar.gz Qt-451a017e4d819a53d22b5dd5b562f99bda7ac087.tar.bz2 |
doc: Added more DITA output to the XML generator
Output the \variable stuff as a cxxVariable.
Task-number: QTBUG-11391
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qdoc3/codechunk.h | 2 | ||||
-rw-r--r-- | tools/qdoc3/ditaxmlgenerator.cpp | 72 |
2 files changed, 66 insertions, 8 deletions
diff --git a/tools/qdoc3/codechunk.h b/tools/qdoc3/codechunk.h index e78873c..a0c554e 100644 --- a/tools/qdoc3/codechunk.h +++ b/tools/qdoc3/codechunk.h @@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE /* The CodeChunk class represents a tiny piece of C++ code. - The class provides convertion between a list of lexemes and a string. It adds + The class provides conversion between a list of lexemes and a string. It adds spaces at the right place for consistent style. The tiny pieces of code it represents are data types, enum values, and default parameter values. diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 852d209..0135983 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -4573,7 +4573,8 @@ void DitaXmlGenerator::writeLocation(const Node* n) s2 = CXXTYPEDEFDECLARATIONFILE; s3 = CXXTYPEDEFDECLARATIONFILELINE; } - else if (n->type() == Node::Property) { + else if ((n->type() == Node::Property) || + (n->type() == Node::Variable)) { s1 = CXXVARIABLEAPIITEMLOCATION; s2 = CXXVARIABLEDECLARATIONFILE; s3 = CXXVARIABLEDECLARATIONFILELINE; @@ -4716,6 +4717,8 @@ void DitaXmlGenerator::writeParameters(const FunctionNode* fn, CodeMarker* marke writer.writeStartElement(CXXFUNCTIONPARAMETER); writer.writeStartElement(CXXFUNCTIONPARAMETERDECLAREDTYPE); writer.writeCharacters((*p).leftType()); + if (!(*p).rightType().isEmpty()) + writer.writeCharacters((*p).rightType()); writer.writeEndElement(); // <cxxFunctionParameterDeclaredType> writer.writeStartElement(CXXFUNCTIONPARAMETERDECLARATIONNAME); writer.writeCharacters((*p).name()); @@ -4888,12 +4891,6 @@ void DitaXmlGenerator::writeTypedefs(const Section& s, } } -void DitaXmlGenerator::writeDataMembers(const Section& s, - const ClassNode* cn, - CodeMarker* marker) -{ -} - void DitaXmlGenerator::writeProperties(const Section& s, const ClassNode* cn, CodeMarker* marker) @@ -4992,6 +4989,67 @@ void DitaXmlGenerator::writeProperties(const Section& s, } } +void DitaXmlGenerator::writeDataMembers(const Section& s, + const ClassNode* cn, + CodeMarker* marker) +{ + NodeList::ConstIterator m = s.members.begin(); + while (m != s.members.end()) { + if ((*m)->type() == Node::Variable) { + const VariableNode* vn = static_cast<const VariableNode*>(*m); + writer.writeStartElement(CXXVARIABLE); + writer.writeAttribute("id",vn->guid()); + writer.writeStartElement(APINAME); + writer.writeCharacters(vn->name()); + writer.writeEndElement(); // </apiName> + generateBrief(vn,marker); + writer.writeStartElement(CXXVARIABLEDETAIL); + writer.writeStartElement(CXXVARIABLEDEFINITION); + writer.writeStartElement(CXXVARIABLEACCESSSPECIFIER); + writer.writeAttribute("value",vn->accessString()); + writer.writeEndElement(); // <cxxVariableAccessSpecifier> + + writer.writeStartElement(CXXVARIABLEDECLAREDTYPE); + writer.writeCharacters(vn->leftType()); + if (!vn->rightType().isEmpty()) + writer.writeCharacters(vn->rightType()); + writer.writeEndElement(); // <cxxVariableDeclaredType> + + QString fq = fullQualification(vn); + if (!fq.isEmpty()) { + writer.writeStartElement(CXXVARIABLESCOPEDNAME); + writer.writeCharacters(fq); + writer.writeEndElement(); // <cxxVariableScopedName> + } + + writer.writeStartElement(CXXVARIABLEPROTOTYPE); + writer.writeCharacters(vn->leftType() + " "); + //writer.writeCharacters(vn->parent()->name() + "::" + vn->name()); + writer.writeCharacters(vn->name()); + if (!vn->rightType().isEmpty()) + writer.writeCharacters(vn->rightType()); + writer.writeEndElement(); // <cxxVariablePrototype> + + writer.writeStartElement(CXXVARIABLENAMELOOKUP); + writer.writeCharacters(vn->parent()->name() + "::" + vn->name()); + writer.writeEndElement(); // <cxxVariableNameLookup> + + writeLocation(vn); + writer.writeEndElement(); // <cxxVariableDefinition> + writer.writeStartElement(APIDESC); + + if (!vn->doc().isEmpty()) { + generateBody(vn, marker); + } + + writer.writeEndElement(); // </apiDesc> + writer.writeEndElement(); // </cxxVariableDetail> + writer.writeEndElement(); // </cxxVariable> + } + ++m; + } +} + void DitaXmlGenerator::writerFunctions(const QString& tag, const NodeList& nlist) { NodeList::const_iterator n = nlist.begin(); |