{"id":19492856,"url":"https://github.com/oatpp/oatpp-bob","last_synced_at":"2026-02-04T02:04:54.132Z","repository":{"id":98397910,"uuid":"590673360","full_name":"oatpp/oatpp-bob","owner":"oatpp","description":"Object-Mapper for binary serialization/deserialization","archived":false,"fork":false,"pushed_at":"2024-05-30T11:09:24.000Z","size":47,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-29T22:48:56.314Z","etag":null,"topics":["binary-json","bob","oatpp","object-mapper"],"latest_commit_sha":null,"homepage":"https://oatpp.io/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oatpp.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,"publiccode":null,"codemeta":null}},"created_at":"2023-01-18T23:49:00.000Z","updated_at":"2024-05-30T11:09:27.000Z","dependencies_parsed_at":"2024-11-07T00:22:07.986Z","dependency_job_id":"c3e2eba9-bef3-4f57-9528-5387850d8751","html_url":"https://github.com/oatpp/oatpp-bob","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"d0d9f540746350a3d9dbe4c6800b9e360f30f9c6"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Foatpp-bob","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Foatpp-bob/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Foatpp-bob/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oatpp%2Foatpp-bob/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oatpp","download_url":"https://codeload.github.com/oatpp/oatpp-bob/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245415138,"owners_count":20611493,"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-json","bob","oatpp","object-mapper"],"created_at":"2024-11-10T21:23:21.443Z","updated_at":"2026-02-04T02:04:54.083Z","avatar_url":"https://github.com/oatpp.png","language":"C++","readme":"# oatpp-bob [![Build Status](https://dev.azure.com/lganzzzo/lganzzzo/_apis/build/status/oatpp.oatpp-bob?branchName=main)](https://dev.azure.com/lganzzzo/lganzzzo/_build/latest?definitionId=33\u0026branchName=main)\n\n*(oatpp-BinaryOBject - BOB)*  \nObject-Mapper for binary serialization/deserialization.\n\n## BOB Format\n\nBOB is basically a regular JSON in which values are written in binary format.\nIt supports JSON data types only - [`object`, `array`, `string`, `number`(ints and floats), `true`, `false`, `null`].\nThus, JSON and oatpp-BOB are 100% interchangeable.\n\n### Format Structure\n\nBOB uses big-endian format (network byte order) to store binary values.\n\n| type      | description                                | format                    |\n|-----------|--------------------------------------------|---------------------------|\n| `int1`    | 1 - byte signed integer                    | `'1'\u003c1-byte value\u003e`       |\n| `int2`    | 2 - byte signed integer                    | `'2'\u003c2-byte value\u003e`       |\n| `int4`    | 4 - byte signed integer                    | `'4'\u003c4-byte value\u003e`       |\n| `int8`    | 8 - byte signed integer                    | `'8'\u003c8-byte value\u003e`       |                      \n| `uint1`   | 1 - byte unsigned integer                  | `'b'\u003c1-byte value\u003e`       |\n| `uint2`   | 2 - byte unsigned integer                  | `'i'\u003c2-byte value\u003e`       |\n| `uint4`   | 4 - byte unsigned integer                  | `'I'\u003c4-byte value\u003e`       |\n| `uint8`   | 8 - byte unsigned integer                  | `'L'\u003c8-byte value\u003e`       |\n| `float4`  | 4 - byte float                             | `'f'\u003c4-byte value\u003e`       |\n| `float8`  | 8 - byte float                             | `'d'\u003c8-byte value\u003e`       |\n| `true`    | boolean true                               | `'+'`                     |\n| `false`   | boolean false                              | `'-'`                     |\n| `null`    | null value                                 | `'0'`                     |\n| `string1` | string with max length of `2^8 - 1` chars  | `'s'\u003c1-byte size\u003e\u003cdata\u003e`  |\n| `string2` | string with max length of `2^16 - 1` chars | `'S'\u003c2-byte size\u003e\u003cdata\u003e`  |\n| `string4` | string with max length of `2^32 - 1` chars | `'$'\u003c4-byte size\u003e\u003cdata\u003e`  |\n| `object`  | sequence of key-value pairs                | `'{'\u003ckey-value pairs\u003e')'` |\n| `array`   | sequence of values                         | `'['\u003cvalues\u003e')'`          |\n\n- **Note**: `\u003ckey-value\u003e` pairs in object are stored without any delimiters.\nEach key is encoded as a null-terminated string.\n- **Note**: `\u003cvalues\u003e` in array are stored without any delimiters. Each value begins with the type-designating byte (char).\n\n\nExample - JSONs and their equivalent BOBs\n\n```\njson = '{\"key\":\"value\"}'; // size: 15 bytes\nbob  = \"{key\\0s\\7value)\"; // size: 13 bytes \n```\n\n```\njson = '{\"key1\":\"value1\",\"key2\":5}'; // size: 26 bytes \nbob  = \"{key1\\0s\\6value1key2\\0b\\5)\"; // size: 22 bytes \n```\n\nExamples in C++\n\n```cpp\noatpp::String bob(\"{key\\0s\\5value)\", 13); // \u003c- You have to provide length explicitly because of the '\\0' char in the middle of string\nauto obj = bobMapper.readFromString\u003coatpp::Any\u003e(bob);\nauto json = jsonMapper.writeToString(obj);\nOATPP_LOGD(TAG, \"json='%s'\", json-\u003ec_str()) // \u003c- json='{\"key\":\"value\"}'\n```\n\n```cpp\noatpp::String bob(\"{key1\\0s\\6value1key2\\0b\\5)\", 22); // \u003c- You have to provide length explicitly because of the '\\0' char in the middle of string\nauto obj = bobMapper.readFromString\u003coatpp::Any\u003e(bob);\nauto json = jsonMapper.writeToString(obj);\nOATPP_LOGD(TAG, \"json='%s'\", json-\u003ec_str()) // \u003c- json='{\"key1\":\"value1\",\"key2\":5}'\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foatpp%2Foatpp-bob","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foatpp%2Foatpp-bob","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foatpp%2Foatpp-bob/lists"}