From 4eda53c8c901809428f08edb591d08c94c2079a9 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 31 Aug 2021 16:45:44 -0600 Subject: [PATCH] temporal: add to_string() converters for BBT_Offset --- libs/temporal/temporal/bbt_time.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/libs/temporal/temporal/bbt_time.h b/libs/temporal/temporal/bbt_time.h index abf8613977..7a83ae2ad3 100644 --- a/libs/temporal/temporal/bbt_time.h +++ b/libs/temporal/temporal/bbt_time.h @@ -358,6 +358,23 @@ inline bool string_to (std::string const & str, Temporal::BBT_Time & val) return (bool) istr; } +template<> +inline bool to_string (Temporal::BBT_Offset val, std::string & str) +{ + std::ostringstream ostr; + ostr << val; + str = ostr.str(); + return true; +} + +template<> +inline bool string_to (std::string const & str, Temporal::BBT_Offset & val) +{ + std::istringstream istr (str); + istr >> val; + return (bool) istr; +} + } /* end namespace PBD */ #endif /* __libtemporal_bbt_time_h__ */