aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-06-03 09:45:57 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-06-03 09:45:57 +0200
commit987b9b881b93115ead849c087c0dc2e3f1532b1e (patch)
tree00d979e39a97ee623886ec60a85a4990c8ec0f9c
parent2650fe1faaee8202cb7361f2e8cf0c790c3fd946 (diff)
Add name::file() predicate
-rw-r--r--libbuild2/name.hxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/libbuild2/name.hxx b/libbuild2/name.hxx
index 39d2396..8756cb7 100644
--- a/libbuild2/name.hxx
+++ b/libbuild2/name.hxx
@@ -93,6 +93,14 @@ namespace build2
untyped () && !dir.empty () && value.empty ();
}
+ // File path-like (only optional directory and non-empty value).
+ //
+ bool
+ file (bool ignore_qual = false) const
+ {
+ return (ignore_qual || unqualified ()) && untyped () && !value.empty ();
+ }
+
int
compare (const name&) const;
};