bin2header

Aug 11, 2022

NAME

Binary to Header

SYNOPSIS

bin2header [options] file

OPTIONS

-h, --help

Print help information & exit.

-v, --version

Print version information & exit.

-o, --output

Output file name.

-n, --hname

Header name. Default is file name with "." replaced by "_".

-s, --chunksize

Read buffer chunk size (in bytes).
Default: 1048576 (1 megabyte)

-d, --nbdata

Number of bytes to write per line.
Default: 12

-c, --datacontent

Show data content as comment.

-f, --offset

Position offset to begin reading file (in bytes).
Default: 0

-l, --length

Number of bytes to process (0 = all).
Default: 0

-p, --pack

Stored data type bit length (8/16/32).
Default: 8

-e, --swap

Set endianess to big endian for 16 & 32 bit data types.

--stdvector

Additionally store data in std::vector for C++.

--eol

Set end of line character (cr/lf/crlf).
Default: lf

DESCRIPTION

bin2header takes any file as an argument and converts its binary data into a source header file for use in C/C++ applications. The data is stored as a character array.