diff --git a/platform/settings.cpp b/platform/settings.cpp index d3542fe283..38334e36e5 100644 --- a/platform/settings.cpp +++ b/platform/settings.cpp @@ -199,6 +199,44 @@ namespace Settings else return false; } + template <> string ToString(int const & v) + { + ostringstream stream; + stream << v; + return stream.str(); + } + + template <> bool FromString(string const & str, int & v) + { + istringstream stream(str); + if (stream.good()) + { + stream >> v; + return !stream.fail(); + } + else + return false; + } + + template <> string ToString(unsigned const & v) + { + ostringstream stream; + stream << v; + return stream.str(); + } + + template <> bool FromString(string const & str, unsigned & v) + { + istringstream stream(str); + if (stream.good()) + { + stream >> v; + return !stream.fail(); + } + else + return false; + } + namespace impl { template string ToStringPair(TPair const & value)