New file with this Example

08 Mar 2013

When an @Example block uses templates the documentation renders is fine but the "New file with this example" button doesn't handle it well.

Looks good:

/media/uploads/sam_grove/_scaled_-example_render.jpg

When importing the code (uhh oh):

/media/uploads/sam_grove/_scaled_-example_import.jpg

Here is a snippet of code to reproduce:

 
#ifndef ATOH_H
#define ATOH_H

#include <stdint.h>

/** Convert a ASCII string to it's binary equivenent
 *
 * Example:
 * @code
 *  #include "mbed.h"
 *  #include "atoh.h"
 * 
 *  int main()
 *  {
 *      uint64_t result = atoh <uint64_t> ("0123456789abcdef" );
 *      uint32_t lo = result & 0x00000000ffffffff;
 *      uint32_t hi = (result >> 32);
 *      printf( "0x%08X%08X\n", hi, lo );
 *      printf( "0x%08X\n", atoh <uint32_t> ( "12345678" ) );
 *      printf( "0x%04X\n", atoh <uint16_t> ( "1234" ) );
 *      printf( "0x%02X\n", atoh <uint8_t> ( "12" ) );
 *  }
 * @endcode
 */

/** A templated method for ascii to hex conversions. Supported types are:
 *  uint8_t, uint16_t, uint32_t and uint64_t
 *  @param string - An ascii string of hex digits
 *  @returns The binary equivelant of the string
 */
template<typename T>
T atoh( char const *string );

#endif

Using Chrome V25 on windows 7 (beta not enabled)

-deleted-
08 Mar 2013

Hi Sam,

Thanks for the detailed bug report.
The Compiler has been updated to correct the "New file with this example" faulty behavior.
Please don't hesitate to contact us if you find an issue or regression.

Thanks,
Mihail