exiv2/src/utils.cpp
Rosen Penev 61e5aefcc4 explicit conversion
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-02-13 09:35:03 -08:00

21 lines
506 B
C++

#include "utils.hpp"
#include <algorithm>
#include <cctype>
namespace Exiv2::Internal {
std::string upper(const std::string& str) {
std::string result = str;
std::transform(str.begin(), str.end(), result.begin(), [](int c) { return static_cast<char>(toupper(c)); });
return result;
}
std::string lower(const std::string& a) {
std::string b = a;
std::transform(a.begin(), a.end(), b.begin(), [](int c) { return static_cast<char>(tolower(c)); });
return b;
}
} // namespace Exiv2::Internal