[Boost-docs] How to get syntax coloring in Quickboook Doxygen C++ Reference sections

Subject: [Boost-docs] How to get syntax coloring in Quickboook Doxygen C++ Reference sections
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2013-10-27 17:54:44


I'm haven't another déjà vu about this issue ;-)
 
But is there something I am doing wrong that I am not seeing syntax coloring from this Doxygen
comment, even after specifying that it is cpp.
 
(Syntax coloring works fine from Quickbook snippets).
 
@b Example:
 
\code{.cpp}
#include <boost/numeric/safe_cast.hpp>
#include <boost/numeric/safe_integer.hpp>
 
void f(){
    safe_integer<char> i;
    unsigned char j;
    i = 1;
    j = safe_cast<unsigned char>(i); // ok
    i = -1;
    j = safe_cast<unsigned char>(i); // throws std::out_of_range exception
    i = 1024;
    j = safe_cast<unsigned char>(i); // throws std::out_of_range exception
}
\endcode
 
This gives syntax colored if you use the doxywizard, but the html generated from Quickbook toolchain
is just in 'code font' with the html source
 
<p><span class="bold"><strong>Example:</strong></span> </p>
<pre class="programlisting">#include &lt;boost/numeric/safe_cast.hpp&gt;
#include &lt;boost/numeric/safe_integer.hpp&gt;
 
void f(){
    safe_integer&lt;char&gt; i;
    unsigned char j;
    i = 1;
    j = safe_cast&lt;unsigned char&gt;(i); // ok
    i = -1;
    j = safe_cast&lt;unsigned char&gt;(i); // throws std::out_of_range exception
    i = 1024;
    j = safe_cast&lt;unsigned char&gt;(i); // throws std::out_of_range exception
}
</pre>
 
The output shows thus

Function template safe_cast

boost::numeric::safe_cast — Converts boost::numeric::Numeric type from type T to type U ensuring
that the result would not be changed or undefined. Throws an std::out_of_range exception if such a
conversion is not possible without changing the value.

Synopsis

// In header: <boost/
<file:///I:\boost-sandbox\safe_numerics\libs\safe_numerics\doc\html\header\boost\safe_numerics\safe_
cast_hpp.html> safe_numerics/safe_cast.hpp>
 
 
template<typename T, typename U> T safe_cast(const U & u);

Description

Example:
#include <boost/numeric/safe_cast.hpp>
#include <boost/numeric/safe_integer.hpp>
 
void f(){
    safe_integer<char> i;
    unsigned char j;
    i = 1;
    j = safe_cast<unsigned char>(i); // ok
    i = -1;
    j = safe_cast<unsigned char>(i); // throws std::out_of_range exception
    i = 1024;
    j = safe_cast<unsigned char>(i); // throws std::out_of_range exception
 

 
It would be nice to have syntax coloring J
 
Thanks for any suggestions.
 
Paul
 

---
Paul A. Bristow,
Prizet Farmhouse, Kendal LA8 8AB  UK
+44 1539 561830  07714330204
pbristow_at_[hidden]
 

This archive was generated by hypermail 2.1.7 : 2017-11-11 08:50:41 UTC