From 3a764060dab07ef0b51d7027b9606c73c0701d2f Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 18 Mar 2011 13:15:12 +0100 Subject: qdoc: Added the element. --- tools/qdoc3/ditaxmlgenerator.cpp | 12 +++++++++++- tools/qdoc3/node.cpp | 15 +++++++++++++++ tools/qdoc3/node.h | 4 ++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index cc9b4fa..5d3e34a 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -5667,9 +5667,19 @@ DitaXmlGenerator::writeProlog(const InnerNode* inner, CodeMarker* marker) if (!component.isEmpty()) { writeStartTag(DT_component); xmlWriter().writeCharacters(component); - writeEndTag(); // + writeEndTag(); // } writeEndTag(); // + if (inner->hasOtherMetadata()) { + const QMap& omd = inner->otherMetadata(); + QMapIterator i(omd); + while (i.hasNext()) { + i.next(); + writeStartTag(DT_othermeta); + xmlWriter().writeAttribute("name",i.key()); + xmlWriter().writeAttribute("content",i.value()); + } + } } writeEndTag(); // writeEndTag(); // diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index 3b1f280..0f85d37 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -858,6 +858,21 @@ void InnerNode::removeRelated(Node *pseudoChild) related.removeAll(pseudoChild); } +/*! \fn bool InnerNode::hasOtherMetadata() const + Returns tru if the other metadata map is not empty. + */ + +/*! + Insert the pair \a name and \a content into the other metadata map. + */ +void insertOtherMetadata(const QString& name, const QString& content) +{ +} + +/*! \fn const QMap& InnerNode::otherMetadata() cont + Returns the map containing pairs for output as \c {}. + */ + /*! \class LeafNode */ diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index 92a7c9f..2de2b5a 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -274,6 +274,9 @@ class InnerNode : public Node virtual void addPageKeywords(const QString& t) { pageKeywds << t; } virtual bool isAbstract() const { return false; } virtual void setAbstract(bool ) { } + bool hasOtherMetadata() const { return !otherMetadataMap.isEmpty(); } + void insertOtherMetadata(const QString& name, const QString& content); + const QMap& otherMetadata() const { return otherMetadataMap; } protected: InnerNode(Type type, InnerNode* parent, const QString& name); @@ -297,6 +300,7 @@ class InnerNode : public Node QMap childMap; QMap primaryFunctionMap; QMap secondaryFunctionMap; + QMap otherMetadataMap; }; class LeafNode : public Node -- cgit v0.12