Aaaand, I forgot to add files

This commit is contained in:
Florent Le Coz
2013-11-09 23:20:12 +01:00
parent 7c67149935
commit 8acd7a02ae
2 changed files with 41 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
#include <bridge/colors.hpp>
#include <algorithm>
#include <iostream>
void remove_irc_colors(std::string& str)
{
auto it = std::remove_if(str.begin(), str.end(),
[](const char c)
{
if (c == IRC_COLOR_BOLD_CHAR || c == IRC_COLOR_COLOR_CHAR ||
c == IRC_COLOR_FIXED_CHAR || c == IRC_COLOR_RESET_CHAR ||
c == IRC_COLOR_REVERSE_CHAR || c == IRC_COLOR_REVERSE2_CHAR ||
c == IRC_COLOR_UNDERLINE_CHAR || c == IRC_COLOR_ITALIC_CHAR)
return true;
return false;
}
);
str.erase(it, str.end());
}