monotone

monotone Mtn Source Tree

Root/xdelta.hh

1#ifndef __XDELTA_HH__
2#define __XDELTA_HH__
3
4// copyright (C) 2002, 2003 graydon hoare <graydon@pobox.com>
5// all rights reserved.
6// licensed to the public under the terms of the GNU GPL (>= 2)
7// see the file COPYING for details
8
9#include <string>
10#include <boost/shared_ptr.hpp>
11
12#include "manifest.hh"
13
14void
15compute_delta(std::string const & a,
16 std::string const & b,
17 std::string & delta);
18
19void
20compute_delta(manifest_map const & a,
21 manifest_map const & b,
22 std::string & delta);
23
24void
25apply_delta(std::string const & a,
26 std::string const & delta,
27 std::string & b);
28
29
30struct delta_applicator
31{
32 virtual ~delta_applicator () {}
33 virtual void begin(std::string const & base) = 0;
34 virtual void next() = 0;
35 virtual void finish(std::string & out) = 0;
36
37 virtual void copy(std::string::size_type pos, std::string::size_type len) = 0;
38 virtual void insert(std::string const & str) = 0;
39};
40
41boost::shared_ptr<delta_applicator> new_simple_applicator();
42boost::shared_ptr<delta_applicator> new_piecewise_applicator();
43
44void apply_delta(boost::shared_ptr<delta_applicator> da,
45 std::string const & delta);
46
47u64 measure_delta_target_size(std::string const & delta);
48
49#endif // __XDELTA_HH__

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status