temporal: add to_string() converters for BBT_Offset

This commit is contained in:
Paul Davis 2021-08-31 16:45:44 -06:00
parent bca2f306ea
commit 4eda53c8c9

View file

@ -358,6 +358,23 @@ inline bool string_to (std::string const & str, Temporal::BBT_Time & val)
return (bool) istr; 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 */ } /* end namespace PBD */
#endif /* __libtemporal_bbt_time_h__ */ #endif /* __libtemporal_bbt_time_h__ */