Template for exported C files.

Wishlists for new functionality and features.
Post Reply
JohnnyD
Posts: 1
Joined: 19 Mar 2013 13:49

Template for exported C files.

Post by JohnnyD »

Hi,

First of all, I'd like to say thankyou for making such a useful program. I use it a lot to convert bitmap files to C byte arrays for use in embedded graphics projects.

It would be incredibly useful to have some kind of template system where you could make a txt file template with placeholders so that when you exported a C file, the placeholders were just replaced by the exported data. Eg:

at the moment, the exported C file looks something like this:

Code: Select all

/* FileName.bmp (3/12/2013 3:06:04 PM)
   StartOffset: 00000000, EndOffset: 00008C05, Length: 00008C06 */

const char RawData[35846] = {
	0x42, 0x4D, 0x06, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x04,
...
};

If I could have a template file that looked like this:

Code: Select all

/* $FileName$ (3/12/2013 3:06:04 PM)
   StartOffset: $StartOffset$, EndOffset: $EndOffset$, Length: $Length$ */

#include "Types.h"

const u8 RawData[$NumberOfBytes$] __attribute__ ((section ("EXTFLASH") )) = {
$ByteArray$
};
It would allow me to include all the things which I have to manually add in later, which can be time consuming for many files.

Hopefully that makes some kind of sense!

Many thanks,

John.
ThorstenAl
Posts: 1
Joined: 09 Apr 2013 15:14

Re: Template for exported C files.

Post by ThorstenAl »

Hi,

I'm also very happy with this great hex-editor. The suggestion of JonnyD is good, but I have one more suggestion for the C export.

It would be very helpful to be able to set the number of bytes that shall be exported in one row. Currently always 12 elements are exported in one row, maybe because of a limit of 80 characters per line. This was common in former days, but today very often wider lines are allowed (and used). I would like to be able to choose this number of exported bytes per line to be 16, for I often have to compare such arrays by having a look at them (in different tools). Comparing lines with 12 elements and with 16 elements of course is possible but much harder than having the same size on both sides.
Maybe the number of exported elements per line can be the same as the number of elements displayed in one line in the editor (and this size is already changeable!). I was looking for some kind of .ini file to make some settings, but it seams that all settings are hard coded and hidden in the .exe file.

Thanks a lot,

Thorsten
Post Reply