summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/mir_buffer.h32
-rw-r--r--utils/mir_fonts.cpp12
-rw-r--r--utils/mir_options.cpp39
-rw-r--r--utils/mir_options.h2
-rw-r--r--utils/mir_smileys.cpp25
-rw-r--r--utils/std_string_utils.cpp16
-rw-r--r--utils/std_string_utils.h4
-rw-r--r--utils/utf8_helpers.h54
8 files changed, 91 insertions, 93 deletions
diff --git a/utils/mir_buffer.h b/utils/mir_buffer.h
index 584ca12149..25ea5a0516 100644
--- a/utils/mir_buffer.h
+++ b/utils/mir_buffer.h
@@ -435,7 +435,7 @@ class Buffer
};
-static void ReplaceVars(Buffer<TCHAR> *buffer, MCONTACT hContact, TCHAR **variables, int numVariables)
+static void ReplaceVars(Buffer<wchar_t> *buffer, MCONTACT hContact, wchar_t **variables, int numVariables)
{
if (buffer->len < 3)
return;
@@ -445,25 +445,25 @@ static void ReplaceVars(Buffer<TCHAR> *buffer, MCONTACT hContact, TCHAR **variab
for(size_t i = buffer->len - 1; i > 0; i--)
{
- if (buffer->str[i] == _T('%'))
+ if (buffer->str[i] == '%')
{
// Find previous
size_t j;
- for(j = i - 1; j > 0 && ((buffer->str[j] >= _T('a') && buffer->str[j] <= _T('z'))
- || (buffer->str[j] >= _T('A') && buffer->str[j] <= _T('Z'))
- || buffer->str[j] == _T('-')
- || buffer->str[j] == _T('_')); j--) ;
+ for(j = i - 1; j > 0 && ((buffer->str[j] >= 'a' && buffer->str[j] <= 'z')
+ || (buffer->str[j] >= 'A' && buffer->str[j] <= 'Z')
+ || buffer->str[j] == '-'
+ || buffer->str[j] == '_'); j--) ;
- if (buffer->str[j] == _T('%'))
+ if (buffer->str[j] == '%')
{
size_t foundLen = i - j + 1;
- if (foundLen == 9 && _tcsncmp(&buffer->str[j], L"%contact%", 9) == 0)
+ if (foundLen == 9 && wcsncmp(&buffer->str[j], L"%contact%", 9) == 0)
{
buffer->replace(j, i + 1, pcli->pfnGetContactDisplayName(hContact, 0));
}
- else if (foundLen == 6 && _tcsncmp(&buffer->str[j], L"%date%", 6) == 0)
+ else if (foundLen == 6 && wcsncmp(&buffer->str[j], L"%date%", 6) == 0)
{
- TCHAR tmp[128];
+ wchar_t tmp[128];
TimeZone_ToStringT(time(NULL), L"d s", tmp, _countof(tmp));
buffer->replace(j, i + 1, tmp);
}
@@ -472,7 +472,7 @@ static void ReplaceVars(Buffer<TCHAR> *buffer, MCONTACT hContact, TCHAR **variab
for(int k = 0; k < numVariables; k += 2)
{
size_t len = mir_tstrlen(variables[k]);
- if (foundLen == len + 2 && _tcsncmp(&buffer->str[j]+1, variables[k], len) == 0)
+ if (foundLen == len + 2 && wcsncmp(&buffer->str[j]+1, variables[k], len) == 0)
{
buffer->replace(j, i + 1, variables[k + 1]);
break;
@@ -485,21 +485,21 @@ static void ReplaceVars(Buffer<TCHAR> *buffer, MCONTACT hContact, TCHAR **variab
if (i == 0)
break;
}
- else if (buffer->str[i] == _T('\\') && i+1 <= buffer->len-1 && buffer->str[i+1] == _T('n'))
+ else if (buffer->str[i] == '\\' && i+1 <= buffer->len-1 && buffer->str[i+1] == 'n')
{
- buffer->str[i] = _T('\r');
- buffer->str[i+1] = _T('\n');
+ buffer->str[i] = '\r';
+ buffer->str[i+1] = '\n';
}
}
}
-static void ReplaceTemplate(Buffer<TCHAR> *out, MCONTACT hContact, TCHAR *templ, TCHAR **vars, int numVars)
+static void ReplaceTemplate(Buffer<wchar_t> *out, MCONTACT hContact, wchar_t *templ, wchar_t **vars, int numVars)
{
if (ServiceExists(MS_VARS_FORMATSTRING))
{
- TCHAR *tmp = variables_parse_ex(templ, NULL, hContact, vars, numVars);
+ wchar_t *tmp = variables_parse_ex(templ, NULL, hContact, vars, numVars);
if (tmp != NULL)
{
out->append(tmp);
diff --git a/utils/mir_fonts.cpp b/utils/mir_fonts.cpp
index 0ef14e3c6d..410f936fa3 100644
--- a/utils/mir_fonts.cpp
+++ b/utils/mir_fonts.cpp
@@ -6,7 +6,7 @@
#include "mir_fonts.h"
-int FontService_RegisterFont(const char *pszDbModule, const char *pszDbName, const TCHAR *pszSection, const TCHAR *pszDescription, const TCHAR *pszBackgroundGroup, const TCHAR *pszBackgroundName, int position, BOOL bAllowEffects, LOGFONT *plfDefault, COLORREF clrDefault)
+int FontService_RegisterFont(const char *pszDbModule, const char *pszDbName, const wchar_t *pszSection, const wchar_t *pszDescription, const wchar_t *pszBackgroundGroup, const wchar_t *pszBackgroundName, int position, BOOL bAllowEffects, LOGFONT *plfDefault, COLORREF clrDefault)
{
FontIDT fid = { 0 };
fid.cbSize = sizeof(fid);
@@ -34,7 +34,7 @@ int FontService_RegisterFont(const char *pszDbModule, const char *pszDbName, con
return 0;
}
-int FontService_GetFont(const TCHAR *pszSection, const TCHAR *pszDescription, COLORREF *pclr, LOGFONT *plf)
+int FontService_GetFont(const wchar_t *pszSection, const wchar_t *pszDescription, COLORREF *pclr, LOGFONT *plf)
{
FontIDT fid = { 0 };
mir_tstrncpy(fid.group, pszSection, _countof(fid.group)); /* buffer sfae */
@@ -43,7 +43,7 @@ int FontService_GetFont(const TCHAR *pszSection, const TCHAR *pszDescription, CO
return (int)*pclr == -1;
}
-int FontService_RegisterColor(const char *pszDbModule, const char *pszDbName, const TCHAR *pszSection, const TCHAR *pszDescription, COLORREF clrDefault)
+int FontService_RegisterColor(const char *pszDbModule, const char *pszDbName, const wchar_t *pszSection, const wchar_t *pszDescription, COLORREF clrDefault)
{
ColourIDT cid = { 0 };
cid.cbSize = sizeof(cid);
@@ -56,12 +56,12 @@ int FontService_RegisterColor(const char *pszDbModule, const char *pszDbName, co
return 0;
}
-int FontService_GetColor(const TCHAR *pszSection, const TCHAR *pszDescription, COLORREF *pclr)
+int FontService_GetColor(const wchar_t *pszSection, const wchar_t *pszDescription, COLORREF *pclr)
{
ColourIDT cid = { 0 };
cid.cbSize = sizeof(cid);
- _tcsncpy_s(cid.group, pszSection, _TRUNCATE);
- _tcsncpy_s(cid.name, pszDescription, _TRUNCATE);
+ wcsncpy_s(cid.group, pszSection, _TRUNCATE);
+ wcsncpy_s(cid.name, pszDescription, _TRUNCATE);
*pclr = (COLORREF)CallService(MS_COLOUR_GETT, (WPARAM)&cid, 0);
return (int)*pclr == -1;
}
diff --git a/utils/mir_options.cpp b/utils/mir_options.cpp
index afdc407708..90bf27c3e8 100644
--- a/utils/mir_options.cpp
+++ b/utils/mir_options.cpp
@@ -20,7 +20,6 @@ Boston, MA 02111-1307, USA.
#include <windows.h>
#include <commctrl.h>
#include <stdio.h>
-#include <tchar.h>
#include <newpluginapi.h>
#include <m_database.h>
@@ -32,11 +31,11 @@ Boston, MA 02111-1307, USA.
#include "mir_options.h"
-static TCHAR* MyDBGetContactSettingTString(MCONTACT hContact, char* module, char* setting, TCHAR* out, size_t len, TCHAR *def)
+static wchar_t* MyDBGetContactSettingTString(MCONTACT hContact, char* module, char* setting, wchar_t* out, size_t len, wchar_t *def)
{
DBVARIANT dbv = { 0 };
- out[0] = _T('\0');
+ out[0] = '\0';
if (!db_get_ts(hContact, module, setting, &dbv)) {
mir_tstrncpy(out, dbv.ptszVal, (int)len);
@@ -51,42 +50,42 @@ static TCHAR* MyDBGetContactSettingTString(MCONTACT hContact, char* module, char
}
-static TCHAR dbPath[MAX_PATH] = { 0 }; // database profile path (read at startup only)
+static wchar_t dbPath[MAX_PATH] = { 0 }; // database profile path (read at startup only)
-static int PathIsAbsolute(const TCHAR *path)
+static int PathIsAbsolute(const wchar_t *path)
{
if (!path || !(mir_tstrlen(path) > 2))
return 0;
- if ((path[1] == _T(':') && path[2] == _T('\\')) || (path[0] == _T('\\') && path[1] == _T('\\')))
+ if ((path[1] == ':' && path[2] == '\\') || (path[0] == '\\' && path[1] == '\\'))
return 1;
return 0;
}
-static void PathToRelative(TCHAR *pOut, size_t outSize, const TCHAR *pSrc)
+static void PathToRelative(wchar_t *pOut, size_t outSize, const wchar_t *pSrc)
{
if (!PathIsAbsolute(pSrc))
mir_tstrncpy(pOut, pSrc, (int)outSize);
else {
- if (dbPath[0] == _T('\0')) {
+ if (dbPath[0] == '\0') {
char tmp[1024];
CallService(MS_DB_GETPROFILEPATH, _countof(tmp), (LPARAM)tmp);
mir_sntprintf(dbPath, L"%S\\", tmp);
}
size_t len = mir_tstrlen(dbPath);
- if (!_tcsnicmp(pSrc, dbPath, len))
+ if (!wcsnicmp(pSrc, dbPath, len))
len = 0;
mir_tstrncpy(pOut, pSrc + len, outSize);
}
}
-static void PathToAbsolute(TCHAR *pOut, size_t outSize, const TCHAR *pSrc)
+static void PathToAbsolute(wchar_t *pOut, size_t outSize, const wchar_t *pSrc)
{
if (PathIsAbsolute(pSrc) || !isalnum(pSrc[0]))
mir_tstrncpy(pOut, pSrc, (int)outSize);
else {
- if (dbPath[0] == _T('\0')) {
+ if (dbPath[0] == '\0') {
char tmp[1024];
CallService(MS_DB_GETPROFILEPATH, _countof(tmp), (LPARAM)tmp);
mir_sntprintf(dbPath, L"%S\\", tmp);
@@ -101,7 +100,7 @@ static void LoadOpt(OptPageControl *ctrl, char *module)
if (ctrl->var == NULL)
return;
- TCHAR tmp[1024];
+ wchar_t tmp[1024];
switch (ctrl->type) {
case CONTROL_CHECKBOX:
*((BYTE *)ctrl->var) = db_get_b(NULL, module, ctrl->setting, ctrl->dwDefValue);
@@ -127,7 +126,7 @@ static void LoadOpt(OptPageControl *ctrl, char *module)
break;
case CONTROL_TEXT:
- MyDBGetContactSettingTString(NULL, module, ctrl->setting, ((TCHAR *)ctrl->var), min(ctrl->max <= 0 ? 1024 : ctrl->max, 1024), ctrl->tszDefValue == NULL ? NULL : TranslateTS(ctrl->tszDefValue));
+ MyDBGetContactSettingTString(NULL, module, ctrl->setting, ((wchar_t *)ctrl->var), min(ctrl->max <= 0 ? 1024 : ctrl->max, 1024), ctrl->tszDefValue == NULL ? NULL : TranslateTS(ctrl->tszDefValue));
break;
case CONTROL_INT:
@@ -136,12 +135,12 @@ static void LoadOpt(OptPageControl *ctrl, char *module)
case CONTROL_FILE:
MyDBGetContactSettingTString(NULL, module, ctrl->setting, tmp, 1024, ctrl->tszDefValue == NULL ? NULL : ctrl->tszDefValue);
- PathToAbsolute(((TCHAR *)ctrl->var), min(ctrl->max <= 0 ? 1024 : ctrl->max, 1024), tmp);
+ PathToAbsolute(((wchar_t *)ctrl->var), min(ctrl->max <= 0 ? 1024 : ctrl->max, 1024), tmp);
break;
case CONTROL_COMBO_TEXT:
case CONTROL_COMBO_ITEMDATA:
- MyDBGetContactSettingTString(NULL, module, ctrl->setting, ((TCHAR *)ctrl->var), min(ctrl->max <= 0 ? 1024 : ctrl->max, 1024), ctrl->tszDefValue == NULL ? NULL : TranslateTS(ctrl->tszDefValue));
+ MyDBGetContactSettingTString(NULL, module, ctrl->setting, ((wchar_t *)ctrl->var), min(ctrl->max <= 0 ? 1024 : ctrl->max, 1024), ctrl->tszDefValue == NULL ? NULL : TranslateTS(ctrl->tszDefValue));
break;
}
}
@@ -154,7 +153,7 @@ void LoadOpts(OptPageControl *controls, int controlsSize, char *module)
INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, char *module, HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- TCHAR tmp[1024];
+ wchar_t tmp[1024];
switch (msg) {
case WM_INITDIALOG:
@@ -249,7 +248,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha
case CONTROL_FILE:
MyDBGetContactSettingTString(NULL, module, ctrl->setting, tmp, 1024, ctrl->tszDefValue == NULL ? NULL : ctrl->tszDefValue);
{
- TCHAR abs[1024];
+ wchar_t abs[1024];
PathToAbsolute(abs, 1024, tmp);
SetDlgItemText(hwndDlg, ctrl->nID, abs);
}
@@ -267,7 +266,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha
int count = SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETCOUNT, 0, 0);
int k;
for (k = 0; k < count; k++) {
- TCHAR *id = (TCHAR *)SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETITEMDATA, (WPARAM)k, 0);
+ wchar_t *id = (wchar_t *)SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETITEMDATA, (WPARAM)k, 0);
if (mir_tstrcmp(id, tmp) == 0)
break;
}
@@ -378,7 +377,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha
case CONTROL_FILE:
GetDlgItemText(hwndDlg, ctrl->nID, tmp, _countof(tmp));
{
- TCHAR rel[1024];
+ wchar_t rel[1024];
PathToRelative(rel, 1024, tmp);
db_set_ts(NULL, module, ctrl->setting, rel);
}
@@ -391,7 +390,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha
case CONTROL_COMBO_ITEMDATA:
int sel = SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETCURSEL, 0, 0);
- db_set_ts(NULL, module, ctrl->setting, (TCHAR *)SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETITEMDATA, (WPARAM)sel, 0));
+ db_set_ts(NULL, module, ctrl->setting, (wchar_t *)SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETITEMDATA, (WPARAM)sel, 0));
break;
}
diff --git a/utils/mir_options.h b/utils/mir_options.h
index 7c2634e9eb..937eb71366 100644
--- a/utils/mir_options.h
+++ b/utils/mir_options.h
@@ -46,7 +46,7 @@ typedef struct {
char *setting;
union {
ULONG_PTR dwDefValue;
- TCHAR *tszDefValue;
+ wchar_t *tszDefValue;
char *szDefValue;
};
union {
diff --git a/utils/mir_smileys.cpp b/utils/mir_smileys.cpp
index a337b5b2f1..f3d5168a81 100644
--- a/utils/mir_smileys.cpp
+++ b/utils/mir_smileys.cpp
@@ -27,7 +27,6 @@ Boston, MA 02111-1307, USA.
#include <m_database.h>
#include <commctrl.h>
#include <m_skin_eng.h>
-#include <tchar.h>
// Prototypes
@@ -53,10 +52,10 @@ typedef struct
}
TextPiece;
-SortedList * ReplaceSmileys(const TCHAR *text, int text_size, const char *protocol, int *max_smiley_height);
-void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, SortedList *plText, UINT uTextFormat, int max_smiley_height);
+SortedList * ReplaceSmileys(const wchar_t *text, int text_size, const char *protocol, int *max_smiley_height);
+void DrawTextSmiley(HDC hdcMem, RECT free_rc, const wchar_t *szText, int len, SortedList *plText, UINT uTextFormat, int max_smiley_height);
void DestroySmileyList(SortedList* p_list);
-SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SortedList *plText, UINT uTextFormat, int max_smiley_height);
+SIZE GetTextSize(HDC hdcMem, const wchar_t *szText, SortedList *plText, UINT uTextFormat, int max_smiley_height);
// Functions
@@ -77,7 +76,7 @@ int InitContactListSmileys()
return 0;
}
-SmileysParseInfo Smileys_PreParse(const TCHAR* lpString, int nCount, const char *protocol)
+SmileysParseInfo Smileys_PreParse(const wchar_t* lpString, int nCount, const char *protocol)
{
SmileysParseInfo info = (SmileysParseInfo)mir_calloc(sizeof(_SmileysParseInfo));
@@ -207,7 +206,7 @@ int Smileys_DrawText(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT
-SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SortedList *plText, UINT uTextFormat, int max_smiley_height)
+SIZE GetTextSize(HDC hdcMem, const wchar_t *szText, SortedList *plText, UINT uTextFormat, int max_smiley_height)
{
SIZE text_size;
@@ -257,7 +256,7 @@ SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SortedList *plText, UINT uText
return text_size;
}
-void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, SortedList *plText, UINT uTextFormat, int max_smiley_height)
+void DrawTextSmiley(HDC hdcMem, RECT free_rc, const wchar_t *szText, int len, SortedList *plText, UINT uTextFormat, int max_smiley_height)
{
if (szText == NULL)
return;
@@ -388,7 +387,7 @@ void DestroySmileyList(SortedList* p_list)
// Generete the list of smileys / text to be drawn
-SortedList * ReplaceSmileys(const TCHAR *text, int text_size, const char *protocol, int *max_smiley_height)
+SortedList * ReplaceSmileys(const wchar_t *text, int text_size, const char *protocol, int *max_smiley_height)
{
*max_smiley_height = 0;
@@ -398,7 +397,7 @@ SortedList * ReplaceSmileys(const TCHAR *text, int text_size, const char *protoc
// Parse it!
SMADD_BATCHPARSE2 sp = { sizeof(sp) };
sp.Protocolname = protocol;
- sp.str = (TCHAR*)text;
+ sp.str = (wchar_t*)text;
sp.flag = SAFL_TCHAR;
SMADD_BATCHPARSERES *spres = (SMADD_BATCHPARSERES *)CallService(MS_SMILEYADD_BATCHPARSE, 0, (LPARAM)&sp);
if (spres == NULL)
@@ -408,12 +407,12 @@ SortedList * ReplaceSmileys(const TCHAR *text, int text_size, const char *protoc
// Lets add smileys
SortedList *plText = List_Create(0, 10);
- const TCHAR *next_text_pos = text;
- const TCHAR *last_text_pos = _tcsninc(text, text_size);
+ const wchar_t *next_text_pos = text;
+ const wchar_t *last_text_pos = _tcsninc(text, text_size);
for (unsigned int i = 0; i < sp.numSmileys; i++) {
- TCHAR* start = _tcsninc(text, spres[i].startChar);
- TCHAR* end = _tcsninc(start, spres[i].size);
+ wchar_t* start = _tcsninc(text, spres[i].startChar);
+ wchar_t* end = _tcsninc(start, spres[i].size);
if (spres[i].hIcon != NULL) { // For defective smileypacks
// Add text
diff --git a/utils/std_string_utils.cpp b/utils/std_string_utils.cpp
index 5991106b45..7a1e6b61b9 100644
--- a/utils/std_string_utils.cpp
+++ b/utils/std_string_utils.cpp
@@ -112,11 +112,11 @@ void utils::text::replace_all(std::string* data, const std::string &from, const
}
}
-void utils::text::treplace_all(std::tstring* data, const std::tstring &from, const std::tstring &to)
+void utils::text::treplace_all(std::wstring* data, const std::wstring &from, const std::wstring &to)
{
- std::tstring::size_type position = 0;
+ std::wstring::size_type position = 0;
- while ((position = data->find(from, position)) != std::tstring::npos)
+ while ((position = data->find(from, position)) != std::wstring::npos)
{
data->replace(position, from.size(), to);
position++;
@@ -379,19 +379,19 @@ std::string utils::text::source_get_form_data(std::string* data, boolean hiddenO
return values;
}
-std::tstring utils::text::prepare_name(const std::tstring &name, bool withSurnameLetter)
+std::wstring utils::text::prepare_name(const std::wstring &name, bool withSurnameLetter)
{
- std::tstring::size_type pos = name.find(L" ");
- if (pos == std::tstring::npos)
+ std::wstring::size_type pos = name.find(L" ");
+ if (pos == std::wstring::npos)
return name;
- std::tstring result = name.substr(0, pos);
+ std::wstring result = name.substr(0, pos);
if (withSurnameLetter) {
pos = name.rfind(L" ") + 1; // we're sure there is some space in name so we can do +1 safely
if (pos < name.length())
- result += L" " + name.substr(pos, 1) + std::tstring(L".");
+ result += L" " + name.substr(pos, 1) + std::wstring(L".");
}
return result;
diff --git a/utils/std_string_utils.h b/utils/std_string_utils.h
index af03718385..d9c1b4923a 100644
--- a/utils/std_string_utils.h
+++ b/utils/std_string_utils.h
@@ -63,7 +63,7 @@ namespace utils
{
void replace_first(std::string* data, const std::string &from, const std::string &to);
void replace_all(std::string* data, const std::string &from, const std::string &to);
- void treplace_all(std::tstring* data, const std::tstring &from, const std::tstring &to);
+ void treplace_all(std::wstring* data, const std::wstring &from, const std::wstring &to);
unsigned int count_all(std::string* data, const std::string &term);
std::string html_entities_decode(std::string data);
std::string remove_html(const std::string &data);
@@ -75,7 +75,7 @@ namespace utils
std::string rand_string(int len, const char *chars = "0123456789" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz", unsigned int *number = NULL);
void explode(std::string str, const std::string &separator, std::vector<std::string>* results);
void append_ordinal(unsigned long value, std::string* data);
- std::tstring prepare_name(const std::tstring &name, bool withSurnameLetter);
+ std::wstring prepare_name(const std::wstring &name, bool withSurnameLetter);
};
namespace conversion
diff --git a/utils/utf8_helpers.h b/utils/utf8_helpers.h
index 4928f04557..34ebfd5104 100644
--- a/utils/utf8_helpers.h
+++ b/utils/utf8_helpers.h
@@ -131,7 +131,7 @@ public:
throw L"Could not convert string to ACP";
}
- tchar = (TCHAR *) mir_alloc(size * sizeof(char));
+ tchar = (wchar_t *) mir_alloc(size * sizeof(char));
if (tchar == NULL)
{
mir_free(tmp);
@@ -151,30 +151,30 @@ public:
mir_free(tchar);
}
- TCHAR *detach()
+ wchar_t *detach()
{
- TCHAR *ret = tchar;
+ wchar_t *ret = tchar;
tchar = NULL;
return ret;
}
- TCHAR * get() const
+ wchar_t * get() const
{
return tchar;
}
- operator TCHAR *() const
+ operator wchar_t *() const
{
return tchar;
}
- TCHAR & operator[](int pos)
+ wchar_t & operator[](int pos)
{
return tchar[pos];
}
private:
- TCHAR *tchar;
+ wchar_t *tchar;
};
@@ -206,38 +206,38 @@ public:
#endif
}
- TCHAR *detach()
+ wchar_t *detach()
{
#ifdef UNICODE
- TCHAR *ret = tchar;
+ wchar_t *ret = tchar;
#else
- TCHAR *ret = (tchar == NULL ? NULL : mir_strdup(tchar));
+ wchar_t *ret = (tchar == NULL ? NULL : mir_strdup(tchar));
#endif
tchar = NULL;
return ret;
}
- const TCHAR * get() const
+ const wchar_t * get() const
{
return tchar;
}
- operator const TCHAR *() const
+ operator const wchar_t *() const
{
return tchar;
}
- const TCHAR & operator[](int pos) const
+ const wchar_t & operator[](int pos) const
{
return tchar[pos];
}
private:
#ifdef UNICODE
- TCHAR *tchar;
+ wchar_t *tchar;
#else
- const TCHAR *tchar;
+ const wchar_t *tchar;
#endif
};
@@ -270,38 +270,38 @@ public:
#endif
}
- TCHAR *detach()
+ wchar_t *detach()
{
#ifdef UNICODE
- TCHAR *ret = (tchar == NULL ? NULL : mir_wstrdup(tchar));
+ wchar_t *ret = (tchar == NULL ? NULL : mir_wstrdup(tchar));
#else
- TCHAR *ret = tchar;
+ wchar_t *ret = tchar;
#endif
tchar = NULL;
return ret;
}
- const TCHAR * get() const
+ const wchar_t * get() const
{
return tchar;
}
- operator const TCHAR *() const
+ operator const wchar_t *() const
{
return tchar;
}
- const TCHAR & operator[](int pos) const
+ const wchar_t & operator[](int pos) const
{
return tchar[pos];
}
private:
#ifdef UNICODE
- const TCHAR *tchar;
+ const wchar_t *tchar;
#else
- TCHAR *tchar;
+ wchar_t *tchar;
#endif
};
@@ -357,7 +357,7 @@ private:
class TcharToChar
{
public:
- TcharToChar(const TCHAR *str) : val(NULL)
+ TcharToChar(const wchar_t *str) : val(NULL)
{
if (str == NULL)
return;
@@ -421,7 +421,7 @@ private:
class TcharToWchar
{
public:
- TcharToWchar(const TCHAR *str) : val(NULL)
+ TcharToWchar(const wchar_t *str) : val(NULL)
{
if (str == NULL)
return;
@@ -534,7 +534,7 @@ public:
return ret;
}
- operator const TCHAR *()
+ operator const wchar_t *()
{
#ifdef UNICODE
@@ -569,7 +569,7 @@ private:
#ifndef UNICODE
- TCHAR *tchar;
+ wchar_t *tchar;
void freeTchar()
{