Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8b1d3b8
Implemented ITemplateVariableLookup and TemplateProcessor classes for…
end2endzone May 23, 2025
4bbd685
Small improvements
end2endzone May 23, 2025
6b02ac3
Made optimization to TemplateProcessor
end2endzone May 23, 2025
59a4d99
Modified IGenerator to implement ITemplateVariableLookup.
end2endzone May 23, 2025
6f638d0
Modified ArrayGenerator to uses file templates to generate output C/C…
end2endzone May 23, 2025
f8613cc
Added new command line samples.
end2endzone May 23, 2025
c8f5cd4
Code cleanup
end2endzone May 23, 2025
ec2880f
Fixed small bugs in ArrayGenerator implementation.
end2endzone May 23, 2025
2bb2255
Modified ManagerGenerator to use TemplateProcessor.
end2endzone May 24, 2025
e440dd0
Modified SegmentGenerator to use TemplateProcessor.
end2endzone May 24, 2025
19b57d7
Modified StringGenerator to use TemplateProcessor.
end2endzone May 24, 2025
c50f096
Modified Win32ResourceGenerator to use TemplateProcessor.
end2endzone May 24, 2025
a82f669
Updated README.md for #53
end2endzone May 29, 2025
2e01ed5
Renamed some markers in the file templates and methods in the code fo…
end2endzone May 29, 2025
d6b310b
Fixed compilation issues.
end2endzone May 31, 2025
6929760
Optimized code performance in BaseGenerator::getInputFileDataAsCode()
end2endzone Jun 1, 2025
f486177
Fixed failing unit test TestExtraction::testIssue50
end2endzone Jun 1, 2025
94102bc
First draft for modifying the TemplateProcessor to support TemplateVa…
end2endzone Jun 1, 2025
d5ad856
Renamed interface `ITemplateVariableLookup` to `ITemplateVariableHand…
end2endzone Jun 1, 2025
06af3fb
Revert "Renamed interface `ITemplateVariableLookup` to `ITemplateVari…
end2endzone Jun 1, 2025
d065848
Modified ITemplateVariableLookup interface to support "string templat…
end2endzone Jun 1, 2025
0ef1a82
Modified `getInputFileDataAsCode()` and `getInputFileChunkAsCode()` t…
end2endzone Jun 1, 2025
4465ae3
Renamed `lookupStringTemplateVariable()` to `lookupStringVariable()`.
end2endzone Jun 1, 2025
fb2d3fc
Renamed multiple template variables to more meaningful names. Also re…
end2endzone Jun 1, 2025
4f50af5
Removed `${bin2cpp_file_object_file_name_impl}` and `${bin2cpp_file_o…
end2endzone Jun 1, 2025
5671223
* Fixed issue #77: Refactor generating code to use full file template…
end2endzone Jun 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Changes for 3.1.0:
* Fixed issue #64: Remove build artifacts of samples from installation packages.
* Fixed issue #72: Move the code FileManager class generation code into its own IGenerator implementation.
* Fixed issue #74: Invalid generated output file name: index.cpptml.cpp.
* Fixed issue #77: Refactor generating code to use full file templates with markers.


Changes for 3.0.1:
Expand Down
19 changes: 6 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Github Releases](https://img.shields.io/github/release/end2endzone/bin2cpp.svg)](https://github.com/end2endzone/bin2cpp/releases)

bin2cpp is a command line tool for embedding small files (like images, icons or raw data files) into a C++ executable.
bin2cpp is a command line tool for embedding small files (like images, icons or raw data files) into a C or C++ executable.

When executed, bin2cpp takes binary file as input and outputs c++ code (a function) that when called allows a c++ program to retrieve the content of the input binary file.
When executed, bin2cpp takes binary file as input and outputs C or C++ code (a function) that when called allows a program to retrieve the content of the input binary file.



Expand All @@ -22,13 +22,6 @@ Build:
| Ubuntu 20.04 | [![Build on Linux](https://github.com/end2endzone/bin2cpp/actions/workflows/build_linux.yml/badge.svg)](https://github.com/end2endzone/bin2cpp/actions/workflows/build_linux.yml) | [![Tests on Linux](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/end2endzone/58cf6c72c08e706335337d5ef9ca48e8/raw/bin2cpp.master.Linux.json)](https://github.com/end2endzone/bin2cpp/actions/workflows/build_linux.yml) |
| macOS 10.15 | [![Build on macOS](https://github.com/end2endzone/bin2cpp/actions/workflows/build_macos.yml/badge.svg)](https://github.com/end2endzone/bin2cpp/actions/workflows/build_macos.yml) | [![Tests on macOS](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/end2endzone/58cf6c72c08e706335337d5ef9ca48e8/raw/bin2cpp.master.macOS.json)](https://github.com/end2endzone/bin2cpp/actions/workflows/build_macos.yml) |

Statistics:

| AppVeyor | Travic CI | GitHub |
| ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| [![Statistics](https://buildstats.info/appveyor/chart/end2endzone/bin2cpp)](https://ci.appveyor.com/project/end2endzone/bin2cpp/branch/master) | [![Statistics](https://buildstats.info/travisci/chart/end2endzone/bin2cpp)](https://travis-ci.org/end2endzone/bin2cpp) | [![Statistics](https://buildstats.info/github/chart/end2endzone/bin2cpp)](https://github.com/end2endzone/bin2cpp/actions/) |




# Purpose
Expand All @@ -46,24 +39,24 @@ The generated functions that reads and extracts the embedded content does not re

The main features of the project are:

* Easily converts small files as C++ source code for embedding into a C++ executable.
* Easily converts small files to C or C++ source code for embedding into an executable.
* Access content with a unique function call for each embedded file.
* Supports multiple embedded files at once.
* Keep the directory structure when embedding directories.
* Supports encoding and extracting files with a custom directory structure.
* Makes it harder for resource hacker to modify or steal the embedded files.
* No third party libraries required for retrieving the data of the embedded files.
* Supports different types of code generator: string, segment, array, win32 resources.
* File's originals `size`, `filename` and `directory` properties available from generated source code.
* File's originals `size`, `filename` and `relative path` properties available from generated source code.
* Control generated source code: choose your custom _File_ interface and namespace.
* Print a file encoded content to stdout. Useful for scripts and integration with third party application.
* Generated code is C++98 standard-compliant.
* Generated code is C99 or C++98 standard-compliant.



## Use cases

The following list show situations where bin2cpp is useful:
The following list show use cases where bin2cpp is useful:

* Embedding default configuration files if none are provided.
* Embedding GLSL shaders into the executable.
Expand Down
Loading