Skip to content
Snippets Groups Projects
Commit 85920389 authored by Michael Davis's avatar Michael Davis
Browse files

[cta-admin] Displays boolean output correctly as true/false

parent 04394f90
No related branches found
No related tags found
No related merge requests found
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment