Line | Count | Source |
1 | | #include "utils.hpp" |
2 | | |
3 | | #include <cctype> |
4 | | #include <string> |
5 | | |
6 | | namespace Exiv2::Internal { |
7 | | |
8 | 38.2k | std::string upper(std::string_view str) { |
9 | 38.2k | std::string result; |
10 | 38.2k | result.reserve(str.size()); |
11 | 38.2k | for (auto c : str) |
12 | 152k | result.push_back(std::toupper(static_cast<unsigned char>(c))); |
13 | 38.2k | return result; |
14 | 38.2k | } |
15 | | |
16 | 28.8k | std::string lower(std::string_view a) { |
17 | 28.8k | std::string b; |
18 | 28.8k | b.reserve(a.size()); |
19 | 28.8k | for (auto c : a) |
20 | 29.2M | b.push_back(std::tolower(static_cast<unsigned char>(c))); |
21 | 28.8k | return b; |
22 | 28.8k | } |
23 | | |
24 | | } // namespace Exiv2::Internal |