summaryrefslogtreecommitdiffstats
path: root/src/Common/Util.h
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2008-09-10 03:26:49 +0200
committerMatthias Schiffer <matthias@gamezock.de>2008-09-10 03:26:49 +0200
commit707344b4d161cb5a11e7f78d7622cb7cd1a791f6 (patch)
tree8879f226c610e25fc532d64f40f2fe382e6d8371 /src/Common/Util.h
parent8dd9bc2815347435c8f92bb329a0209b50660618 (diff)
downloadmad-707344b4d161cb5a11e7f78d7622cb7cd1a791f6.tar
mad-707344b4d161cb5a11e7f78d7622cb7cd1a791f6.zip
Client erweitert; Status-Befehl angefangen
Diffstat (limited to 'src/Common/Util.h')
-rw-r--r--src/Common/Util.h58
1 files changed, 0 insertions, 58 deletions
diff --git a/src/Common/Util.h b/src/Common/Util.h
index 71d7b69..19f87b9 100644
--- a/src/Common/Util.h
+++ b/src/Common/Util.h
@@ -55,64 +55,6 @@ class Util {
return str.substr(beg, end);
}
-
- static std::vector<std::string> split(const std::string &str) {
- std::vector<std::string> ret;
- std::string temp;
- bool quoteSingle = false, quoteDouble = false, escape = false;
-
- size_t beg = 0;
-
- for(size_t cur = 0; cur < str.length(); ++cur) {
- if(!escape) {
- if(str[cur] == ' ' && !quoteSingle && !quoteDouble) {
- if(cur == beg && temp.empty()) {
- ++beg;
- }
- else {
- temp += str.substr(beg, cur-beg);
- ret.push_back(temp);
- temp.clear();
- beg = cur+1;
- }
-
- continue;
- }
-
- if(str[cur] == '"' && !quoteSingle) {
- temp += str.substr(beg, cur-beg);
- beg = cur+1;
-
- quoteDouble = !quoteDouble;
- continue;
- }
- if(str[cur] == '\'' && !quoteDouble) {
- temp += str.substr(beg, cur-beg);
- beg = cur+1;
-
- quoteSingle = !quoteSingle;
- continue;
- }
-
- if(str[cur] == '\\') {
- escape = true;
- continue;
- }
- }
-
- if(escape && ((!quoteSingle && !quoteDouble) || (quoteSingle && str[cur] == '\'') || (quoteDouble && (str[cur] == '"' || str[cur] == '\\')))) {
- temp += str.substr(beg, cur-beg-1);
- beg = cur;
- }
-
- escape = false;
- }
-
- temp += str.substr(beg, std::string::npos);
- ret.push_back(temp);
-
- return ret;
- }
};
}