mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2024-11-25 15:15:40 +00:00
Added Util::ToLower()
This commit is contained in:
parent
a84aacf80b
commit
331d7042f2
|
@ -1,8 +1,16 @@
|
|||
#include "Util/Format.h"
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
|
||||
namespace Util
|
||||
{
|
||||
std::string ToLower(const std::string &str)
|
||||
{
|
||||
std::string tmp(str);
|
||||
std::transform(tmp.begin(), tmp.end(), tmp.begin(), ::tolower);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
std::string TrimWhiteSpace(const std::string &str)
|
||||
{
|
||||
if (str.empty())
|
||||
|
|
|
@ -76,6 +76,8 @@ namespace Util
|
|||
{
|
||||
}
|
||||
private:
|
||||
//TODO: write own buffer implementation to more easily support ToLower() et
|
||||
// al as methods of Util::Format
|
||||
std::stringstream m_stream;
|
||||
|
||||
void clear()
|
||||
|
@ -84,6 +86,7 @@ namespace Util
|
|||
}
|
||||
};
|
||||
|
||||
std::string ToLower(const std::string &str);
|
||||
std::string TrimWhiteSpace(const std::string &str);
|
||||
std::string Hex(uint32_t n, size_t num_digits);
|
||||
std::string Hex(uint32_t n);
|
||||
|
|
Loading…
Reference in a new issue