diff options
author | Martin Smith <martin.smith@nokia.com> | 2011-03-18 12:15:12 (GMT) |
---|---|---|
committer | Martin Smith <martin.smith@nokia.com> | 2011-03-18 12:15:12 (GMT) |
commit | 3a764060dab07ef0b51d7027b9606c73c0701d2f (patch) | |
tree | d835edc0bfb0cef56f6f66a5de1978cd04ec224e | |
parent | 4d5f37bd4a472b144e5962dd4b24a6e81f89d390 (diff) | |
download | Qt-3a764060dab07ef0b51d7027b9606c73c0701d2f.zip Qt-3a764060dab07ef0b51d7027b9606c73c0701d2f.tar.gz Qt-3a764060dab07ef0b51d7027b9606c73c0701d2f.tar.bz2 |
qdoc: Added the <othermeta> element.
-rw-r--r-- | tools/qdoc3/ditaxmlgenerator.cpp | 12 | ||||
-rw-r--r-- | tools/qdoc3/node.cpp | 15 | ||||
-rw-r--r-- | tools/qdoc3/node.h | 4 |
3 files changed, 30 insertions, 1 deletions
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(); // <prodinfo> + writeEndTag(); // <component> } writeEndTag(); // <prodinfo> + if (inner->hasOtherMetadata()) { + const QMap<QString, QString>& omd = inner->otherMetadata(); + QMapIterator<QString, QString> i(omd); + while (i.hasNext()) { + i.next(); + writeStartTag(DT_othermeta); + xmlWriter().writeAttribute("name",i.key()); + xmlWriter().writeAttribute("content",i.value()); + } + } } writeEndTag(); // <metadata> writeEndTag(); // <prolog> 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<QString, QString>& InnerNode::otherMetadata() cont + Returns the map containing pairs for output as \c {<othermetadata>}. + */ + /*! \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<QString, QString>& otherMetadata() const { return otherMetadataMap; } protected: InnerNode(Type type, InnerNode* parent, const QString& name); @@ -297,6 +300,7 @@ class InnerNode : public Node QMap<QString, Node*> childMap; QMap<QString, Node*> primaryFunctionMap; QMap<QString, NodeList> secondaryFunctionMap; + QMap<QString, QString> otherMetadataMap; }; class LeafNode : public Node |