From 7cc6a852a24914253f6fa158b30fd250915c128b Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 15 May 2019 13:59:41 +0300 Subject: Make bdep-new add README.md template Can suppressed with the new no-readme --type suboption. --- bdep/new-types.hxx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'bdep/new-types.hxx') 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. } }; -- cgit v1.1