GithubHelp home page GithubHelp logo

isabella232 / open-vcdiff Goto Github PK

View Code? Open in Web Editor NEW

This project forked from google/open-vcdiff

0.0 0.0 0.0 1.89 MB

An encoder/decoder for the VCDIFF (RFC3284) format

License: Apache License 2.0

Shell 2.56% C++ 85.42% C 8.81% Makefile 0.33% CMake 0.90% Batchfile 1.67% Roff 0.31%

open-vcdiff's Introduction

open-vcdiff README

open-vcdiff is an encoder and decoder for the VCDIFF format, as described in RFC 3284: The VCDIFF Generic Differencing and Compression Data Format.

You will need to first synchronize gflags and gtest by running git submodule update --init --recursive. Or if you have system installed gflags and/or gtest libraries you can provide -Dvcdiff_use_system_gflags=ON and -Dvcdiff_use_system_gtest=ON for cmake invokation in the build step.

A library with a simple API is included, as well as a command-line executable that can apply the encoder and decoder to source, target, and delta files. For further details, please refer to this link.

open-vcdiff comes with a CMake build script ( CMakeLists.txt) that can be used on a wide range of platforms ("C" stands for cross-platform.). If you don't have CMake installed already, you can download it for free from http://www.cmake.org/.

CMake works by generating native makefiles or build projects that can be used in the compiler environment of your choice. The typical workflow starts with:

mkdir mybuild       # Create a directory to hold the build output.
cd mybuild
cmake ${OPEN_VCDIFF_DIR}  # Generate native build scripts.

If you want to disable build of build tests and/or executable and build libraries only replace last command with

cmake -Dvcdiff_build_test=OFF -Dvcdiff_build_exec=OFF ${OPEN_VCDIFF_DIR}

If you are on a *nix system, you should now see a Makefile in the current directory. Just type 'make' to build gtest.

If you use Windows and have Visual Studio installed, a gtest.sln file and several .vcproj files will be created. You can then build them using Visual Studio.

On Mac OS X with Xcode installed, a .xcodeproj file will be generated.

After compilation you should have the unit tests as well as vcdiff, a simple command-line utility to run the encoder and decoder. Typical usage of vcdiff is as follows (the < and > are file redirect operations, not optional arguments):

vcdiff encode -dictionary file.dict < target_file > delta_file
vcdiff decode -dictionary file.dict < delta_file  > target_file

To see the command-line syntax of vcdiff, use vcdiff --help or just vcdiff.

To run tests just use make test inside build directory.

To call the encoder from C++ code, assuming that dictionary, target, and delta are all std::string objects:

#include <google/vcencoder.h>  // Read this file for interface details

// [...]

open_vcdiff::VCDiffEncoder encoder(dictionary.data(), dictionary.size());
encoder.SetFormatFlags(open_vcdiff::VCD_FORMAT_INTERLEAVED);
encoder.Encode(target.data(), target.size(), &delta);

Calling the decoder is just as simple:

#include <google/vcdecoder.h>  // Read this file for interface details

// [...]

open_vcdiff::VCDiffDecoder decoder;
decoder.Decode(dictionary.data(), dictionary.size(), delta, &target);

When using the encoder, the C++ application must be linked with the library options -lvcdcom and -lvcdenc; when using the decoder, it must be linked with -lvcdcom and -lvcddec.

To verify that the package works on your system, especially after making modifications to the source code, please run the unit tests using make check.

For further details, please refer to this link.

open-vcdiff's People

Contributors

bacek avatar nico avatar openvcdiff avatar peters avatar steelskin avatar

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.