diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2021-04-22 21:57:13 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2021-07-09 14:06:57 +0300 |
commit | 5d513688ae07d96910dd1eef83bdad4e9d780373 (patch) | |
tree | 402a87bbdb79a5a2392b714553e567465c3415c1 /bpkg/cfg-link.hxx | |
parent | 50a5c7b14250dab7941e8b0a67dfe6c442d2c5a9 (diff) |
Add support for linked configurations
Diffstat (limited to 'bpkg/cfg-link.hxx')
-rw-r--r-- | bpkg/cfg-link.hxx | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/bpkg/cfg-link.hxx b/bpkg/cfg-link.hxx new file mode 100644 index 0000000..116512b --- /dev/null +++ b/bpkg/cfg-link.hxx @@ -0,0 +1,40 @@ +// file : bpkg/cfg-link.hxx -*- C++ -*- +// license : MIT; see accompanying LICENSE file + +#ifndef BPKG_CFG_LINK_HXX +#define BPKG_CFG_LINK_HXX + +#include <bpkg/types.hxx> +#include <bpkg/forward.hxx> // configuration +#include <bpkg/utility.hxx> + +#include <bpkg/cfg-link-options.hxx> + +namespace bpkg +{ + int + cfg_link (const cfg_link_options&, cli::scanner& args); + + // Link the configuration specified as the directory path with the current + // configuration, attach the linked configuration database, and return the + // link. Note that it also establishes an implicit back-link of the current + // configuration with the linked one. + // + // The specified configuration path must be absolute and normalized. If the + // relative argument is true, then rebase this path relative to the current + // configuration directory path and fail if that's not possible (different + // drive on Windows, etc). + // + // If the current configuration database has its explicit links pre- + // attached, then also pre-attach explicit links of the newly linked + // database. + // + shared_ptr<configuration> + cfg_link (database&, + const dir_path&, + bool relative, + optional<string> name, + bool sys_rep = false); +} + +#endif // BPKG_CFG_LINK_HXX |