diff options
Diffstat (limited to 'src/common/string_util.cpp')
| -rw-r--r-- | src/common/string_util.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp index 1f0456aee..0ca663032 100644 --- a/src/common/string_util.cpp +++ b/src/common/string_util.cpp | |||
| @@ -2,12 +2,12 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <algorithm> | ||
| 5 | #include <cctype> | 6 | #include <cctype> |
| 6 | #include <cerrno> | 7 | #include <cerrno> |
| 7 | #include <cstdio> | 8 | #include <cstdio> |
| 8 | #include <cstdlib> | 9 | #include <cstdlib> |
| 9 | #include <cstring> | 10 | #include <cstring> |
| 10 | #include <boost/range/algorithm/transform.hpp> | ||
| 11 | #include "common/common_paths.h" | 11 | #include "common/common_paths.h" |
| 12 | #include "common/logging/log.h" | 12 | #include "common/logging/log.h" |
| 13 | #include "common/string_util.h" | 13 | #include "common/string_util.h" |
| @@ -24,13 +24,15 @@ namespace Common { | |||
| 24 | 24 | ||
| 25 | /// Make a string lowercase | 25 | /// Make a string lowercase |
| 26 | std::string ToLower(std::string str) { | 26 | std::string ToLower(std::string str) { |
| 27 | boost::transform(str, str.begin(), ::tolower); | 27 | std::transform(str.begin(), str.end(), str.begin(), |
| 28 | [](unsigned char c) { return std::tolower(c); }); | ||
| 28 | return str; | 29 | return str; |
| 29 | } | 30 | } |
| 30 | 31 | ||
| 31 | /// Make a string uppercase | 32 | /// Make a string uppercase |
| 32 | std::string ToUpper(std::string str) { | 33 | std::string ToUpper(std::string str) { |
| 33 | boost::transform(str, str.begin(), ::toupper); | 34 | std::transform(str.begin(), str.end(), str.begin(), |
| 35 | [](unsigned char c) { return std::toupper(c); }); | ||
| 34 | return str; | 36 | return str; |
| 35 | } | 37 | } |
| 36 | 38 | ||