Arnau478 / hevi

Hex viewer
https://arnau478.github.io/hevi/
GNU General Public License v3.0
56 stars 2 forks source link

Exporters #2

Closed Arnau478 closed 7 months ago

Arnau478 commented 10 months ago

Add "exporter" functionality. This would export the binary data into a specific format, usually a programming language constant declaration.

Example

Executing hevi some_file --exporter c would return a C array declaration, like:

unsigned char some_file[] = {0x00, 0x11, 0x22, 0x33};
Arnau478 commented 7 months ago

I've come to the realization that this wouldn't be that useful and require a lot of code, maintenance... It would also either increase the binary size by a few orders of magnitude or require external files at runtime. Furthermore, this can be considered an anti-pattern for most programming languages. In zig itself, it's much better to use @embedFile().

As a result, I will be closing this issue without implementing it. I might change my mind in the future, but for now this seems unnecessary.