Refactoring

This commit is contained in:
Changhua 2025-02-03 23:18:20 +08:00
parent 0fd3449894
commit ff1a8c9807

View File

@ -5,29 +5,42 @@
typedef uint64_t QWORD;
struct WxString {
class WxString
{
public:
const wchar_t *wptr;
DWORD size;
DWORD capacity;
const char *ptr;
DWORD clen;
WxString()
{
wptr = NULL;
wptr = nullptr;
size = 0;
capacity = 0;
ptr = NULL;
ptr = nullptr;
clen = 0;
}
WxString(std::wstring &ws)
WxString(std::wstring ws) : internal_ws(std::move(ws))
{
wptr = ws.c_str();
size = (DWORD)ws.size();
capacity = (DWORD)ws.capacity();
ptr = NULL;
wptr = internal_ws.c_str();
size = static_cast<DWORD>(internal_ws.size());
capacity = static_cast<DWORD>(internal_ws.capacity());
ptr = nullptr;
clen = 0;
}
WxString(const WxString &) = delete;
WxString &operator=(const WxString &) = delete;
WxString(WxString &&) noexcept = default;
WxString &operator=(WxString &&) noexcept = default;
private:
std::wstring internal_ws;
};
typedef struct RawVector {