summaryrefslogtreecommitdiff
path: root/src/buildtool/common/artifact_blob.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildtool/common/artifact_blob.hpp')
-rw-r--r--src/buildtool/common/artifact_blob.hpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/buildtool/common/artifact_blob.hpp b/src/buildtool/common/artifact_blob.hpp
index 800b78c1..c5a03cf9 100644
--- a/src/buildtool/common/artifact_blob.hpp
+++ b/src/buildtool/common/artifact_blob.hpp
@@ -20,6 +20,7 @@
#include <memory>
#include <string>
#include <utility>
+#include <variant>
#include "src/buildtool/common/artifact_digest.hpp"
#include "src/buildtool/crypto/hash_function.hpp"
@@ -79,12 +80,15 @@ class ArtifactBlob final {
}
private:
+ using InMemory = std::shared_ptr<std::string const>;
+ using ContentSource = std::variant<InMemory>;
+
ArtifactDigest digest_;
- std::shared_ptr<std::string const> content_;
+ ContentSource content_;
bool is_executable_;
explicit ArtifactBlob(ArtifactDigest digest,
- std::shared_ptr<std::string const> content,
+ ContentSource content,
bool is_executable) noexcept
: digest_{std::move(digest)},
content_{std::move(content)},