aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/variable.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-03-18 07:19:41 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-03-18 07:19:41 +0200
commit65be7de7aca4bdac05e0acf68ec86a351e779839 (patch)
treec0fc17cf80c8b07ccf7e51936df0a818d3ced1a4 /libbuild2/variable.cxx
parentc0f6b9b835e8ede26e407d7431d0a44aeb41dc15 (diff)
Add $visibility(<variable>) function for querying variable visibility
Diffstat (limited to 'libbuild2/variable.cxx')
-rw-r--r--libbuild2/variable.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/libbuild2/variable.cxx b/libbuild2/variable.cxx
index 0460344..7b55357 100644
--- a/libbuild2/variable.cxx
+++ b/libbuild2/variable.cxx
@@ -15,21 +15,21 @@ namespace build2
{
// variable_visibility
//
- ostream&
- operator<< (ostream& o, variable_visibility v)
+ string
+ to_string (variable_visibility v)
{
- const char* s (nullptr);
+ string r;
switch (v)
{
- case variable_visibility::normal: s = "normal"; break;
- case variable_visibility::project: s = "project"; break;
- case variable_visibility::scope: s = "scope"; break;
- case variable_visibility::target: s = "target"; break;
- case variable_visibility::prereq: s = "prerequisite"; break;
+ case variable_visibility::normal: r = "normal"; break;
+ case variable_visibility::project: r = "project"; break;
+ case variable_visibility::scope: r = "scope"; break;
+ case variable_visibility::target: r = "target"; break;
+ case variable_visibility::prereq: r = "prerequisite"; break;
}
- return o << s;
+ return r;
}
// value