aboutsummaryrefslogtreecommitdiff
path: root/xbmc/utils/StringUtils.cpp
diff options
context:
space:
mode:
authorLukas Rusak <lorusak@gmail.com>2021-05-17 12:31:18 -0700
committerGitHub <noreply@github.com>2021-05-17 12:31:18 -0700
commitad4fb7fa0745985280ffb3a3c154621144501804 (patch)
treeeea2feb51961abca49e3b7e4333e5ce424828103 /xbmc/utils/StringUtils.cpp
parentc3d99abeadfbdff53e18147572ee35e62e81c697 (diff)
parent1bc5466ad9f8dbd35883fe64ab689f3c0fdef0a6 (diff)
Merge pull request #19716 from lrusak/format-update-next
[maintenance] remove c_str usage from StringUtils::Format calls
Diffstat (limited to 'xbmc/utils/StringUtils.cpp')
-rw-r--r--xbmc/utils/StringUtils.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/xbmc/utils/StringUtils.cpp b/xbmc/utils/StringUtils.cpp
index 74ade1b60c..3b26e61aef 100644
--- a/xbmc/utils/StringUtils.cpp
+++ b/xbmc/utils/StringUtils.cpp
@@ -1393,13 +1393,13 @@ std::string StringUtils::SecondsToTimeString(long lSeconds, TIME_FORMAT format)
std::string strHMS;
if (format == TIME_FORMAT_SECS)
- strHMS = StringUtils::Format("{}", lSeconds);
+ strHMS = std::to_string(lSeconds);
else if (format == TIME_FORMAT_MINS)
- strHMS = StringUtils::Format("{}", lrintf(static_cast<float>(lSeconds) / 60.0f));
+ strHMS = std::to_string(lrintf(static_cast<float>(lSeconds) / 60.0f));
else if (format == TIME_FORMAT_HOURS)
- strHMS = StringUtils::Format("{}", lrintf(static_cast<float>(lSeconds) / 3600.0f));
+ strHMS = std::to_string(lrintf(static_cast<float>(lSeconds) / 3600.0f));
else if (format & TIME_FORMAT_M)
- strHMS += StringUtils::Format("{}", lSeconds % 3600 / 60);
+ strHMS += std::to_string(lSeconds % 3600 / 60);
else
{
int hh = lSeconds / 3600;
@@ -1412,7 +1412,7 @@ std::string StringUtils::SecondsToTimeString(long lSeconds, TIME_FORMAT format)
if (format & TIME_FORMAT_HH)
strHMS += StringUtils::Format("{:02}", hh);
else if (format & TIME_FORMAT_H)
- strHMS += StringUtils::Format("{}", hh);
+ strHMS += std::to_string(hh);
if (format & TIME_FORMAT_MM)
strHMS += StringUtils::Format(strHMS.empty() ? "{:02}" : ":{:02}", mm);
if (format & TIME_FORMAT_SS)
@@ -1792,7 +1792,7 @@ std::string StringUtils::FormatFileSize(uint64_t bytes)
{
const std::array<std::string, 6> units{{"B", "kB", "MB", "GB", "TB", "PB"}};
if (bytes < 1000)
- return Format("%" PRIu64 "B", bytes);
+ return Format("{}B", bytes);
size_t i = 0;
double value = static_cast<double>(bytes);