diff --git a/Src/Util/Format.cpp b/Src/Util/Format.cpp index f7114d8..d2566a9 100644 --- a/Src/Util/Format.cpp +++ b/Src/Util/Format.cpp @@ -1,8 +1,16 @@ #include "Util/Format.h" +#include #include 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()) diff --git a/Src/Util/Format.h b/Src/Util/Format.h index f10d02d..7a680f6 100644 --- a/Src/Util/Format.h +++ b/Src/Util/Format.h @@ -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);