1// Copyright 2009 Google Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef OPEN_VCDIFF_FORMAT_EXTENSION_FLAGS_H_
16#define OPEN_VCDIFF_FORMAT_EXTENSION_FLAGS_H_
17
18namespace open_vcdiff {
19
20// These flags are passed to the constructor of VCDiffStreamingEncoder
21// to determine whether certain open-vcdiff format extensions
22// (which are not part of the RFC 3284 draft standard for VCDIFF)
23// are employed.
24//
25// Because these extensions are not part of the VCDIFF standard, if
26// any of these flags except VCD_STANDARD_FORMAT is specified, then the caller
27// must be certain that the receiver of the data will be using open-vcdiff
28// to decode the delta file, or at least that the receiver can interpret
29// these extensions.  The encoder will use an 'S' as the fourth character
30// in the delta file to indicate that non-standard extensions are being used.
31//
32enum VCDiffFormatExtensionFlagValues {
33  // No extensions: the encoded format will conform to the RFC
34  // draft standard for VCDIFF.
35  VCD_STANDARD_FORMAT = 0x00,
36  // If this flag is specified, then the encoder writes each delta file
37  // window by interleaving instructions and sizes with their corresponding
38  // addresses and data, rather than placing these elements
39  // into three separate sections.  This facilitates providing partially
40  // decoded results when only a portion of a delta file window is received
41  // (e.g. when HTTP over TCP is used as the transmission protocol.)
42  VCD_FORMAT_INTERLEAVED = 0x01,
43  // If this flag is specified, then an Adler32 checksum
44  // of the target window data is included in the delta window.
45  VCD_FORMAT_CHECKSUM = 0x02,
46  // If this flag is specified, the encoder will output a JSON string
47  // instead of the VCDIFF file format. If this flag is set, all other
48  // flags have no effect.
49  VCD_FORMAT_JSON = 0x04
50};
51
52typedef int VCDiffFormatExtensionFlags;
53
54}  // namespace open_vcdiff
55
56#endif  // OPEN_VCDIFF_FORMAT_EXTENSION_FLAGS_H_
57