mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Platform: Improve Windows wstring support
This commit is contained in:
committed by
Kyle Schwarz
parent
c5ba2d8d32
commit
f04cd16bee
@@ -1,4 +1,5 @@
|
||||
#include "icsneo/platform/windows/registry.h"
|
||||
#include "icsneo/platform/windows/strings.h"
|
||||
#include "icsneo/platform/windows.h"
|
||||
#include <codecvt>
|
||||
#include <vector>
|
||||
@@ -6,8 +7,6 @@
|
||||
|
||||
using namespace icsneo;
|
||||
|
||||
static std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
|
||||
|
||||
class Key {
|
||||
public:
|
||||
Key(std::wstring path, bool readwrite = false);
|
||||
@@ -95,8 +94,8 @@ bool Registry::Get(std::wstring path, std::wstring key, std::wstring& value) {
|
||||
|
||||
bool Registry::Get(std::string path, std::string key, std::string& value) {
|
||||
std::wstring wvalue;
|
||||
bool ret = Get(converter.from_bytes(path), converter.from_bytes(key), wvalue);
|
||||
value = converter.to_bytes(wvalue);
|
||||
bool ret = Get(convertStringToWide(path), convertStringToWide(key), wvalue);
|
||||
value = convertWideString(wvalue);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -116,5 +115,5 @@ bool Registry::Get(std::wstring path, std::wstring key, uint32_t& value) {
|
||||
}
|
||||
|
||||
bool Registry::Get(std::string path, std::string key, uint32_t& value) {
|
||||
return Get(converter.from_bytes(path), converter.from_bytes(key), value);
|
||||
return Get(convertStringToWide(path), convertStringToWide(key), value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user