diff options
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/utils/tolower.cpp | 13 | ||||
-rw-r--r-- | src/utils/tolower.hpp | 9 |
3 files changed, 15 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3011fd3..8a8ae9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,7 @@ if((NOT ${POLLER} MATCHES "POLL") AND (NOT ${POLLER} MATCHES "EPOLL")) message(FATAL_ERROR "POLLER must be either POLL or EPOLL") endif() + # ## utils # diff --git a/src/utils/tolower.cpp b/src/utils/tolower.cpp new file mode 100644 index 0000000..3e518bd --- /dev/null +++ b/src/utils/tolower.cpp @@ -0,0 +1,13 @@ +#include <utils/tolower.hpp> + +namespace utils +{ + std::string tolower(const std::string& original) + { + std::string res; + res.reserve(original.size()); + for (const char c: original) + res += static_cast<char>(std::tolower(c)); + return res; + } +} diff --git a/src/utils/tolower.hpp b/src/utils/tolower.hpp index 22d2b8f..0019182 100644 --- a/src/utils/tolower.hpp +++ b/src/utils/tolower.hpp @@ -5,14 +5,7 @@ namespace utils { - std::string tolower(const std::string& original) - { - std::string res; - res.reserve(original.size()); - for (const char c: original) - res += static_cast<char>(std::tolower(c)); - return res; - } + std::string tolower(const std::string& original); } #endif // SPLIT_INCLUDED |