summaryrefslogtreecommitdiff
path: root/src/utils/stringutils.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-08-22 03:07:13 +0300
committerAndrei Karas <akaras@inbox.ru>2011-08-22 03:07:13 +0300
commitdddfb405de9d04f50d3a95cc3b0ebc3e49884a65 (patch)
tree4bb96a90cb585a65025533e512e7c3de7cffed00 /src/utils/stringutils.cpp
parent07c2eb8ffd62fe69f410cc045efc837441a6b6d4 (diff)
downloadplus-dddfb405de9d04f50d3a95cc3b0ebc3e49884a65.tar.gz
plus-dddfb405de9d04f50d3a95cc3b0ebc3e49884a65.tar.bz2
plus-dddfb405de9d04f50d3a95cc3b0ebc3e49884a65.tar.xz
plus-dddfb405de9d04f50d3a95cc3b0ebc3e49884a65.zip
Add highlight list option.
Before in highlight was only player nick.
Diffstat (limited to 'src/utils/stringutils.cpp')
-rw-r--r--src/utils/stringutils.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp
index 13170092e..0243c4315 100644
--- a/src/utils/stringutils.cpp
+++ b/src/utils/stringutils.cpp
@@ -181,9 +181,9 @@ unsigned long findI(std::string str, std::string subStr)
return str.find(subStr);
}
-unsigned long findI(std::string str, std::vector<std::string> &list)
+unsigned long findI(std::string &text, std::vector<std::string> &list)
{
- str = toLower(str);
+ std::string str = toLower(text);
unsigned long idx;
for (std::vector<std::string>::iterator i = list.begin();
i != list.end(); ++i)
@@ -414,6 +414,19 @@ std::list<std::string> splitToStringList(const std::string &text,
return tokens;
}
+void splitToStringVector(std::vector<std::string> &tokens,
+ const std::string &text, char separator)
+{
+ std::stringstream ss(text);
+ std::string item;
+ while(std::getline(ss, item, separator))
+ {
+ item = trim(item);
+ if (!item.empty())
+ tokens.push_back(item);
+ }
+}
+
std::string combineDye(std::string file, std::string dye)
{
if (dye.empty())