diff --git a/SilKit/source/util/StringHelpers.cpp b/SilKit/source/util/StringHelpers.cpp index fc409199d..08fe20a41 100644 --- a/SilKit/source/util/StringHelpers.cpp +++ b/SilKit/source/util/StringHelpers.cpp @@ -96,14 +96,6 @@ auto CurrentTimestampString() -> std::string return fmt::format("{:%FT%H-%M-%S}", tm); } -auto LowerCase(std::string input) -> std::string -{ - // Note: std::tolower has undefined behavior if the argument is not representable as unsigned char. - std::transform(input.begin(), input.end(), input.begin(), - [](unsigned char c) { return static_cast(std::tolower(static_cast(static_cast(c)))); }); - return input; -} - auto PrintableString(const std::string& participantName) -> std::string { std::string safeName; diff --git a/SilKit/source/util/StringHelpers.hpp b/SilKit/source/util/StringHelpers.hpp index d75770a6d..549df682d 100644 --- a/SilKit/source/util/StringHelpers.hpp +++ b/SilKit/source/util/StringHelpers.hpp @@ -4,10 +4,13 @@ #pragma once +#include #include #include #include +#include + namespace SilKit { namespace Util { @@ -32,3 +35,19 @@ auto SplitString(std::string_view input, const std::string_view& separator) -> s } // namespace Util } // namespace SilKit + + +namespace SilKit { +namespace Util { + +inline auto LowerCase(std::string input) -> std::string +{ + // Note: std::tolower has undefined behavior if the argument is not representable as unsigned char. + std::transform(input.begin(), input.end(), input.begin(), [](unsigned char c) { + return static_cast(std::tolower(static_cast(static_cast(c)))); + }); + return input; +} + +} // namespace Util +} // namespace SilKit