aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd/installable-value.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcmd/installable-value.hh')
-rw-r--r--src/libcmd/installable-value.hh18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libcmd/installable-value.hh b/src/libcmd/installable-value.hh
index 5ab7eee16..3138ce8ec 100644
--- a/src/libcmd/installable-value.hh
+++ b/src/libcmd/installable-value.hh
@@ -98,6 +98,24 @@ struct InstallableValue : Installable
static InstallableValue & require(Installable & installable);
static ref<InstallableValue> require(ref<Installable> installable);
+
+protected:
+
+ /**
+ * Handles either a plain path, or a string with a single string
+ * context elem in the right format. The latter case is handled by
+ * `EvalState::coerceToDerivedPath()`; see it for details.
+ *
+ * @param v Value that is hopefully a string or path per the above.
+ *
+ * @param pos Position of value to aid with diagnostics.
+ *
+ * @param errorCtx Arbitrary message for use in potential error message when something is wrong with `v`.
+ *
+ * @result A derived path (with empty info, for now) if the value
+ * matched the above criteria.
+ */
+ std::optional<DerivedPathWithInfo> trySinglePathToDerivedPaths(Value & v, const PosIdx pos, std::string_view errorCtx);
};
}