Use CString::Split() in more places

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1808 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2010-03-07 11:08:26 +00:00
parent 698965777a
commit 5d9a22f6cc
8 changed files with 48 additions and 51 deletions
+7 -10
View File
@@ -130,21 +130,18 @@ public:
void SetPattern(const CString& s) { m_sPattern = s; }
void SetDisabled(bool b = true) { m_bDisabled = b; }
void SetSources(const CString& sSources) {
unsigned int uIdx = 1;
CString sSrc = sSources.Token(0);
VCString vsSources;
VCString::iterator it;
sSources.Split(" ", vsSources, false);
m_vsSources.clear();
while (sSrc.size()) {
if (sSrc[0] == '!') {
if (sSrc.size() > 1) {
m_vsSources.push_back(CWatchSource(sSrc.substr(1), true));
}
for (it = vsSources.begin(); it != vsSources.end(); ++it) {
if (it->at(0) == '!' && it->size() > 1) {
m_vsSources.push_back(CWatchSource(it->substr(1), true));
} else {
m_vsSources.push_back(CWatchSource(sSrc, false));
m_vsSources.push_back(CWatchSource(*it, false));
}
sSrc = sSources.Token(uIdx++);
}
}
// !Setters