From 095cffecbd6c34105468c42414cef445dc1c0998 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 10 Jun 2021 21:43:56 +0300 Subject: Add path::try_relative() --- libbutl/path.mxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libbutl/path.mxx') diff --git a/libbutl/path.mxx b/libbutl/path.mxx index 12479ce..5a41ddc 100644 --- a/libbutl/path.mxx +++ b/libbutl/path.mxx @@ -952,6 +952,12 @@ LIBBUTL_MODEXPORT namespace butl basic_path relative (basic_path) const; + // As above but return nullopt rather than throw if a relative path cannot + // be derived. + // + optional + try_relative (basic_path) const; + // Iteration over path components. // // Note that for an absolute POSIX path the first component is empty, -- cgit v1.1