diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2013-01-19 17:02:36 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2013-01-19 17:02:36 +0000 |
commit | b4b33384b4bce30863d9d01aa6e0b60f588d281d (patch) | |
tree | e1732ca9a36ef790b92d0a21bdf4c919116bc117 /plugins/SmileyAdd/src/smileys.cpp | |
parent | 757be86f9884f7f6e35ebfcd2f1e6be163348eef (diff) |
- Another portion of _T replacement and fixes of previous commits (patch from person)
git-svn-id: http://svn.miranda-ng.org/main/trunk@3173 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SmileyAdd/src/smileys.cpp')
-rw-r--r-- | plugins/SmileyAdd/src/smileys.cpp | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp index 11077b93c6..e7a80280e7 100644 --- a/plugins/SmileyAdd/src/smileys.cpp +++ b/plugins/SmileyAdd/src/smileys.cpp @@ -163,7 +163,7 @@ static DWORD_PTR ConvertServiceParam(HANDLE hContact, const TCHAR *param) DWORD_PTR ret;
if (param == NULL)
ret = 0;
- else if (_tcsicmp(L"hContact", param) == 0)
+ else if (_tcsicmp(_T("hContact"), param) == 0)
ret = (DWORD_PTR)hContact;
else if (_istdigit(*param))
ret = _ttoi(param);
@@ -176,7 +176,7 @@ static DWORD_PTR ConvertServiceParam(HANDLE hContact, const TCHAR *param) void SmileyType::CallSmileyService(HANDLE hContact)
{
- _TPattern * srvsplit = _TPattern::compile(L"(.*)\\|(.*)\\|(.*)");
+ _TPattern * srvsplit = _TPattern::compile(_T("(.*)\\|(.*)\\|(.*)"));
_TMatcher * m0 = srvsplit->createTMatcher(GetTriggerText());
m0->findFirstMatch();
@@ -209,13 +209,13 @@ SmileyPackType::~SmileyPackType() }
static const TCHAR urlRegEx[] =
- L"(?:ftp|https|http|file|aim|webcal|irc|msnim|xmpp|gopher|mailto|news|nntp|telnet|wais|prospero)://?[\\w.?%:/$+;]*";
-static const TCHAR pathRegEx[] = L"[\\s\"][a-zA-Z]:[\\\\/][\\w.\\-\\\\/]*";
-static const TCHAR timeRegEx[] = L"\\d{1,2}:\\d{2}:\\d{2}|\\d{1,2}:\\d{2}";
+ _T("(?:ftp|https|http|file|aim|webcal|irc|msnim|xmpp|gopher|mailto|news|nntp|telnet|wais|prospero)://?[\\w.?%:/$+;]*");
+static const TCHAR pathRegEx[] = _T("[\\s\"][a-zA-Z]:[\\\\/][\\w.\\-\\\\/]*");
+static const TCHAR timeRegEx[] = _T("\\d{1,2}:\\d{2}:\\d{2}|\\d{1,2}:\\d{2}");
void SmileyPackType::AddTriggersToSmileyLookup(void)
{
- _TPattern * p = _TPattern::compile(L"\\s+");
+ _TPattern * p = _TPattern::compile(_T("\\s+"));
{
bkstring emptystr;
@@ -286,8 +286,8 @@ void SmileyPackType::AddTriggersToSmileyLookup(void) void SmileyPackType::ReplaceAllSpecials(const bkstring& Input, bkstring& Output)
{
- Output = _TPattern::replace(L"%%_{1,2}%%", Input, L" ");
- Output = _TPattern::replace(L"%%''%%", Output, L"\"");
+ Output = _TPattern::replace(_T("%%_{1,2}%%"), Input, _T(" "));
+ Output = _TPattern::replace(_T("%%''%%"), Output, _T("\""));
}
@@ -312,7 +312,7 @@ bool SmileyPackType::LoadSmileyFile(const bkstring& filename, bool onlyInfo, boo if (filename.empty())
{
- m_Name = L"Nothing loaded";
+ m_Name = _T("Nothing loaded");
return false;
}
@@ -331,7 +331,7 @@ bool SmileyPackType::LoadSmileyFile(const bkstring& filename, bool onlyInfo, boo ReportError(msgtxt);
}
- m_Name = L"Nothing loaded";
+ m_Name = _T("Nothing loaded");
return false;
}
@@ -368,7 +368,7 @@ bool SmileyPackType::LoadSmileyFile(const bkstring& filename, bool onlyInfo, boo delete[] buf;
bool res;
- if (filename.find(L".xep") == filename.npos)
+ if (filename.find(_T(".xep")) == filename.npos)
res = LoadSmileyFileMSL(tbuf, onlyInfo, modpath);
else
res = LoadSmileyFileXEP(tbuf, onlyInfo, modpath);
@@ -380,7 +380,7 @@ bool SmileyPackType::LoadSmileyFile(const bkstring& filename, bool onlyInfo, boo bool SmileyPackType::LoadSmileyFileMSL(bkstring& tbuf, bool onlyInfo, bkstring& modpath)
{
- _TPattern * pathsplit = _TPattern::compile(L"(.*\\\\)(.*)\\.|$");
+ _TPattern * pathsplit = _TPattern::compile(_T("(.*\\\\)(.*)\\.|$"));
_TMatcher * m0 = pathsplit->createTMatcher(modpath);
m0->findFirstMatch();
@@ -391,18 +391,18 @@ bool SmileyPackType::LoadSmileyFileMSL(bkstring& tbuf, bool onlyInfo, bkstring& delete pathsplit;
_TPattern * otherf = _TPattern::compile(
- L"^\\s*(Name|Author|Date|Version|ButtonSmiley)\\s*=\\s*\"(.*)\"",
+ _T("^\\s*(Name|Author|Date|Version|ButtonSmiley)\\s*=\\s*\"(.*)\""),
_TPattern::MULTILINE_MATCHING);
m0 = otherf->createTMatcher(tbuf);
while (m0->findNextMatch())
{
- if (m0->getGroup(1) == L"Name") m_Name = m0->getGroup(2);
- if (m0->getGroup(1) == L"Author") m_Author = m0->getGroup(2);
- if (m0->getGroup(1) == L"Date") m_Date = m0->getGroup(2);
- if (m0->getGroup(1) == L"Version") m_Version = m0->getGroup(2);
- if (m0->getGroup(1) == L"ButtonSmiley") m_ButtonSmiley = m0->getGroup(2);
+ if (m0->getGroup(1) == _T("Name")) m_Name = m0->getGroup(2);
+ if (m0->getGroup(1) == _T("Author")) m_Author = m0->getGroup(2);
+ if (m0->getGroup(1) == _T("Date")) m_Date = m0->getGroup(2);
+ if (m0->getGroup(1) == _T("Version")) m_Version = m0->getGroup(2);
+ if (m0->getGroup(1) == _T("ButtonSmiley")) m_ButtonSmiley = m0->getGroup(2);
}
delete m0;
delete otherf;
@@ -415,7 +415,7 @@ bool SmileyPackType::LoadSmileyFileMSL(bkstring& tbuf, bool onlyInfo, bkstring& win.y = 0;
{
_TPattern * pat = _TPattern::compile(
- L"^\\s*(Selection|Window)Size\\s*=\\s*(\\d+)\\s*,\\s*(\\d+)",
+ _T("^\\s*(Selection|Window)Size\\s*=\\s*(\\d+)\\s*,\\s*(\\d+)"),
_TPattern::MULTILINE_MATCHING);
_TMatcher * m0 = pat->createTMatcher(tbuf);
while (m0->findNextMatch())
@@ -424,9 +424,9 @@ bool SmileyPackType::LoadSmileyFileMSL(bkstring& tbuf, bool onlyInfo, bkstring& tpt.x = _ttol(m0->getGroup(2).c_str());
tpt.y = _ttol(m0->getGroup(3).c_str());
- if (m0->getGroup(1) == L"Selection")
+ if (m0->getGroup(1) == _T("Selection"))
selec = tpt;
- else if (m0->getGroup(1) == L"Window")
+ else if (m0->getGroup(1) == _T("Window"))
win = tpt;
}
delete m0;
@@ -434,12 +434,12 @@ bool SmileyPackType::LoadSmileyFileMSL(bkstring& tbuf, bool onlyInfo, bkstring& }
_TPattern * smiley = _TPattern::compile(
- L"^\\s*Smiley(\\*)?\\s*=" // Is Hidden
- L"(?:\\s*\"(.*)\")" // Smiley file name
- L"(?:[\\s,]+(\\-?\\d+))" // Icon resource id
- L"(?:[\\s,]+(R|S)?\"(.*?)\")" // Trigger text
- L"(?:[\\s,]+\"(.*?)\")?" // Tooltip or insert text
- L"(?:[\\s,]+\"(.*?)\")?", // Tooltip text
+ _T("^\\s*Smiley(\\*)?\\s*=") // Is Hidden
+ _T("(?:\\s*\"(.*)\")") // Smiley file name
+ _T("(?:[\\s,]+(\\-?\\d+))") // Icon resource id
+ _T("(?:[\\s,]+(R|S)?\"(.*?)\")") // Trigger text
+ _T("(?:[\\s,]+\"(.*?)\")?") // Tooltip or insert text
+ _T("(?:[\\s,]+\"(.*?)\")?"), // Tooltip text
_TPattern::MULTILINE_MATCHING);
_TMatcher * m0 = smiley->createTMatcher(tbuf);
@@ -450,7 +450,7 @@ bool SmileyPackType::LoadSmileyFileMSL(bkstring& tbuf, bool onlyInfo, bkstring& while (m0->findNextMatch())
{
bkstring resname = m0->getGroup(2);
- if (resname.find(L"http://") != resname.npos)
+ if (resname.find(_T("http://")) != resname.npos)
{
if (GetSmileyFile(resname, packstr)) continue;
}
@@ -466,8 +466,8 @@ bool SmileyPackType::LoadSmileyFileMSL(bkstring& tbuf, bool onlyInfo, bkstring& dat->SetHidden(m0->getStartingIndex(1) >= 0);
if (m0->getStartingIndex(4) >= 0)
{
- dat->SetRegEx(m0->getGroup(4) == L"R");
- dat->SetService(m0->getGroup(4) == L"S");
+ dat->SetRegEx(m0->getGroup(4) == _T("R"));
+ dat->SetService(m0->getGroup(4) == _T("S"));
}
dat->m_TriggerText = m0->getGroup(5);
if (dat->IsRegEx())
@@ -531,8 +531,8 @@ static void DecodeHTML(bkstring& str) {
if (str.find('&') != str.npos)
{
- str = _TPattern::replace(bkstring(L"<"), str, bkstring(L"<"));
- str = _TPattern::replace(bkstring(L">"), str, bkstring(L">"));
+ str = _TPattern::replace(bkstring(_T("<")), str, bkstring(_T("<")));
+ str = _TPattern::replace(bkstring(_T(">")), str, bkstring(_T(">")));
}
}
@@ -565,11 +565,11 @@ bool SmileyPackType::LoadSmileyFileXEP(bkstring& tbuf, bool onlyInfo, bkstring& {
_TMatcher *m0, *m1, *m2;
- _TPattern * dbname_re = _TPattern::compile(L"<DataBaseName>\\s*\"(.*?)\"\\s*</DataBaseName>",
+ _TPattern * dbname_re = _TPattern::compile(_T("<DataBaseName>\\s*\"(.*?)\"\\s*</DataBaseName>"),
_TPattern::MULTILINE_MATCHING);
- _TPattern * author_re = _TPattern::compile(L"<PackageAuthor>\\s*\"(.*?)\"\\s*</PackageAuthor>",
+ _TPattern * author_re = _TPattern::compile(_T("<PackageAuthor>\\s*\"(.*?)\"\\s*</PackageAuthor>"),
_TPattern::MULTILINE_MATCHING);
- _TPattern * settings_re = _TPattern::compile(L"<settings>(.*?)</settings>",
+ _TPattern * settings_re = _TPattern::compile(_T("<settings>(.*?)</settings>"),
_TPattern::MULTILINE_MATCHING | _TPattern::DOT_MATCHES_ALL);
m0 = settings_re->createTMatcher(tbuf);
@@ -601,17 +601,17 @@ bool SmileyPackType::LoadSmileyFileXEP(bkstring& tbuf, bool onlyInfo, bkstring& if (!onlyInfo)
{
- _TPattern * record_re = _TPattern::compile(L"<record.*?ImageIndex=\"(.*?)\".*?>(?:\\s*\"(.*?)\")?(.*?)</record>",
+ _TPattern * record_re = _TPattern::compile(_T("<record.*?ImageIndex=\"(.*?)\".*?>(?:\\s*\"(.*?)\")?(.*?)</record>"),
_TPattern::MULTILINE_MATCHING | _TPattern::DOT_MATCHES_ALL);
- _TPattern * expression_re = _TPattern::compile(L"<Expression>\\s*\"(.*?)\"\\s*</Expression>",
+ _TPattern * expression_re = _TPattern::compile(_T("<Expression>\\s*\"(.*?)\"\\s*</Expression>"),
_TPattern::MULTILINE_MATCHING);
- _TPattern * pastetext_re = _TPattern::compile(L"<PasteText>\\s*\"(.*?)\"\\s*</PasteText>",
+ _TPattern * pastetext_re = _TPattern::compile(_T("<PasteText>\\s*\"(.*?)\"\\s*</PasteText>"),
_TPattern::MULTILINE_MATCHING);
- _TPattern * images_re = _TPattern::compile(L"<images>(.*?)</images>",
+ _TPattern * images_re = _TPattern::compile(_T("<images>(.*?)</images>"),
_TPattern::MULTILINE_MATCHING | _TPattern::DOT_MATCHES_ALL);
- _TPattern * image_re = _TPattern::compile(L"<Image>(.*?)</Image>",
+ _TPattern * image_re = _TPattern::compile(_T("<Image>(.*?)</Image>"),
_TPattern::MULTILINE_MATCHING | _TPattern::DOT_MATCHES_ALL);
- _TPattern * imagedt_re = _TPattern::compile(L"<!\\[CDATA\\[(.*?)\\]\\]>",
+ _TPattern * imagedt_re = _TPattern::compile(_T("<!\\[CDATA\\[(.*?)\\]\\]>"),
_TPattern::MULTILINE_MATCHING );
m0 = images_re->createTMatcher(tbuf);
@@ -1036,7 +1036,7 @@ SmileyLookup::SmileyLookup(const bkstring& str, const bool regexs, const int ind m_ind = ind;
if (regexs)
{
- static const bkstring testString(L"Test String");
+ static const bkstring testString(_T("Test String"));
m_pattern = _TPattern::compile(str);
m_valid = m_pattern != NULL;
if (m_valid)
|