aboutsummaryrefslogtreecommitdiff
path: root/build2/name
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-03-19 11:34:10 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-03-28 16:03:35 +0200
commit9d0d078ff297138622cd2f3f1076f5984395e42b (patch)
treef8b93311adc03410422b3d602ba000822394aebc /build2/name
parenteb8b0f33b5e3b8a03d9c1b5230028ba9b9e8c391 (diff)
Add support for pair representation reversibility
Diffstat (limited to 'build2/name')
-rw-r--r--build2/name19
1 files changed, 12 insertions, 7 deletions
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;