1 // Copyright 2015 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef _BSDIFF_EXTENTS_H_
6 #define _BSDIFF_EXTENTS_H_
7 
8 #include <vector>
9 
10 #include "extents_file.h"
11 
12 namespace bsdiff {
13 
14 // Parses a string representation |ex_str| and populates the vector |extents|
15 // of ex_t. The string is expected to be a comma-separated list of pairs of the
16 // form "offset:length". An offset may be -1 or a non-negative integer; the
17 // former indicates a sparse extent (consisting of zeros). A length is a
18 // positive integer. Returns whether the parsing was successful.
19 bool ParseExtentStr(const char* ex_str, std::vector<ex_t>* extents);
20 
21 }  // namespace bsdiff
22 
23 #endif  // _BSDIFF_EXTENTS_H_
24