aboutsummaryrefslogtreecommitdiff
path: root/bdep/new-types.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'bdep/new-types.hxx')
-rw-r--r--bdep/new-types.hxx18
1 files changed, 12 insertions, 6 deletions
diff --git a/bdep/new-types.hxx b/bdep/new-types.hxx
index 96aaa7c..d1ef18f 100644
--- a/bdep/new-types.hxx
+++ b/bdep/new-types.hxx
@@ -59,7 +59,7 @@ namespace bdep
case type::empty: return "empty";
}
- return string (); // Should never reach.
+ return std::string (); // Should never reach.
}
friend ostream&
@@ -92,17 +92,23 @@ namespace bdep
cmd_new_lang_template (): lang (cxx) {}
const std::string
- string () const
+ string (bool lower = false) const
{
using lang = cmd_new_lang_template;
switch (*this)
{
- case lang::c: return "c";
- case lang::cxx: return "c++";
+ case lang::c: return lower ? "c" : "C";
+ case lang::cxx: return lower ? "c++" : "C++";
}
- return string (); // Should never reach.
+ return std::string (); // Should never reach.
+ }
+
+ friend ostream&
+ operator<< (ostream& os, const cmd_new_lang_template& l)
+ {
+ return os << l.string ();
}
};
@@ -139,7 +145,7 @@ namespace bdep
case vcs::none: return "none";
}
- return string (); // Should never reach.
+ return std::string (); // Should never reach.
}
};