aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/variable.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-03-29 10:25:10 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-03-29 10:25:10 +0200
commit441c75f68ca1adfcf833ae778ac150baf16ded2f (patch)
treead7e8aa46c9e389459e0edcc2d5d7861204c5dcc /libbuild2/variable.hxx
parentf7ff90672af84a83829371f04f961b389823414c (diff)
Add variable_map::lookup_namespace(string) overload
Diffstat (limited to 'libbuild2/variable.hxx')
-rw-r--r--libbuild2/variable.hxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/libbuild2/variable.hxx b/libbuild2/variable.hxx
index 54d573b..2bfab05 100644
--- a/libbuild2/variable.hxx
+++ b/libbuild2/variable.hxx
@@ -1574,6 +1574,16 @@ namespace build2
const_iterator (r.second, *this));
}
+ pair<const_iterator, const_iterator>
+ lookup_namespace (string ns) const
+ {
+ // It's ok to use the temporary here since we compare names and don't
+ // insert anything.
+ //
+ return lookup_namespace (variable {
+ move (ns), nullptr, nullptr, nullptr, variable_visibility::project});
+ }
+
// Convert a lookup pointing to a value belonging to this variable map
// to its non-const version. Note that this is only safe on the original
// values (see lookup_original()).