{"id":15296141,"url":"https://github.com/mapbox/protozero","last_synced_at":"2025-10-17T06:32:04.795Z","repository":{"id":15972554,"uuid":"18715366","full_name":"mapbox/protozero","owner":"mapbox","description":"Minimalist protocol buffer decoder and encoder in C++","archived":false,"fork":false,"pushed_at":"2025-01-13T09:42:57.000Z","size":2601,"stargazers_count":322,"open_issues_count":3,"forks_count":78,"subscribers_count":128,"default_branch":"master","last_synced_at":"2025-04-07T01:06:56.157Z","etag":null,"topics":["c-plus-plus","protocol-buffers"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mapbox.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.from_folly","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,"publiccode":null,"codemeta":null}},"created_at":"2014-04-12T21:39:56.000Z","updated_at":"2025-04-04T04:23:08.000Z","dependencies_parsed_at":"2024-12-06T14:01:48.192Z","dependency_job_id":"e92ebee1-269f-4d60-a34c-6accbc71b056","html_url":"https://github.com/mapbox/protozero","commit_stats":{"total_commits":739,"total_committers":13,"mean_commits":56.84615384615385,"dds":0.0987821380243572,"last_synced_commit":"542fcf7dd228672b775eb283d18ccd94c4e682d9"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2Fprotozero","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2Fprotozero/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2Fprotozero/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2Fprotozero/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mapbox","download_url":"https://codeload.github.com/mapbox/protozero/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248534736,"owners_count":21120412,"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":["c-plus-plus","protocol-buffers"],"created_at":"2024-09-30T18:09:31.934Z","updated_at":"2025-10-17T06:31:59.768Z","avatar_url":"https://github.com/mapbox.png","language":"C++","readme":"# protozero\n\nMinimalistic protocol buffer decoder and encoder in C++.\n\nDesigned for high performance. Suitable for writing zero copy parsers and\nencoders with minimal need for run-time allocation of memory.\n\nLow-level: this is designed to be a building block for writing a very\ncustomized decoder for a stable protobuf schema. If your protobuf schema is\nchanging frequently or lazy decoding is not critical for your application then\nthis approach offers no value: just use the C++ API that can be generated with\nthe Google Protobufs `protoc` program.\n\n[![Github Build Status](https://github.com/mapbox/protozero/actions/workflows/ci.yml/badge.svg)](https://github.com/mapbox/protozero/actions/workflows/ci.yml)\n[![Appveyor Build Status](https://ci.appveyor.com/api/projects/status/github/mapbox/protozero?svg=true)](https://ci.appveyor.com/project/Mapbox/protozero)\n[![Packaging status](https://repology.org/badge/tiny-repos/protozero.svg)](https://repology.org/metapackage/protozero)\n\n## Depends\n\n* C++14 compiler\n* CMake\n* Some tests depend on the Google Protobuf library, but use of Protozero\n  doesn't need it\n\n\n## How it works\n\nThe protozero code does **not** read `.proto` files used by the usual Protobuf\nimplementations. The developer using protozero has to manually \"translate\" the\n`.proto` description into code. This means there is no way to access any of the\ninformation from the `.proto` description. This results in a few restrictions:\n\n* The names of the fields are not available.\n* Enum names are not available, you'll have to use the values they are defined\n  with.\n* Default values are not available.\n* Field types have to be hardcoded. The library does not know which types to\n  expect, so the user of the library has to supply the right types. Some checks\n  are made using `assert()`, but mostly the user has to take care of that.\n\nThe library will make sure not to overrun the buffer it was given, but\nbasically all other checks have to be made in user code!\n\n\n## Documentation\n\nYou have to have a working knowledge of how\n[protocol buffer encoding works](https://developers.google.com/protocol-buffers/docs/encoding).\n\n* Read the [tutorial](doc/tutorial.md) for an introduction on how to use\n  Protozero.\n* Some advanced topics are described in an [extra document](doc/advanced.md).\n* There is a table of all types and functions in the\n  [cheat sheet](doc/cheatsheet.md).\n* Read the [upgrading instructions](UPGRADING.md) if you are upgrading from\n  an older version of Protozero.\n\nThe build process will also build the Doxygen-based reference documentation if\nyou have Doxygen installed. Then open `doc/html/index.html` in your browser to\nread it.\n\n\n## Endianness\n\nProtozero uses a very simplistic test to check the byte order of the system it\ncompiles on. If this check is wrong, you'll get test failures. If this is the\ncase, please [open an issue](https://github.com/mapbox/protozero/issues) and\ntell us about your system.\n\n\n## Building tests\n\nExtensive tests are included. Build them using CMake:\n\n    mkdir build\n    cd build\n    cmake ..\n    make\n\nCall `ctest` to run the tests.\n\nThe unit and reader tests are always build, the writer tests are only build if\nthe Google Protobuf library is found when running CMake.\n\nSee `test/README.md` for more details about the test.\n\n\n## Coverage report\n\nTo get a coverage report set `CXXFLAGS` and `LDFLAGS` before calling CMake:\n\n    CXXFLAGS=\"--coverage\" LDFLAGS=\"--coverage\" cmake ..\n\nThen call `make` as usual and run the tests using `ctest`.\n\nIf you are using `g++` use `gcov` to generate a report (results are in `*.gcov`\nfiles):\n\n    gcov -lp $(find test/ -name '*.o')\n\nIf you are using `clang++` use `llvm-cov` instead:\n\n    llvm-cov gcov -lp $(find test/ -name '*.o')\n\nIf you are using `g++` you can use `gcovr` to generate nice HTML output:\n\n    mkdir -p coverage\n    gcovr . -r SRCDIR --html --html-details -o coverage/index.html\n\nOpen `coverage/index.html` in your browser to see the report.\n\n\n## Clang-tidy\n\nAfter the CMake step, run\n\n    make clang-tidy\n\nto check the code with [clang-tidy](https://clang.llvm.org/extra/clang-tidy/).\nYou might have to set `CLANG_TIDY` in CMake config.\n\n\n## Cppcheck\n\nFor extra checks with [Cppcheck](https://cppcheck.sourceforge.io/) you can,\nafter the CMake step, call\n\n    make cppcheck\n\n\n## Installation\n\nAfter the CMake step, call `make install` to install the include files in\n`/usr/local/include/protozero`.\n\nIf you are using CMake to build your own software, you can copy the file\n`cmake/FindProtozero.cmake` and use it in your build. See the file for\ndetails.\n\n\n## Who is using Protozero?\n\n* [Carmen](https://github.com/mapbox/carmen-cache)\n* [Libosmium](https://github.com/osmcode/libosmium)\n* [Mapbox GL Native](https://github.com/mapbox/mapbox-gl-native)\n* [Mapbox Vector Tile library](https://github.com/mapbox/vector-tile)\n* [Mapnik](https://github.com/mapbox/mapnik-vector-tile)\n* [OSRM](https://github.com/Project-OSRM/osrm-backend)\n* [Tippecanoe](https://github.com/mapbox/tippecanoe)\n* [Vtzero](https://github.com/mapbox/vtzero)\n\nAre you using Protozero? Tell us! Send a pull request with changes to this\nREADME.\n\n\n","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapbox%2Fprotozero","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmapbox%2Fprotozero","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapbox%2Fprotozero/lists"}