forked from projectM-visualizer/projectm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUtils.cpp
More file actions
33 lines (26 loc) · 635 Bytes
/
Utils.cpp
File metadata and controls
33 lines (26 loc) · 635 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "Utils.hpp"
#include <algorithm>
namespace libprojectM {
namespace Utils {
auto ToLower(const std::string& str) -> std::string
{
std::string lowerStr(str);
ToLowerInPlace(lowerStr);
return lowerStr;
}
auto ToUpper(const std::string& str) -> std::string
{
std::string upperStr(str);
ToUpperInPlace(upperStr);
return upperStr;
}
void ToLowerInPlace(std::string& str)
{
std::transform(str.begin(), str.end(), str.begin(), ::tolower);
}
void ToUpperInPlace(std::string& str)
{
std::transform(str.begin(), str.end(), str.begin(), ::toupper);
}
} // namespace Utils
} // namespace libprojectM