summaryrefslogtreecommitdiff
path: root/src/utils/tolower.hpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2013-11-28 02:14:42 +0100
committerFlorent Le Coz <louiz@louiz.org>2013-11-28 02:14:42 +0100
commit1151c26c363e736a98c5fcb723c753658fe35b9b (patch)
tree14b1cd8ef09e0ea5ec57ad5a4a230b282ec7f943 /src/utils/tolower.hpp
parent2921f53657a78a73ca0dc8af95219ca27653fe55 (diff)
downloadbiboumi-1151c26c363e736a98c5fcb723c753658fe35b9b.tar.gz
biboumi-1151c26c363e736a98c5fcb723c753658fe35b9b.tar.bz2
biboumi-1151c26c363e736a98c5fcb723c753658fe35b9b.tar.xz
biboumi-1151c26c363e736a98c5fcb723c753658fe35b9b.zip
Channel names are case insensitive
But some servers (epiknet for example) send channel names with an uppercase
Diffstat (limited to 'src/utils/tolower.hpp')
-rw-r--r--src/utils/tolower.hpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/utils/tolower.hpp b/src/utils/tolower.hpp
new file mode 100644
index 0000000..22d2b8f
--- /dev/null
+++ b/src/utils/tolower.hpp
@@ -0,0 +1,18 @@
+#ifndef TOLOWER_INCLUDED
+# define TOLOWER_INCLUDED
+
+#include <string>
+
+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;
+ }
+}
+
+#endif // SPLIT_INCLUDED