From 6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 26 Jul 2016 09:20:25 +0000 Subject: less TCHARs: - TCHAR is replaced with wchar_t everywhere; - LPGENT replaced with either LPGENW or LPGEN; - fixes for ANSI plugins that improperly used _t functions; - TCHAR *t removed from MAllStrings; - ptszGroup, ptszTitle & ptszTab in OPTIONSDIALOGPAGE replaced with pwsz* git-svn-id: http://svn.miranda-ng.org/main/trunk@17133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Boltun/src/Engine/WordsList.cpp | 48 ++++++++++++++++----------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'plugins/Boltun/src/Engine/WordsList.cpp') diff --git a/plugins/Boltun/src/Engine/WordsList.cpp b/plugins/Boltun/src/Engine/WordsList.cpp index b111cc3414..1efbdebc20 100644 --- a/plugins/Boltun/src/Engine/WordsList.cpp +++ b/plugins/Boltun/src/Engine/WordsList.cpp @@ -22,17 +22,17 @@ using namespace std; -WordsList::WordsList(const tstring &data/*, bool allowUnstrict*/) +WordsList::WordsList(const wstring &data/*, bool allowUnstrict*/) { Parse(data/*, allowUnstrict*/); } -WordsList::operator tstring() const +WordsList::operator wstring() const { - tstring res; + wstring res; //if (unstrict) // res = L"~"; - set::const_iterator it = words.begin(); + set::const_iterator it = words.begin(); if (!words.empty()) while (true) { @@ -47,16 +47,16 @@ WordsList::operator tstring() const return res; } -WordsList& WordsList::operator= (const tstring& s) +WordsList& WordsList::operator= (const wstring& s) { Parse(s); return *this; }; -void WordsList::Parse(tstring s/*, bool allowUnstrict*/) +void WordsList::Parse(wstring s/*, bool allowUnstrict*/) { isQuestion = false; - /*if (allowUnstrict && s.length() && s[0] == _T('~')) + /*if (allowUnstrict && s.length() && s[0] == '~') { s = s.substr(1, s.npos); unstrict = true; @@ -64,7 +64,7 @@ void WordsList::Parse(tstring s/*, bool allowUnstrict*/) else unstrict = false;*/ int len = (int)s.length() - 1; - while (len != -1 && _istspace(s[len])) + while (len != -1 && iswspace(s[len])) len--; if (len < 0) return; @@ -77,22 +77,22 @@ void WordsList::Parse(tstring s/*, bool allowUnstrict*/) int it = 0; while (it != len) { - while (it != len && _istspace(s[it])) + while (it != len && iswspace(s[it])) it++; if (it == len) break; int start = it; - while (it != len && !_istspace(s[it])) + while (it != len && !iswspace(s[it])) it++; words.insert(s.substr(start, it - start)); } } -bool WordsList::MatchesAll(const vector& s/*, bool& WasStrict*/, float& priority) const +bool WordsList::MatchesAll(const vector& s/*, bool& WasStrict*/, float& priority) const { - std::set temp; + std::set temp; //WasStrict = true; - for (vector::const_iterator it = s.begin(); it != s.end(); ++it) + for (vector::const_iterator it = s.begin(); it != s.end(); ++it) { /* if (words.find(*it) == words.end()) if (unstrict) @@ -112,27 +112,27 @@ bool WordsList::MatchesAll(const vector& s/*, bool& WasStrict*/, float& return temp.size() == words.size(); } -bool WordsList::MatchesAny(const vector& s) const +bool WordsList::MatchesAny(const vector& s) const { - for (vector::const_iterator it = s.begin(); it != s.end(); ++it) + for (vector::const_iterator it = s.begin(); it != s.end(); ++it) if (words.find(*it) != words.end()) return true; return false; } -vector WordsList::ConsistsOf(const set& list) const +vector WordsList::ConsistsOf(const set& list) const { - vector res; - for (set::const_iterator it = words.begin(); it != words.end(); ++it) + vector res; + for (set::const_iterator it = words.begin(); it != words.end(); ++it) if (list.find(*it) == list.end()) res.push_back(*it); return res; } -vector WordsList::DoesntIncludeAny(const set& list) const +vector WordsList::DoesntIncludeAny(const set& list) const { - vector res; - for (set::const_iterator it = words.begin(); it != words.end(); ++it) + vector res; + for (set::const_iterator it = words.begin(); it != words.end(); ++it) if (list.find(*it) != list.end()) res.push_back(*it); return res; @@ -140,17 +140,17 @@ vector WordsList::DoesntIncludeAny(const set& list) const bool WordsList::operator<(const WordsList& value) const { - return (tstring)*this < (tstring)value; + return (wstring)*this < (wstring)value; } bool WordsList::operator!=(const WordsList& value) const { - return (tstring)*this != (tstring)value; + return (wstring)*this != (wstring)value; } bool WordsList::operator==(const WordsList& value) const { - return (tstring)*this == (tstring)value; + return (wstring)*this == (wstring)value; } size_t WordsList::Size() const -- cgit v1.2.3