Mercurial > minori
diff src/core/anime.cc @ 211:7cf53145de11
strings: use templates for ToInt, std::to_string -> Strings::ToUtf8String
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sun, 07 Jan 2024 09:54:17 -0500 |
parents | 975a3f0965e2 |
children | 862d0d8619f6 |
line wrap: on
line diff
--- a/src/core/anime.cc Tue Jan 02 02:37:03 2024 -0500 +++ b/src/core/anime.cc Sun Jan 07 09:54:17 2024 -0500 @@ -5,6 +5,7 @@ #include "core/anime.h" #include "core/date.h" #include "core/session.h" +#include "core/strings.h" #include <algorithm> #include <string> @@ -50,9 +51,9 @@ switch (session.config.anime_list.score_format) { case ScoreFormat::POINT_10_DECIMAL: - return std::to_string(score / 10) + "." + std::to_string(score % 10); + return Strings::ToUtf8String(score / 10) + "." + Strings::ToUtf8String(score % 10); case ScoreFormat::POINT_10: - return std::to_string(score / 10); + return Strings::ToUtf8String(score / 10); case ScoreFormat::POINT_5: { std::string stars = ""; @@ -73,7 +74,7 @@ } default: case ScoreFormat::POINT_100: - return std::to_string(score); + return Strings::ToUtf8String(score); } } @@ -243,7 +244,7 @@ std::string Anime::GetServiceUrl() const { /* todo: add support for other services... */ - return "https://anilist.co/anime/" + std::to_string(GetId()); + return "https://anilist.co/anime/" + Strings::ToUtf8String(GetId()); } void Anime::SetId(int id) {