From 9d0d078ff297138622cd2f3f1076f5984395e42b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 19 Mar 2016 11:34:10 +0200 Subject: Add support for pair representation reversibility --- build2/name | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'build2/name') diff --git a/build2/name b/build2/name index 99c21f4..a4de95c 100644 --- a/build2/name +++ b/build2/name @@ -68,19 +68,24 @@ namespace build2 bool empty () const {return dir.empty () && value.empty ();} - // Note that strictly speaking the following tests should be - // orthogonal to qualification. However, the vast majority of - // cases where we expect a simple or directory name, we also - // expect it to be unqualified. + // Note that strictly speaking the following tests should be orthogonal + // to qualification. However, the vast majority of cases where we expect + // a simple or directory name, we also expect it to be unqualified. // // Note also that empty name is simple but not a directory. // bool - simple () const {return unqualified () && untyped () && dir.empty ();} + simple (bool ignore_qual = false) const + { + return (ignore_qual || unqualified ()) && untyped () && dir.empty (); + } bool - directory () const - {return unqualified () && untyped () && !dir.empty () && value.empty ();} + directory (bool ignore_qual = false) const + { + return (ignore_qual || unqualified ()) && + untyped () && !dir.empty () && value.empty (); + } const std::string* proj = nullptr; // Points to project_name_pool. dir_path dir; -- cgit v1.1