How keidan/hex2bin works
hex2bin is a command-line converter for plain hexadecimal text and Intel HEX files. Users select input/output files and conversion options; the CLI validates the files, dispatches to the selected conversion mode, and writes the result. Intel HEX mode supports conversion in both directions, including address and padding options documented in the README. The graph separates CLI dispatch, conversion stages, and shared file/helper code. Some implementation details are unsampled, so only documented or excerpt-visible relationships are connected.
Main entry points: Files.cpp File streams · main.cpp CLI dispatch · IntelHex.cpp Intel HEX coordinator · Hex2Bin.cpp Hex text conversion
Components 11
CLI
- CLI dispatch
src/main.cpp - Windows options
src/win32/getopt_long.c
Conversion
- Hex text conversion
src/h2b/Hex2Bin.cpp - Intel HEX coordinator
src/h2b/IntelHex.cpp - Intel HEX to binary
src/h2b/ihex/Intel2Bin.cpp - Binary to Intel HEX
src/h2b/ihex/Bin2Intel.cpp
Shared I/O
- File streams
src/h2b/utils/Files.cpp - Conversion helpers
src/h2b/utils/Helper.hpp
Other components
- CLI user
- Input file
- Output file
Connections 15
- CLI user → CLI dispatch: supplies options
README.md - CLI dispatch → Hex text conversion: dispatches
src/main.cpp - CLI dispatch → Intel HEX coordinator: dispatches
src/main.cpp - CLI dispatch → Windows options: includes on Windows
src/main.cpp - Intel HEX coordinator → Intel HEX to binary: delegates conversion
src/h2b/IntelHex.cpp - Intel HEX coordinator → Binary to Intel HEX: delegates conversion
src/h2b/IntelHex.cpp - Hex text conversion → Conversion helpers: uses parsing helpers
src/h2b/Hex2Bin.cpp - Intel HEX to binary → Conversion helpers: uses parsing helpers
src/h2b/ihex/Intel2Bin.cpp - Binary to Intel HEX → Conversion helpers: uses record helpers
src/h2b/ihex/Bin2Intel.cpp - Intel HEX coordinator → File streams: shares file access
src/h2b/IntelHex.cpp - Hex text conversion → File streams: reads and writes
src/h2b/Hex2Bin.cpp - Intel HEX to binary → File streams: reads and writes
src/h2b/ihex/Intel2Bin.cpp - Binary to Intel HEX → File streams: reads and writes
src/h2b/ihex/Bin2Intel.cpp - Input file → File streams: opened as input
- File streams → Output file: writes result