MCPcopy Create free account
hub / github.com/cxasm/notepad-- / CharToWchar

Function CharToWchar

src/cceditor/ccnotepad.cpp:6664–6674  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6662
6663#ifdef Q_OS_WIN
6664TCHAR* CharToWchar(const QString& str)
6665{
6666 QByteArray ba = str.toUtf8();
6667 char* data = ba.data(); //以上两步不能直接简化为“char *data = str.toUtf8().data();”
6668 int charLen = strlen(data);
6669 int len = MultiByteToWideChar(CP_ACP, 0, data, charLen, NULL, 0);
6670 TCHAR* buf = new TCHAR[len + 1];
6671 MultiByteToWideChar(CP_ACP, 0, data, charLen, buf, len);
6672 buf[len] = '\0';
6673 return buf;
6674}
6675#endif
6676
6677void CCNotePad::tailfile(bool isOn, ScintillaEditView* pEdit)

Callers 1

tailfileMethod · 0.85

Calls 1

dataMethod · 0.80

Tested by

no test coverage detected