{"id":18886952,"url":"https://github.com/lostjared/bin2cpp20","last_synced_at":"2026-02-23T20:30:21.750Z","repository":{"id":230458929,"uuid":"779437124","full_name":"lostjared/bin2cpp20","owner":"lostjared","description":"Unix Utility for Transforming a Stream into a C++20 Array, Vector, or Array of Strings","archived":false,"fork":false,"pushed_at":"2025-01-17T02:08:23.000Z","size":115,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-17T03:19:24.578Z","etag":null,"topics":["conversion-tool","cpp20","text-to-cpp","unix-tool","utility"],"latest_commit_sha":null,"homepage":"https://lostsidedead.biz/bin2cpp20","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lostjared.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-29T20:51:49.000Z","updated_at":"2025-01-17T03:12:54.000Z","dependencies_parsed_at":"2024-04-01T22:29:31.010Z","dependency_job_id":null,"html_url":"https://github.com/lostjared/bin2cpp20","commit_stats":null,"previous_names":["lostjared/bin2cpp20"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostjared%2Fbin2cpp20","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostjared%2Fbin2cpp20/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostjared%2Fbin2cpp20/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostjared%2Fbin2cpp20/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lostjared","download_url":"https://codeload.github.com/lostjared/bin2cpp20/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239859566,"owners_count":19708861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["conversion-tool","cpp20","text-to-cpp","unix-tool","utility"],"created_at":"2024-11-08T07:32:24.814Z","updated_at":"2026-02-23T20:30:21.670Z","avatar_url":"https://github.com/lostjared.png","language":"C++","readme":"# bin2cpp20 - Binary to C++20 Source Conversion Tool\n\n![image](https://github.com/user-attachments/assets/73a67823-3893-42a8-87bf-3a20a27d0562)\n\nNow contains GUI in Qt6.\n\n## Overview\n\n\n\n`bin2cpp20` is a versatile command-line utility designed to convert binary files/string data into C++20 compliant source code. This enables the embedding of binary/string data directly within C++ applications in a portable and efficient manner. The tool offers flexibility in output formats, including vectors, arrays, and strings, and supports additional options like sorting and Unicode handling.\n\n## Motivation\nThe motivation for this application was to be able to quickly generate arrays of binary/string data that I could embed in my C++20 code. Also to test out my new argument parsing header file argz.hpp.\n\n## Demonstration\nHere is a video demo of the application: https://youtu.be/umDLwADWRmM\n\n## Requirements\n\n- Fully C++20 compliant environment\n\n## Compilation\n\nTo compile `bin2cpp20`, use the following command:\n\n```sh\nmake -f Makefile.ux \n```\nor\n```sh\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake -j4\nsudo make install \n```\n\n\n## Usage\n\nThe basic usage of the tool can be invoked as follows:\n\n```sh\nbin2cpp20 [options]\n```\n\n### Key Features\n\n- **Input from file or standard input**: Specify an input binary file or use standard input.\n- **Output to standard output or file**: Direct the converted C++ source to standard output or a specified file.\n- **Variable naming**: Define custom variable names for the generated code.\n- **Output formats**: Choose between vector, array, or string representations of the binary data.\n- **Sorting and Unicode options**: Sort strings in the output or handle Unicode data correctly.\n\n### Options\n\n- `-i, --input \u003cfile/stdin\u003e`: Specify the input source. Use \"stdin\" to read from standard input.\n- `-o, --output \u003cfile\u003e`: Specify the output file. If not provided, output will be directed to standard output.\n- `-v, --variable \u003cname\u003e`: Set the name of the generated variable. This is required.\n- `-s, --string output`: Generate output as a string.\n- `-z, --sort`: Sort the output string. Applicable only with string output.\n- `-u, --unicode`: Treat the input as Unicode. Applicable only with string output.\n- `-h, --help`: Display the help message and exit.\n\n### Examples\n\n**Convert a binary file to a array:**\n\n```sh\nbin2cpp20 -i path/to/input/file -o path/to/output.hpp -v variable_name\n```\n\n**Convert standard input to a sorted Unicode string:**\n\n```sh\ncat path/to/input | bin2cpp20 -i stdin -s -u -z -v variable_name -o path/to/output.hpp\n```\n\n## Additional Notes\n\n- Ensure variable names are valid C++ identifiers.\n- Input files are read in binary mode, preserving the integrity of binary data.\n- The tool automatically appends `.hpp` to output filenames if not present.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flostjared%2Fbin2cpp20","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flostjared%2Fbin2cpp20","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flostjared%2Fbin2cpp20/lists"}