aboutsummaryrefslogtreecommitdiff
path: root/bpkg/archive
blob: 918734c7c751fe27e6421b8a42d53199b3f42e71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// file      : bpkg/archive -*- C++ -*-
// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
// license   : MIT; see accompanying LICENSE file

#ifndef BPKG_ARCHIVE
#define BPKG_ARCHIVE

#include <butl/process>

#include <bpkg/types>
#include <bpkg/utility>

#include <bpkg/common-options>

namespace bpkg
{
  // Return the package directory based on the package archive.
  //
  dir_path
  package_dir (const path& archive);

  // Start the process of extracting the specified file from the archive. If
  // error is false, then redirect STDERR to STDOUT (this can be used, for
  // example, to suppress diagnostics).
  //
  butl::process
  start_extract (const common_options&,
                 const path& archive,
                 const path& file,
                 bool error = true);

  // Start as above and then extract the file content as a string.
  //
  string
  extract (const common_options&, const path& archive, const path& file);
}

#endif // BPKG_ARCHIVE