summaryrefslogtreecommitdiff
path: root/src/other_tools/just_mr/utils.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/other_tools/just_mr/utils.hpp')
-rw-r--r--src/other_tools/just_mr/utils.hpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/other_tools/just_mr/utils.hpp b/src/other_tools/just_mr/utils.hpp
index 67878445..92d679e2 100644
--- a/src/other_tools/just_mr/utils.hpp
+++ b/src/other_tools/just_mr/utils.hpp
@@ -102,6 +102,12 @@ std::unordered_map<std::string, PragmaSpecial> const kPragmaSpecialMap = {
{"resolve-partially", PragmaSpecial::ResolvePartially},
{"resolve-completely", PragmaSpecial::ResolveCompletely}};
+/// \brief Pragma "special" value inverse map, from enum to string
+std::unordered_map<PragmaSpecial, std::string> const kPragmaSpecialInverseMap =
+ {{PragmaSpecial::Ignore, "ignore"},
+ {PragmaSpecial::ResolvePartially, "resolve-partially"},
+ {PragmaSpecial::ResolveCompletely, "resolve-completely"}};
+
namespace JustMR {
struct Paths {
@@ -169,6 +175,11 @@ namespace Utils {
[[nodiscard]] auto GetDistdirTreeIDFile(std::string const& content) noexcept
-> std::filesystem::path;
+/// \brief Get the path to the file storing a resolved tree hash.
+[[nodiscard]] auto GetResolvedTreeIDFile(
+ std::string const& tree_hash,
+ PragmaSpecial const& pragma_special) noexcept -> std::filesystem::path;
+
/// \brief Write a tree id to file. The parent folder of the file must exist!
[[nodiscard]] auto WriteTreeIDFile(std::filesystem::path const& tree_id_file,
std::string const& tree_id) noexcept -> bool;