Skip to content

Commit

Permalink
Boostbook: Fix methodname for operator().
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.boost.org/svn/boost/trunk@79657 b8fc166d-592f-0410-95f2-cb63ce0dd405
  • Loading branch information
danieljames committed Jul 22, 2012
1 parent 2f5280b commit b04f1ee
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tools/boostbook/test/more/tests/ref/methodname.gold
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<chapter id="method">
<title>Methodname Test</title>
<section id="links">
<para>
<computeroutput xmlns:xi="http://www.w3.org/2001/XInclude"><link linkend="id1-bb">thing::foo::bar</link></computeroutput>,
<computeroutput xmlns:xi="http://www.w3.org/2001/XInclude"><link linkend="id1-bb">thing::foo::bar(int x)</link></computeroutput>,
<computeroutput xmlns:xi="http://www.w3.org/2001/XInclude"><link linkend="id2-bb">thing::foo::operator()</link></computeroutput>,
<computeroutput xmlns:xi="http://www.w3.org/2001/XInclude"><link linkend="id2-bb">thing::foo::operator()(int x)</link></computeroutput>.
</para>
</section>
<section id="method.reference"><title>Reference</title>
<section id="header.boost.unordered_set_hpp"><title>Header &lt;<ulink url="../../boost/unordered_set.hpp">boost/unordered_set.hpp</ulink>&gt;</title><synopsis xmlns:xi="http://www.w3.org/2001/XInclude"><phrase role="keyword">namespace</phrase> <phrase role="identifier">thing</phrase> <phrase role="special">{</phrase>
<phrase role="keyword">class</phrase> <link linkend="thing.foo">foo</link><phrase role="special">;</phrase>
<phrase role="special">}</phrase></synopsis>
<refentry xmlns:xi="http://www.w3.org/2001/XInclude" id="thing.foo"><refmeta><refentrytitle>Class foo</refentrytitle><manvolnum>3</manvolnum></refmeta><refnamediv><refname>thing::foo</refname><refpurpose/></refnamediv><refsynopsisdiv><synopsis><phrase role="comment">// In header: &lt;<link linkend="header.boost.unordered_set_hpp">boost/unordered_set.hpp</link>&gt;

</phrase>
<phrase role="keyword">class</phrase> <link linkend="thing.foo">foo</link> <phrase role="special">{</phrase>
<phrase role="keyword">public</phrase><phrase role="special">:</phrase>
<phrase role="keyword">void</phrase> <link linkend="id1-bb"><phrase role="identifier">bar</phrase></link><phrase role="special">(</phrase><phrase role="keyword">int</phrase><phrase role="special">)</phrase><phrase role="special">;</phrase>
<phrase role="keyword">void</phrase> <link linkend="id2-bb"><phrase role="keyword">operator</phrase><phrase role="special">(</phrase><phrase role="special">)</phrase></link><phrase role="special">(</phrase><phrase role="keyword">int</phrase><phrase role="special">)</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase><phrase role="special">;</phrase></synopsis></refsynopsisdiv><refsect1><title>Description</title><para><literallayout class="monospaced"><phrase role="keyword">void</phrase> <anchor id="id1-bb"/><phrase role="identifier">bar</phrase><phrase role="special">(</phrase><phrase role="keyword">int</phrase><phrase role="special">)</phrase><phrase role="special">;</phrase></literallayout></para><para><literallayout class="monospaced"><phrase role="keyword">void</phrase> <anchor id="id2-bb"/><phrase role="keyword">operator</phrase><phrase role="special">(</phrase><phrase role="special">)</phrase><phrase role="special">(</phrase><phrase role="keyword">int</phrase><phrase role="special">)</phrase><phrase role="special">;</phrase></literallayout></para></refsect1></refentry>
</section>
</section>
</chapter>
36 changes: 36 additions & 0 deletions tools/boostbook/test/more/tests/ref/methodname.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!--
Copyright Daniel James 2012
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-->
<library name="Methodname Test" id="method">
<title>Methodname Test</title>
<section id="links">
<para>
<methodname>thing::foo::bar</methodname>,
<methodname>thing::foo::bar(int x)</methodname>,
<methodname>thing::foo::operator()</methodname>,
<methodname>thing::foo::operator()(int x)</methodname>.
</para>
</section>
<library-reference>
<header name="boost/unordered_set.hpp">
<namespace name="thing">
<class name="foo">
<method name="bar">
<parameter>
<paramtype>int</paramtype>
</parameter>
<type>void</type>
</method>
<method name="operator()">
<parameter>
<paramtype>int</paramtype>
</parameter>
<type>void</type>
</method>
</class>
</namespace>
</header>
</library-reference>
</library>
4 changes: 4 additions & 0 deletions tools/boostbook/xsl/annotation.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@
<!-- Strip off any call -->
<xsl:variable name="name">
<xsl:choose>
<xsl:when test="contains($fullname, 'operator()')">
<xsl:value-of select="substring-before($fullname, 'operator()')"/>
<xsl:value-of select="'operator()'"/>
</xsl:when>
<xsl:when test="contains($fullname, '(')">
<xsl:value-of select="substring-before($fullname, '(')"/>
</xsl:when>
Expand Down

0 comments on commit b04f1ee

Please sign in to comment.