Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r86274 - in trunk/tools/boostbook: test/doxygen xsl/doxygen
From: dnljms_at_[hidden]
Date: 2013-10-12 16:10:23


Author: danieljames
Date: 2013-10-12 16:10:22 EDT (Sat, 12 Oct 2013)
New Revision: 86274
URL: http://svn.boost.org/trac/boost/changeset/86274

Log:
Factor out method and function attributes.

Not all attributes apply to all methods and functions, but hopefully they should
never appear when inappropriate.

Text files modified:
   trunk/tools/boostbook/test/doxygen/autodoc.gold | 6
   trunk/tools/boostbook/xsl/doxygen/doxygen2boostbook.xsl | 128 ++++++++++++---------------------------
   2 files changed, 43 insertions(+), 91 deletions(-)

Modified: trunk/tools/boostbook/test/doxygen/autodoc.gold
==============================================================================
--- trunk/tools/boostbook/test/doxygen/autodoc.gold Sat Oct 12 16:09:53 2013 (r86273)
+++ trunk/tools/boostbook/test/doxygen/autodoc.gold 2013-10-12 16:10:22 EDT (Sat, 12 Oct 2013) (r86274)
@@ -14,8 +14,8 @@
 <data-member name="static_integer" specifiers="static"><type>int</type></data-member>
 <data-member name="static_const_integer" specifiers="static"><type>const int</type></data-member>
 <method-group name="public member functions">
-<method name="virtual_method" cv=""><type>virtual int</type></method>
-<method name="conversion-operator" cv="" specifiers="explicit"><type>int</type></method>
+<method name="virtual_method"><type>virtual int</type></method>
+<method name="conversion-operator" specifiers="explicit"><type>int</type></method>
 </method-group>
 <constructor cv="= default"><parameter name=""><paramtype><classname>example</classname> const &amp;</paramtype></parameter></constructor>
 <copy-assignment cv="= delete"><type><classname>example</classname> &amp;</type><parameter name=""><paramtype><classname>example</classname> const &amp;</paramtype></parameter></copy-assignment>
@@ -45,7 +45,7 @@
 </method-group>
 <constructor><description><para>A constructor. </para></description></constructor>
 <destructor><description><para>A destructor. </para></description></destructor>
-<copy-assignment cv=""><type><emphasis>unspecified</emphasis></type><parameter name=""><paramtype>const <classname>specialization_test</classname> &amp;</paramtype></parameter><description><para>An assignment operator. </para></description></copy-assignment>
+<copy-assignment><type><emphasis>unspecified</emphasis></type><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>

Modified: trunk/tools/boostbook/xsl/doxygen/doxygen2boostbook.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/doxygen/doxygen2boostbook.xsl Sat Oct 12 16:09:53 2013 (r86273)
+++ trunk/tools/boostbook/xsl/doxygen/doxygen2boostbook.xsl 2013-10-12 16:10:22 EDT (Sat, 12 Oct 2013) (r86274)
@@ -1059,6 +1059,42 @@
     </xsl:if>
   </xsl:template>
 
+ <xsl:template name="function.attributes">
+
+ <!-- CV Qualifiers -->
+ <xsl:if test="@const='yes' or @volatile='yes' or contains(argsstring/text(),'=delete') or contains(argsstring/text(),'=default')">
+ <xsl:attribute name="cv">
+ <xsl:if test="@const='yes'">
+ <xsl:text>const</xsl:text>
+ </xsl:if>
+ <xsl:if test="@volatile='yes'">
+ <xsl:if test="@const='yes'">
+ <xsl:text> </xsl:text>
+ </xsl:if>
+ <xsl:text>volatile</xsl:text>
+ </xsl:if>
+ <!-- Cheat and add deleted and defaulted function markers to the CV qualifiers -->
+ <xsl:if test="contains(argsstring/text(),'=delete')">
+ <xsl:if test="@const='yes' or @volatile='yes'">
+ <xsl:text> </xsl:text>
+ </xsl:if>
+ <xsl:text>= delete</xsl:text>
+ </xsl:if>
+ <xsl:if test="contains(argsstring/text(),'=default')">
+ <xsl:if test="@const='yes' or @volatile='yes'">
+ <xsl:text> </xsl:text>
+ </xsl:if>
+ <xsl:text>= default</xsl:text>
+ </xsl:if>
+ </xsl:attribute>
+ </xsl:if>
+
+ <xsl:if test="@explicit = 'yes'">
+ <xsl:attribute name="specifiers">explicit</xsl:attribute>
+ </xsl:if>
+
+ </xsl:template>
+
   <!-- Handle function children -->
   <xsl:template name="function.children">
     <xsl:param name="is-overloaded" select="false()"/>
@@ -1186,18 +1222,7 @@
       <xsl:if test="@explicit = 'yes'">
         <xsl:attribute name="specifiers">explicit</xsl:attribute>
       </xsl:if>
- <!-- CV Qualifiers -->
- <xsl:if test="contains(argsstring/text(),'=delete') or contains(argsstring/text(),'=default')">
- <xsl:attribute name="cv">
- <!-- Cheat and add deleted and defaulted function markers to the CV qualifiers -->
- <xsl:if test="contains(argsstring/text(),'=delete')">
- <xsl:text>= delete</xsl:text>
- </xsl:if>
- <xsl:if test="contains(argsstring/text(),'=default')">
- <xsl:text>= default</xsl:text>
- </xsl:if>
- </xsl:attribute>
- </xsl:if>
+ <xsl:call-template name="function.attributes"/>
       <xsl:call-template name="function.children"/>
     </constructor>
     <xsl:text>&#10;</xsl:text><!-- Newline -->
@@ -1214,34 +1239,7 @@
   <!-- Handle Copy Assignment -->
   <xsl:template name="copy-assignment">
     <copy-assignment>
- <!-- CV Qualifiers -->
- <xsl:if test="not (@const='no' and @volatile='no')">
- <xsl:attribute name="cv">
- <xsl:if test="@const='yes'">
- <xsl:text>const</xsl:text>
- </xsl:if>
- <xsl:if test="@volatile='yes'">
- <xsl:if test="@const='yes'">
- <xsl:text> </xsl:text>
- </xsl:if>
- <xsl:text>volatile</xsl:text>
- </xsl:if>
- <!-- Cheat and add deleted and defaulted function markers to the CV qualifiers -->
- <xsl:if test="contains(argsstring/text(),'=delete')">
- <xsl:if test="@const='yes' or @volatile='yes'">
- <xsl:text> </xsl:text>
- </xsl:if>
- <xsl:text>= delete</xsl:text>
- </xsl:if>
- <xsl:if test="contains(argsstring/text(),'=default')">
- <xsl:if test="@const='yes' or @volatile='yes'">
- <xsl:text> </xsl:text>
- </xsl:if>
- <xsl:text>= default</xsl:text>
- </xsl:if>
- </xsl:attribute>
- </xsl:if>
-
+ <xsl:call-template name="function.attributes"/>
       <!-- Return type -->
       <xsl:element name="type">
         <!-- Cheat on virtual and static by dropping them into the type -->
@@ -1263,32 +1261,7 @@
       <xsl:attribute name="name">
         <xsl:text>conversion-operator</xsl:text>
       </xsl:attribute>
-
- <!-- CV Qualifiers -->
- <xsl:if test="not (@const='no' and @volatile='no') or contains(argsstring/text(),'=delete')">
- <xsl:attribute name="cv">
- <xsl:if test="@const='yes'">
- <xsl:text>const</xsl:text>
- </xsl:if>
- <xsl:if test="@volatile='yes'">
- <xsl:if test="@const='yes'">
- <xsl:text> </xsl:text>
- </xsl:if>
- <xsl:text>volatile</xsl:text>
- </xsl:if>
- <!-- Cheat and add deleted function markers to the CV qualifiers -->
- <xsl:if test="contains(argsstring/text(),'=delete')">
- <xsl:if test="@const='yes' or @volatile='yes'">
- <xsl:text> </xsl:text>
- </xsl:if>
- <xsl:text>= delete</xsl:text>
- </xsl:if>
- </xsl:attribute>
- </xsl:if>
-
- <xsl:if test="@explicit = 'yes'">
- <xsl:attribute name="specifiers">explicit</xsl:attribute>
- </xsl:if>
+ <xsl:call-template name="function.attributes"/>
 
       <!-- Conversion type -->
       <type>
@@ -1306,28 +1279,7 @@
       <xsl:attribute name="name">
         <xsl:value-of select="name/text()"/>
       </xsl:attribute>
-
- <!-- CV Qualifiers -->
- <xsl:if test="not (@const='no' and @volatile='no') or contains(argsstring/text(),'=delete')">
- <xsl:attribute name="cv">
- <xsl:if test="@const='yes'">
- <xsl:text>const</xsl:text>
- </xsl:if>
- <xsl:if test="@volatile='yes'">
- <xsl:if test="@const='yes'">
- <xsl:text> </xsl:text>
- </xsl:if>
- <xsl:text>volatile</xsl:text>
- </xsl:if>
- <!-- Cheat and add deleted function markers to the CV qualifiers -->
- <xsl:if test="contains(argsstring/text(),'=default')">
- <xsl:if test="@const='yes' or @volatile='yes'">
- <xsl:text> </xsl:text>
- </xsl:if>
- <xsl:text>= default</xsl:text>
- </xsl:if>
- </xsl:attribute>
- </xsl:if>
+ <xsl:call-template name="function.attributes"/>
 
       <!-- Return type -->
       <xsl:element name="type">


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