From a3ed04f37c47e2eaa83d87dda2ec4ab060a7a2d0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 2 Jun 2020 07:35:44 +0200 Subject: Add process_path_ex with program stable name and checksum --- libbuild2/types.hxx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'libbuild2/types.hxx') diff --git a/libbuild2/types.hxx b/libbuild2/types.hxx index 6582c3a..65e0918 100644 --- a/libbuild2/types.hxx +++ b/libbuild2/types.hxx @@ -283,6 +283,30 @@ namespace build2 using butl::process_path; using butl::process_error; + // Extended process_path with additional information. + // + // See also {import,export}.metadata. + // + struct process_path_ex: process_path + { + optional name; // Stable name for diagnostics. + optional checksum; // Checksum for change tracking. + + using process_path::process_path; + + process_path_ex (const process_path& p, string n, optional c = {}) + : process_path (p, false /* init */), + name (std::move (n)), + checksum (std::move (c)) {} + + process_path_ex (process_path&& p, string n, optional c = {}) + : process_path (std::move (p)), + name (std::move (n)), + checksum (std::move (c)) {} + + process_path_ex () = default; + }; + // // using butl::auto_fd; -- cgit v1.1