diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2017-05-01 13:50:13 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2017-05-01 15:02:14 +0300 |
commit | 2319d01e262b705716e19474865f555f3ca81a7d (patch) | |
tree | 15ffb5b3f998a2cc0def729d2f1f76f578d8d139 /bpkg/archive.hxx | |
parent | 5fb0df6f63e02c141e8a0e5ad4543dea525df3fc (diff) |
Add hxx extension for headers and lib prefix for library dirs
Diffstat (limited to 'bpkg/archive.hxx')
-rw-r--r-- | bpkg/archive.hxx | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/bpkg/archive.hxx b/bpkg/archive.hxx new file mode 100644 index 0000000..44f7a7b --- /dev/null +++ b/bpkg/archive.hxx @@ -0,0 +1,40 @@ +// file : bpkg/archive.hxx -*- C++ -*- +// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +#ifndef BPKG_ARCHIVE_HXX +#define BPKG_ARCHIVE_HXX + +#include <butl/process> + +#include <bpkg/types.hxx> +#include <bpkg/utility.hxx> + +#include <bpkg/common-options.hxx> + +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 /dev/null (this can be used, for + // example, to suppress diagnostics). + // + // Return a pair of processes that form a pipe. Wait on the second first. + // + pair<butl::process, 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_HXX |