Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r78602 - in trunk/tools/boostbook: test/doxygen test/doxygen/boost xsl/doxygen
From: steven_at_[hidden]
Date: 2012-05-24 15:38:53


Author: steven_watanabe
Date: 2012-05-24 15:38:51 EDT (Thu, 24 May 2012)
New Revision: 78602
URL: http://svn.boost.org/trac/boost/changeset/78602

Log:
Correctly identify constructors/destructors of class template specializations.
Text files modified:
   trunk/tools/boostbook/test/doxygen/autodoc.gold | 6 +++++-
   trunk/tools/boostbook/test/doxygen/boost/example.hpp | 14 ++++++++++++++
   trunk/tools/boostbook/xsl/doxygen/doxygen2boostbook.xsl | 13 ++++++++++++-
   3 files changed, 31 insertions(+), 2 deletions(-)

Modified: trunk/tools/boostbook/test/doxygen/autodoc.gold
==============================================================================
--- trunk/tools/boostbook/test/doxygen/autodoc.gold (original)
+++ trunk/tools/boostbook/test/doxygen/autodoc.gold 2012-05-24 15:38:51 EDT (Thu, 24 May 2012)
@@ -17,7 +17,11 @@
 Line 1<sbr/>
  Line 2</para><para><programlisting> void foo() {}
 </programlisting></para><para>
-</para></description></struct><enum name="namespace_enum"><enumvalue name="enumerator"/></enum><data-member name="namespace_integer"><type>int</type></data-member><data-member name="namespace_static_integer" specifiers="static"><type>int</type></data-member><data-member name="namespace_const_integer"><type>const int</type></data-member><data-member name="namespace_static_const_integer" specifiers="static"><type>const int</type></data-member><function name="namespace_func"><type>int</type><parameter name="i"><paramtype>int</paramtype><description><para>A function parameter </para></description></parameter><parameter name="j"><paramtype>int</paramtype><description><para>Another </para></description></parameter><description><para>
+</para></description></struct><struct name="specialization_test"><template>
+ <template-type-parameter name="T"/>
+ </template></struct><struct-specialization name="specialization_test"><template>
+ <template-type-parameter name="T"/>
+ </template><specialization><template-arg>T *</template-arg></specialization><method-group name="public member functions"/><constructor><description><para>A constructor. </para></description></constructor><destructor><description><para>A destructor. </para></description></destructor><copy-assignment><parameter name=""><paramtype>const <classname>specialization_test</classname> &amp;</paramtype></parameter><description><para>An assignment operator. </para></description></copy-assignment></struct-specialization><enum name="namespace_enum"><enumvalue name="enumerator"/></enum><data-member name="namespace_integer"><type>int</type></data-member><data-member name="namespace_static_integer" specifiers="static"><type>int</type></data-member><data-member name="namespace_const_integer"><type>const int</type></data-member><data-member name="namespace_static_const_integer" specifiers="static"><type>const int</type></data-member><function name="namespace_func"><type>int</type><parameter name="i"><paramtype>int</param
type><description><para>A function parameter </para></description></parameter><parameter name="j"><paramtype>int</paramtype><description><para>Another </para></description></parameter><description><para>
 
 
 This is a test function. <classname alt="example::example">Link to class</classname> <classname alt="example::example_template">Link to class template</classname> <note><para>This is a note.</para></note>

Modified: trunk/tools/boostbook/test/doxygen/boost/example.hpp
==============================================================================
--- trunk/tools/boostbook/test/doxygen/boost/example.hpp (original)
+++ trunk/tools/boostbook/test/doxygen/boost/example.hpp 2012-05-24 15:38:51 EDT (Thu, 24 May 2012)
@@ -134,6 +134,20 @@
      */
     template <typename TypeParameter, int NonTypeParameter>
     void namespace_func_template();
+
+ template<class T>
+ struct specialization_test {
+ };
+
+ template<class T>
+ struct specialization_test<T*> {
+ /** A constructor. */
+ specialization_test();
+ /** A destructor. */
+ ~specialization_test();
+ /** An assignment operator. */
+ specialization_test& operator=(const specialization_test&);
+ };
 }
 
 #define EXAMPLE(m) The macro

Modified: trunk/tools/boostbook/xsl/doxygen/doxygen2boostbook.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/doxygen/doxygen2boostbook.xsl (original)
+++ trunk/tools/boostbook/xsl/doxygen/doxygen2boostbook.xsl 2012-05-24 15:38:51 EDT (Thu, 24 May 2012)
@@ -855,12 +855,23 @@
           <xsl:otherwise>
             <!-- We are in a class -->
             <!-- The name of the class we are in -->
- <xsl:variable name="in-class">
+ <xsl:variable name="in-class-full">
               <xsl:call-template name="strip-qualifiers">
                 <xsl:with-param name="name"
                   select="string(ancestor::compounddef/compoundname/text())"/>
               </xsl:call-template>
             </xsl:variable>
+
+ <xsl:variable name ="in-class">
+ <xsl:choose>
+ <xsl:when test="contains($in-class-full, '&lt;')">
+ <xsl:value-of select="substring-before($in-class-full, '&lt;')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$in-class-full"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
             
             <xsl:choose>
               <xsl:when test="string(name/text())=$in-class">


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk