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/TalkEngine.h | 44 +++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'plugins/Boltun/src/Engine/TalkEngine.h') diff --git a/plugins/Boltun/src/Engine/TalkEngine.h b/plugins/Boltun/src/Engine/TalkEngine.h index c18f3df1c1..7e0539c9e6 100644 --- a/plugins/Boltun/src/Engine/TalkEngine.h +++ b/plugins/Boltun/src/Engine/TalkEngine.h @@ -34,14 +34,14 @@ public: struct MessageInfo { private: - std::tstring Question; - MessageInfo(std::tstring q, std::tstring a) + std::wstring Question; + MessageInfo(std::wstring q, std::wstring a) :Question(q), Answer(a) { } public: - std::tstring Answer; - MessageInfo(std::tstring q) + std::wstring Answer; + MessageInfo(std::wstring q) :Question(q) { } @@ -52,17 +52,17 @@ private: { BEST, LOOKSLIKE/*, LOOKSLIKE2*/, BAD, FAIL, NOTHING } Level; - friend std::tstring LevelToStr(TalkBot::Level target); + friend std::wstring LevelToStr(TalkBot::Level target); struct ContactData { ValueChooser<> initial; - //ValueChooser > question; - //ValueChooser > special; + //ValueChooser > question; + //ValueChooser > special; ValueChooser<> escape; ValueChooser<> failure; UnRecentChooser chooser; - std::tstring lastMessage; + std::wstring lastMessage; long long lastMessageTime; int repeatCount; inline ContactData(const Mind& mind) @@ -81,22 +81,22 @@ private: bool beSilent; bool makeLowercase; bool understandAlways; - void UpdateStartChar(std::tstring &str); - typedef std::multimap::const_iterator mm_cit; - bool FindExact(ContactData *contactData, const std::tstring &incomingMessage, const std::multimap &map, std::tstring &res); - bool FindAny(ValueChooser<> &ch, std::tstring &res); - void FindByKeywords(ContactData *contactData, const std::vector &keywords, std::tstring &res/*, std::tstring& ures*/, bool isQuestion); - bool FindByOthers(ContactData *contactData, const std::vector &otherwords, std::tstring &res, bool isQuestion); - std::tstring AllReplies(const std::tstring &incomingMessage, ContactData *contactData, Level &maxValue, std::multimap &mm); - std::tstring ReplaceAliases(const std::tstring &message); - std::tstring ChooseResult(ContactData *contactData, Level maxValue, const std::multimap &mm); + void UpdateStartChar(std::wstring &str); + typedef std::multimap::const_iterator mm_cit; + bool FindExact(ContactData *contactData, const std::wstring &incomingMessage, const std::multimap &map, std::wstring &res); + bool FindAny(ValueChooser<> &ch, std::wstring &res); + void FindByKeywords(ContactData *contactData, const std::vector &keywords, std::wstring &res/*, std::wstring& ures*/, bool isQuestion); + bool FindByOthers(ContactData *contactData, const std::vector &otherwords, std::wstring &res, bool isQuestion); + std::wstring AllReplies(const std::wstring &incomingMessage, ContactData *contactData, Level &maxValue, std::multimap &mm); + std::wstring ReplaceAliases(const std::wstring &message); + std::wstring ChooseResult(ContactData *contactData, Level maxValue, const std::multimap &mm); void RecordAnswer(ContactData *contactData, const TalkBot::MessageInfo &info); #ifdef _DEBUG public: #endif - void SplitSectences(const std::tstring &incomingMessage, std::vector &vec); - void SplitAndSortWords(std::tstring sentence, std::vector &keywords, - std::vector& otherwords, bool& isQuestion); + void SplitSectences(const std::wstring &incomingMessage, std::vector &vec); + void SplitAndSortWords(std::wstring sentence, std::vector &keywords, + std::vector& otherwords, bool& isQuestion); public: TalkBot(const Mind& goodMind); ~TalkBot(); @@ -105,8 +105,8 @@ public: void SetLowercase(const bool isLowercase); void SetUnderstandAlways(const bool understandAlways); //const MindData *GetData(); - std::tstring GetInitMessage(MCONTACT contact); - MessageInfo* Reply(MCONTACT contact, const std::tstring incomingMessage, bool saveChoice); + std::wstring GetInitMessage(MCONTACT contact); + MessageInfo* Reply(MCONTACT contact, const std::wstring incomingMessage, bool saveChoice); void AnswerGiven(MCONTACT contact, const MessageInfo &info); }; -- cgit v1.2.3