From 987b9b881b93115ead849c087c0dc2e3f1532b1e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 3 Jun 2020 09:45:57 +0200 Subject: Add name::file() predicate --- libbuild2/name.hxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libbuild2/name.hxx') 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; }; -- cgit v1.1