summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-05-06 22:32:21 +0300
committerAndrei Karas <akaras@inbox.ru>2011-05-07 18:24:47 +0300
commit2a4649185cda0788444452168ddcf665af7f17b5 (patch)
tree5ef92bdda9421130873a08e7793fad40364b41e3 /src/utils
parentc371ce29dd114121fe0071e59460a9f197da70f5 (diff)
downloadplus-2a4649185cda0788444452168ddcf665af7f17b5.tar.gz
plus-2a4649185cda0788444452168ddcf665af7f17b5.tar.bz2
plus-2a4649185cda0788444452168ddcf665af7f17b5.tar.xz
plus-2a4649185cda0788444452168ddcf665af7f17b5.zip
Save atack filter between restarts.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/stringutils.cpp21
-rw-r--r--src/utils/stringutils.h4
2 files changed, 24 insertions, 1 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp
index ea2d18276..d9eca557d 100644
--- a/src/utils/stringutils.cpp
+++ b/src/utils/stringutils.cpp
@@ -456,4 +456,23 @@ std::vector<std::string> getLang()
if (dot != (signed)std::string::npos)
langs.push_back(lang.substr(0, dot));
return langs;
-} \ No newline at end of file
+}
+
+std::string packList(std::list<std::string> &list)
+{
+ std::list<std::string>::iterator i = list.begin();
+ std::string str = "";
+ while (i != list.end())
+ {
+ str = str + (*i) + "|";
+ ++ i;
+ }
+ if (str.size() > 1)
+ str = str.substr(0, str.size() - 1);
+ return str;
+}
+
+std::list<std::string> unpackList(const std::string str)
+{
+ return splitToStringList(str, '|');
+}
diff --git a/src/utils/stringutils.h b/src/utils/stringutils.h
index f0dbf0bd9..9d22f8ba8 100644
--- a/src/utils/stringutils.h
+++ b/src/utils/stringutils.h
@@ -180,4 +180,8 @@ std::string combineDye2(std::string file, std::string dye);
std::vector<std::string> getLang();
+std::string packList(std::list<std::string> &list);
+
+std::list<std::string> unpackList(const std::string str);
+
#endif // UTILS_STRINGUTILS_H