From ca153669363d616c64c5c15728378bdd21092466 Mon Sep 17 00:00:00 2001 From: Paul Shapiro Date: Fri, 25 Jan 2019 12:59:08 -0600 Subject: [PATCH] added bool->str to serial_bridge_utils - this can probably be improved with a fn using a generic type --- src/serial_bridge_utils.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/serial_bridge_utils.hpp b/src/serial_bridge_utils.hpp index acd4c2f..ca1d293 100644 --- a/src/serial_bridge_utils.hpp +++ b/src/serial_bridge_utils.hpp @@ -53,7 +53,7 @@ namespace serial_bridge_utils string string_from_nettype(network_type nettype); // struct RetVals_Transforms - { + { // TODO: can these be generalized with generics? static string str_from(uint64_t v) { std::ostringstream o; @@ -66,6 +66,12 @@ namespace serial_bridge_utils o << v; return o.str(); } + static string str_from(bool v) + { + std::ostringstream o; + o << v; + return o.str(); + } }; string ret_json_from_root(const boost::property_tree::ptree &root); string error_ret_json_from_message(const string &err_msg);