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