diff --git a/cmdline/CtaAdminTextFormatter.hpp b/cmdline/CtaAdminTextFormatter.hpp index d7388fa34cb5133fc923a617155c26d0b681e18c..58284cf42c601054573088a3dbe3bafab6472091 100644 --- a/cmdline/CtaAdminTextFormatter.hpp +++ b/cmdline/CtaAdminTextFormatter.hpp @@ -86,20 +86,30 @@ private: buildVector(line, args...); } - //! Base case method to add one item to the log, with specialisations by type - template<typename T> - void buildVector(std::vector<std::string> &line, const T &item) { - line.push_back(std::to_string(item)); - } - + //! Base case method to add one item to the log void buildVector(std::vector<std::string> &line, const std::string &item) { line.push_back(item); } + //! Base case method to add one item to the log, overloaded for char* void buildVector(std::vector<std::string> &line, const char *item) { line.push_back(std::string(item)); } + //! Base case method to add one item to the log, overloaded for bool + void buildVector(std::vector<std::string> &line, bool item) { + line.push_back(item ? "true" : "false"); + } + + /*! + * Base case method to add one item to the log, with partial specialisation + * (works for all integer and floating-point types) + */ + template<typename T> + void buildVector(std::vector<std::string> &line, const T &item) { + line.push_back(std::to_string(item)); + } + //! Flush buffer to stdout void flush();