{"id":13419418,"url":"https://github.com/mingchen/protobuf-ios","last_synced_at":"2025-03-15T05:31:17.987Z","repository":{"id":4353224,"uuid":"5489357","full_name":"mingchen/protobuf-ios","owner":"mingchen","description":"[Deprecated] An Objective-C implementation of Google proto buffer for iOS","archived":true,"fork":false,"pushed_at":"2019-01-18T19:07:31.000Z","size":2030,"stargazers_count":161,"open_issues_count":0,"forks_count":41,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-04-24T13:17:23.453Z","etag":null,"topics":[],"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/mingchen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-08-21T02:17:53.000Z","updated_at":"2023-09-29T18:07:40.000Z","dependencies_parsed_at":"2022-09-13T23:03:09.904Z","dependency_job_id":null,"html_url":"https://github.com/mingchen/protobuf-ios","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mingchen%2Fprotobuf-ios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mingchen%2Fprotobuf-ios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mingchen%2Fprotobuf-ios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mingchen%2Fprotobuf-ios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mingchen","download_url":"https://codeload.github.com/mingchen/protobuf-ios/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221541872,"owners_count":16840114,"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":[],"created_at":"2024-07-30T22:01:15.725Z","updated_at":"2024-10-26T14:31:49.311Z","avatar_url":"https://github.com/mingchen.png","language":"C++","funding_links":[],"categories":["TODO scan for Android support in followings"],"sub_categories":[],"readme":"# protobuf-ios\n\n## Introduction\n\n[![travis-ci build status](https://travis-ci.org/mingchen/protobuf-ios.svg?branch=master)](https://travis-ci.org/mingchen/protobuf-ios)\n\nAn **Objective-C** implementation of Google **proto buffer** for **iOS**. \nThe orignal code comes from [Booyah Inc](https://github.com/booyah/protobuf-objc). This implemenation add features to support write to / parse from delimited stream. This git repo also support [cocoapods](http://cocoapods.org).\n\n## Supported Platform\n\n* iOS 4.0 and above\n* Xcode 4 and above\n\n\n## Features\n\n- Support write to / parse from delimited stream (protobuf 2.3 feature).\n\n## Examples\n\n### Simple Usage\n\nYou write a `foo.proto` file like this:\n\n    message Person {\n        required int32 id = 1;\n        required string name = 2;\n        optional string email = 3;\n    }\n    \nThen you compile it with `protoc` to produce code in Objective-C (see below).\n\nSerialize to protobuf format:\n\n    Person* person = [[[[[Person builder] setId:123]\n                                        setName:@\"Bob\"]\n                                       setEmail:@\"bob@example.com\"] build];\n    NSData* data = [person data];\n    \nUnserialize from protobuf format data:\n\n    NSData* raw_data = ...;\n    Person* person = [Person parseFromData:raw_data];\n\n### Delimited encode\n\nSometime is very useful to write multiple protobuf objects into a single file.\nThis need use delimited format. Here is an example:\n    \n    // serialize\n    NSOutputStream *ouputStream = [NSOutputStream outputStreamToFileAtPath:@\"filename.dat\" append:YES];\n    [ouputStream open];\n    for (int i=0; i\u003ccount; i++) {\n        // create a new Person object and assign value.\n        Person* person = ...;\n        \n        // write to stream use delimited format\n        [person writeDelimitedToOutputStream:outputStream];\n    }\n    \n    // unserialize\n    NSInputStream* inputStream = ...;\n    while(true) {\n        // read object one by one from stream.\n        Person* person = [Person parseDelimitedFromInputStream:inputStream];\n        if (!person) {\n            break;\n        }\n        \n        ....\n        ....\n    }\n    \n## Xcode integration\n\n### Integrate with CocoaPods\n\nIf your project support [cocoapods](http://cocoapods.org), add a line to your **Podfile**:\n\n    pod 'protobuf-ios'\n\nThen update your dependences:\n\n    pod update\n\n\n### Integrate with source code\n\nDrag `protoc-ios.xcodeproj` to your Xcode project.\n\nThat's all.\n\n### Compiler setting\n\nSince the generated code is non-ARC, if your project use ARC by default,\nyou need add `-fno-objc-arc` to generated files.\n\nIn Xcode, select the main project/targets/build phases/compile sources,\nselect the m files/double click under compiler flag/add `-fno-objc-arc` to the popped window.\n\n\n## How to use\n\n### Get the compiler\n\nRun following command to compile and install the project.\n\n    $ cd compiler\n    $ ./autogen.sh\n    $ ./configure\n    $ make\n    $ make install (optional)\n\nThe compiler is genrated at `src/protoc`.\n\n*Note:*\n\nYou need `autoconf` to compile from source code. If your system is not install autoconf, you can install it by brew:\n\n    $ brew install autoconf\n\nIf you system already install autoconf but linked, you can link it, here is an example:\n\n    $ brew install autoconf\n    Warning: autoconf-2.69 already installed, it's just not linked    \n    $ brew link autoconf\n    Linking /usr/local/Cellar/autoconf/2.69... 28 symlinks created\n\n### Usage\n\nTo compile the **proto** definition to **Objective-C**, use following command:\n\n    ./src/protoc --objc_out=. foo.proto\n\n\n## Contribution\n\nContributions are welcome!\n\nIf you would like to contribute this project,\nplease feel free to [fork](https://github.com/mingchen/protobuf-ios/fork) and send **pull** request.\n\n\n# Credits\n\n- [Booyah Inc](https://github.com/booyah/protobuf-objc)\n- [Cyrus Najmabadi](http://code.google.com/p/metasyntactic/wiki/ProtocolBuffers)\n\n\n# References\n\n- https://developers.google.com/protocol-buffers/\n- https://developers.google.com/protocol-buffers/docs/encoding\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmingchen%2Fprotobuf-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmingchen%2Fprotobuf-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmingchen%2Fprotobuf-ios/lists"}