summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorLioncash <mai.iam2048@gmail.com>2023-05-16 14:26:33 -0400
committerLioncash <mai.iam2048@gmail.com>2023-05-16 14:26:33 -0400
commit1a2b48c2047c367a2bbf3ca0dc73207053fb523b (patch)
tree98944f728edd1e803d6898d167ff4d66a1e3e8c3 /Source
parent954afd81ec62deb0af09ea4721b9edacaf170d1b (diff)
StringUtil: Move ThousandSeparate() into Common namespace
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Common/StringUtil.h38
-rw-r--r--Source/Core/Core/HW/DVD/FileMonitor.cpp2
2 files changed, 20 insertions, 20 deletions
diff --git a/Source/Core/Common/StringUtil.h b/Source/Core/Common/StringUtil.h
index b18a25dd13..262af614b7 100644
--- a/Source/Core/Common/StringUtil.h
+++ b/Source/Core/Common/StringUtil.h
@@ -211,25 +211,6 @@ inline std::string UTF8ToTStr(std::string_view str)
std::filesystem::path StringToPath(std::string_view path);
std::string PathToString(const std::filesystem::path& path);
-// Thousand separator. Turns 12345678 into 12,345,678
-template <typename I>
-std::string ThousandSeparate(I value, int spaces = 0)
-{
-#ifdef _WIN32
- std::wostringstream stream;
-#else
- std::ostringstream stream;
-#endif
-
- stream << std::setw(spaces) << value;
-
-#ifdef _WIN32
- return WStringToUTF8(stream.str());
-#else
- return stream.str();
-#endif
-}
-
namespace Common
{
/// Returns whether a character is printable, i.e. whether 0x20 <= c <= 0x7e is true.
@@ -258,6 +239,25 @@ inline char ToUpper(char ch)
return std::toupper(ch, std::locale::classic());
}
+// Thousand separator. Turns 12345678 into 12,345,678
+template <typename I>
+std::string ThousandSeparate(I value, int spaces = 0)
+{
+#ifdef _WIN32
+ std::wostringstream stream;
+#else
+ std::ostringstream stream;
+#endif
+
+ stream << std::setw(spaces) << value;
+
+#ifdef _WIN32
+ return WStringToUTF8(stream.str());
+#else
+ return stream.str();
+#endif
+}
+
#ifdef _WIN32
std::vector<std::string> CommandLineToUtf8Argv(const wchar_t* command_line);
#endif
diff --git a/Source/Core/Core/HW/DVD/FileMonitor.cpp b/Source/Core/Core/HW/DVD/FileMonitor.cpp
index 6e08006a6a..f4bc53a097 100644
--- a/Source/Core/Core/HW/DVD/FileMonitor.cpp
+++ b/Source/Core/Core/HW/DVD/FileMonitor.cpp
@@ -77,7 +77,7 @@ void FileLogger::Log(const DiscIO::Volume& volume, const DiscIO::Partition& part
if (m_previous_partition == partition && m_previous_file_offset == file_offset)
return;
- const std::string size_string = ThousandSeparate(file_info->GetSize() / 1000, 7);
+ const std::string size_string = Common::ThousandSeparate(file_info->GetSize() / 1000, 7);
const std::string path = file_info->GetPath();
const std::string log_string = fmt::format("{} kB {}", size_string, path);
if (IsSoundFile(path))