diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2019-05-15 13:59:41 +0300 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-05-16 15:36:35 +0200 |
commit | 7cc6a852a24914253f6fa158b30fd250915c128b (patch) | |
tree | efd867fd1bd03ef67ab912ad6a58eef408dc971d /bdep/new-types.hxx | |
parent | 15beec8cf83c7d479c50f7bfbc9e05e1803686cc (diff) |
Make bdep-new add README.md template
Can suppressed with the new no-readme --type suboption.
Diffstat (limited to 'bdep/new-types.hxx')
-rw-r--r-- | bdep/new-types.hxx | 18 |
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. } }; |