{"id":26745556,"url":"https://github.com/nbdy/binfmt","last_synced_at":"2025-03-28T08:17:34.859Z","repository":{"id":46790021,"uuid":"398348308","full_name":"nbdy/binfmt","owner":"nbdy","description":"cpp binary file framework","archived":false,"fork":false,"pushed_at":"2023-08-28T22:49:36.000Z","size":80,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T20:01:04.269Z","etag":null,"topics":["binary","cpp","file-format","framework"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nbdy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-20T17:08:06.000Z","updated_at":"2022-08-28T04:07:33.000Z","dependencies_parsed_at":"2022-09-24T17:58:19.249Z","dependency_job_id":null,"html_url":"https://github.com/nbdy/binfmt","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbdy%2Fbinfmt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbdy%2Fbinfmt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbdy%2Fbinfmt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbdy%2Fbinfmt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nbdy","download_url":"https://codeload.github.com/nbdy/binfmt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245991561,"owners_count":20706129,"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":["binary","cpp","file-format","framework"],"created_at":"2025-03-28T08:17:34.232Z","updated_at":"2025-03-28T08:17:34.845Z","avatar_url":"https://github.com/nbdy.png","language":"C++","readme":"# binfmt\n\n[![CodeFactor](https://www.codefactor.io/repository/github/nbdy/binfmt/badge)](https://www.codefactor.io/repository/github/nbdy/binfmt)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/b485b4bdb1a546f8aac332245013bb81)](https://www.codacy.com/gh/nbdy/binfmt/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=nbdy/binfmt\u0026amp;utm_campaign=Badge_Grade)\n\u003cbr\u003e\n`A header only framework for binary file formats`\n\n## [benchmarks](doc/Benchmarks.md)\n\n### single insert (append EntryType)\n\n| Number | Time (s) |\n|--------|----------|\n| 1k     | 1.35     |\n| 10k    | 12.82    |\n| 100k   | 128.65   |\n\n### vector insert (append std::vector\u003cEntryType\u003e)\n\n| Number | Time (ms) |\n|--------|-----------|\n| 1k     | 1         |\n| 10k    | 1         |\n| 100k   | 6         |\n| 1M     | 40        |\n\n### read\n\n| Number | Time (ms) |\n|--------|----------|\n| 1k     | 0        |\n| 10k    | 0        |\n| 100k   | 0        |\n| 1M     | 8        |\n\n## Minimal example\n\n```c++\n#include \u003ciostream\u003e\n#include \u003cbinfmt.h\u003e\n\nstruct LogHeader : public BinaryFileHeaderBase {\n  LogHeader(): BinaryFileHeaderBase(1, 88448844) {}\n};\n\nstruct LogEntry {\n  char message[128];\n};\n\nusing LogEntryContainer = BinaryEntryContainer\u003cLogEntry\u003e;\nusing LogFile = BinaryFile\u003cLogHeader, LogEntry, LogEntryContainer, 1000\u003e;\n\nint main() {\n  LogFile log(\"mylog.bin\");\n\n  log.append(LogEntry{\"This is a log message\"});\n  log.append(LogEntry{\"Another message\"});\n\n  std::vector\u003cLogEntryContainer\u003e entries;\n  if (log.getAllEntries(entries)) {\n    for (auto e : entries) {\n      if(e.isEntryValid()) {\n        std::cout \u003c\u003c e.entry.message \u003c\u003c std::endl;\n      }\n    }\n  }\n\n  return 0;\n}\n```\n\n```shell\n$ /home/nbdy/CLionProjects/binfmt/cmake-build-debug/binfmt_ex_min\nThis is a log message\nAnother message\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbdy%2Fbinfmt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnbdy%2Fbinfmt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbdy%2Fbinfmt/lists"}