mirror of
https://github.com/netchx/netch.git
synced 2026-04-29 21:59:34 +08:00
[Redirector] Optimize code
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include "Utils.h"
|
||||
|
||||
string ws2s(const wstring str)
|
||||
string ws2s(wstring str)
|
||||
{
|
||||
auto length = WideCharToMultiByte(CP_ACP, 0, str.c_str(), static_cast<int>(str.length()), NULL, 0, NULL, NULL);
|
||||
auto buffer = new char[length + 1]();
|
||||
@@ -13,7 +13,7 @@ string ws2s(const wstring str)
|
||||
return data;
|
||||
}
|
||||
|
||||
wstring s2ws(const string str)
|
||||
wstring s2ws(string str)
|
||||
{
|
||||
auto length = MultiByteToWideChar(CP_ACP, 0, str.c_str(), static_cast<int>(str.length()), NULL, 0);
|
||||
auto buffer = new wchar_t[length + 1]();
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
#define UTILS_H
|
||||
#include "Based.h"
|
||||
|
||||
string ws2s(const wstring str);
|
||||
wstring s2ws(const string str);
|
||||
string ws2s(wstring str);
|
||||
wstring s2ws(string str);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user