{"id":18887026,"url":"https://github.com/lostjared/text2cpp","last_synced_at":"2026-04-29T00:05:37.304Z","repository":{"id":52292314,"uuid":"73100333","full_name":"lostjared/text2cpp","owner":"lostjared","description":"bin2cpp - Convert binary files to C,C++ or Go arrays  text2cpp - convert Text to C++17 ","archived":false,"fork":false,"pushed_at":"2021-01-10T11:40:52.000Z","size":34,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-31T05:18:30.216Z","etag":null,"topics":["conversion","cplusplus","golang","text"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"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":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-07T16:51:01.000Z","updated_at":"2023-12-14T02:10:06.000Z","dependencies_parsed_at":"2022-09-07T05:12:55.479Z","dependency_job_id":null,"html_url":"https://github.com/lostjared/text2cpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostjared%2Ftext2cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostjared%2Ftext2cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostjared%2Ftext2cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostjared%2Ftext2cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lostjared","download_url":"https://codeload.github.com/lostjared/text2cpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239859563,"owners_count":19708863,"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","cplusplus","golang","text"],"created_at":"2024-11-08T07:33:21.198Z","updated_at":"2026-02-24T02:30:19.652Z","avatar_url":"https://github.com/lostjared.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bin2cpp / text2cpp\n\nConvert Binary file to C,C++ or Go array to embed resources\n\nConvert text files/terminal output into array of C++ std::string, hex values, or const char *\n\nYou will need: autotools (autoconf, automake etc.)\nClang or GCC version that supports C++17\n\nTo compile run:\n\n\t$ ./autogen.sh\n\n\t$  ./configure\n\n\t$ make\n\n\t$ sudo make install\n\n# How to use the bin2cpp  program:\n\n\t$ bin2cpp sourcefile outputfilename language\n\nlangauge option should be c for C, cpp for C++, cpp17 for C++17, and go for Go \n\nThe Output filenames will have the source file extension be .c or .cpp, and the header file will have .h appended to it if you are using C++ you can use use memfile.hpp it will be installed to whatever prefix configure was configured for you can use this to manipulate the array similar to a\nfile. Or you could use this with SDL_RWops. The program will output the names of the array and a length variable.\n\n\n# How to use the text2cpp:\n\nSimple program that outputs header files using C++17's inline variables to use:\n\nto use const char *:\n\n\t$ text2cpp inputfile outputfile variable_name c\n\nto use std::string:\n\n\t$ text2cpp inputfile outputfile variable_name s\n\nto use a character array char arr[]\n\n\t$ text2cpp inputfile outputfile variable_name b\n\nor\n\n\t$ cat sourcefile  | text2cpp variable_name s\n\nor\n\n\t$ cat sourcefile  | text2cpp variable_name c\n\nor\n\n\t$ cat sourcefile | text2cpp variable_name b\n\noptional skip blank lines with p argument\n\n\t$ text2cpp inputfile outputfile varaiblename sp\n\nor skip lines with char array[]:\n\n\t$ cat source | text2cpp var_name bp\n\noptional sorting use g for greater than, l for less than like this\n\nfor greater than sorting use\n\n\t$ text2cpp inputfile outputfile variable_name sg\n\nor less than sorting use\n\n\t$ text2cpp inputfile outputfile variablename sl\n\nalso works with pipes\n\n\t$  cat sourcefile | text2cpp variable_name cl\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flostjared%2Ftext2cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flostjared%2Ftext2cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flostjared%2Ftext2cpp/lists"}