From cfa9b163fd621b7657ce9dee94c5dc9d22010311 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Fri, 4 May 2018 23:49:35 +0300 Subject: [PATCH] Implement fmt::to_lower It was strangely removed... --- Utilities/StrFmt.cpp | 8 ++++++++ Utilities/StrUtil.h | 1 + 2 files changed, 9 insertions(+) diff --git a/Utilities/StrFmt.cpp b/Utilities/StrFmt.cpp index 1ac892085e..724c8b494d 100644 --- a/Utilities/StrFmt.cpp +++ b/Utilities/StrFmt.cpp @@ -423,6 +423,14 @@ std::string fmt::to_upper(const std::string& string) return result; } +std::string fmt::to_lower(const std::string& string) +{ + std::string result; + result.resize(string.size()); + std::transform(string.begin(), string.end(), result.begin(), ::tolower); + return result; +} + bool fmt::match(const std::string& source, const std::string& mask) { std::size_t source_position = 0, mask_position = 0; diff --git a/Utilities/StrUtil.h b/Utilities/StrUtil.h index 35af8fb58f..86669d0f16 100644 --- a/Utilities/StrUtil.h +++ b/Utilities/StrUtil.h @@ -134,6 +134,7 @@ namespace fmt } std::string to_upper(const std::string& string); + std::string to_lower(const std::string& string); bool match(const std::string& source, const std::string& mask); }