Giter Site home page Giter Site logo

objective-vcdiff's Introduction

Objective-C wrapper for open-vcdiff

Open-VCDiff is a open source library from Google, which allows you to create and decode binary diffs. The library itself as well as the API are written in C++. For iPhone or Mac apps, where you typically download diffs using NSURLConnection or obtain them using other Objective-C APIs, this isn't terribly convenient.

This thin wrapper provides a pure Objective-C (not Objective-C++) interface for the decoder part. It allows you to specify the dictionary using an NSData object, the output as an NSFileHandle and feeding chunks of the diff as pure C byte buffers or NSData objects. There is also a helper for loading the dictionary from file. Internally, this memory-maps the file read-only as an NSData object. Memory mapping avoids holding the entire file in memory at once, which would be problematic on memory constrained systems, such as iOS devices.

The Pimpl idiom is used to keep any C++ out of the headers, so this is suitable to use with pure Objective-C apps. You will need to add libstdc++.dylib to your app's dependencies, however.

To use this code in an XCode project, download the Open-VCDiff source, extract it, and run ./configure (but generally not make). Add the 'src' directory, including the 'google' subdirectory but excluding 'solaris' to a new target in your project (or a sub-project), then add the source and header files from the src directory of this repository. You'll want to omit all files ending in -test.cc, as well as vcdiff_main.cc, which are needed only for the unit tests and the command line tool, respectively. You will also want to add the path to the open-vcdiff 'src' directory to the list of 'Search Headers' paths in your build target's settings. I've added an example XCode project for building as a static library on iOS to the objective-vcdiff-ios directory.

Your own code will only need to #import "VCDiffDecoder.h", none of the google stuff. About half of the open-vcdiff code is only used for encoding, so you can either remove those files manually or let the deadstripper deal with them automatically during the linking stage.

Open-VCDiff is subject to the Apache License 2.0, this wrapper is licensed under the more permissive 3-clause BSD license. (no attribution required)

objective-vcdiff's People

Contributors

pmj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

objective-vcdiff's Issues

Request for example Xcode App

Hi

I love the project, but finding it hard to integrate the project into Xcode. I'm following your detailed instructions, but unfortunately there are lots of compilation errors, typically failing to find files included with the openvc code.

Could you help?

Thanks

Peter

Build failure out of the box in Xcode 4.2

Download the source archive, open the project in Xcode and build for iOS device, it fails immediately. Error:

/Users/bgulanowski/Downloads/pmj-objective-vcdiff-b2b89fe/objective-vcdiff-ios/open-vcdiff-0.8.1/src/blockhash.cc:16:20: error: config.h: No such file or directory

I'm not good with C++, and was hoping to get some guidance from your project regarding linking and such, but I wonder if something in Xcode 4.2 is having problems or needs custom configuration.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.