[*] Improve alt-AuString allocator awareness
This commit is contained in:
parent
83f34b0c47
commit
e7d9df3cab
@ -34,13 +34,19 @@ namespace Aurora::Console
|
|||||||
time = 0;
|
time = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline ConsoleMessage(const AuString &prefix, const AuString &line) : prefix(prefix), line(line), color(EAnsiColor::eReset)
|
inline ConsoleMessage(const AuROString &prefix, const AuROString &line) :
|
||||||
|
prefix(prefix),
|
||||||
|
line(line),
|
||||||
|
color(EAnsiColor::eReset)
|
||||||
{
|
{
|
||||||
time = Time::CurrentClockMS();
|
time = Time::CurrentClockMS();
|
||||||
tid = Threading::Threads::GetThreadId();
|
tid = Threading::Threads::GetThreadId();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline ConsoleMessage(const EAnsiColor color, const AuString &prefix, const AuString &line) : prefix(prefix), line(line), color(color)
|
inline ConsoleMessage(const EAnsiColor color, const AuROString &prefix, const AuROString &line) :
|
||||||
|
prefix(prefix),
|
||||||
|
line(line),
|
||||||
|
color(color)
|
||||||
{
|
{
|
||||||
time = Time::CurrentClockMS();
|
time = Time::CurrentClockMS();
|
||||||
tid = Threading::Threads::GetThreadId();
|
tid = Threading::Threads::GetThreadId();
|
||||||
|
@ -51,7 +51,7 @@ namespace Aurora::Data
|
|||||||
case EDataType::kTypeBoolean:
|
case EDataType::kTypeBoolean:
|
||||||
return value.primitive.boolean ? "true" : "false";
|
return value.primitive.boolean ? "true" : "false";
|
||||||
case EDataType::kTypeUUID:
|
case EDataType::kTypeUUID:
|
||||||
return uuids::to_string(value.UUID);
|
return AuString(uuids::to_string(value.UUID));
|
||||||
case EDataType::kTypeVec3:
|
case EDataType::kTypeVec3:
|
||||||
return AuToString(value.primitive.vec3[0]) + "." +
|
return AuToString(value.primitive.vec3[0]) + "." +
|
||||||
AuToString(value.primitive.vec3[1]) + "." +
|
AuToString(value.primitive.vec3[1]) + "." +
|
||||||
|
@ -29,7 +29,7 @@ namespace Aurora::HWInfo
|
|||||||
#if defined(_AU_MASSIVE_CPUID)
|
#if defined(_AU_MASSIVE_CPUID)
|
||||||
return fmt::format("{4:#0{0}b} {3:#0{0}b} {2:#0{0}b} {1:#0{0}b}", sizeof(decltype(lower)) * 8, lower, upper, upper2, upper3);
|
return fmt::format("{4:#0{0}b} {3:#0{0}b} {2:#0{0}b} {1:#0{0}b}", sizeof(decltype(lower)) * 8, lower, upper, upper2, upper3);
|
||||||
#else
|
#else
|
||||||
return fmt::format("{2:#0{0}b} {1:#0{0}b}", sizeof(decltype(lower)) * 8, lower, upper);
|
return AuString(fmt::format("{2:#0{0}b} {1:#0{0}b}", sizeof(decltype(lower)) * 8, lower, upper));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,8 @@
|
|||||||
namespace Aurora::IO::NT
|
namespace Aurora::IO::NT
|
||||||
{
|
{
|
||||||
AUKN_SYM AuString ShareFileDescriptor(HANDLE hHandle);
|
AUKN_SYM AuString ShareFileDescriptor(HANDLE hHandle);
|
||||||
AUKN_SYM void ShareFileDescriptorStop(const AuString &handle);
|
|
||||||
|
|
||||||
AUKN_SYM HANDLE ShareFileDescriptorAccept(const AuString &handle);
|
AUKN_SYM void ShareFileDescriptorStop(const AuROString &handle);
|
||||||
|
|
||||||
|
AUKN_SYM HANDLE ShareFileDescriptorAccept(const AuROString &handle);
|
||||||
}
|
}
|
@ -35,7 +35,7 @@ namespace Aurora::Logging
|
|||||||
#if defined(_AUHAS_FMT)
|
#if defined(_AUHAS_FMT)
|
||||||
|
|
||||||
template<typename ... T>
|
template<typename ... T>
|
||||||
inline void WriteLinef(AuUInt8 level, const AuString &tag, fmt::format_string<T...> msg, T&& ... args)
|
inline void WriteLinef(AuUInt8 level, const AuROString &tag, fmt::format_string<T...> msg, T&& ... args)
|
||||||
{
|
{
|
||||||
AU_DEBUG_MEMCRUNCH;
|
AU_DEBUG_MEMCRUNCH;
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ namespace Aurora::Logging
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename ... T>
|
template<typename ... T>
|
||||||
inline void WriteLinef(AuUInt8 level, EAnsiColor color, const AuString &tag, fmt::format_string<T...> msg, T&& ... args)
|
inline void WriteLinef(AuUInt8 level, EAnsiColor color, const AuROString &tag, fmt::format_string<T...> msg, T&& ... args)
|
||||||
{
|
{
|
||||||
AU_DEBUG_MEMCRUNCH;
|
AU_DEBUG_MEMCRUNCH;
|
||||||
|
|
||||||
|
@ -25,11 +25,11 @@ namespace Aurora::Console
|
|||||||
|
|
||||||
if (simple)
|
if (simple)
|
||||||
{
|
{
|
||||||
return fmt::format("{:%H:%M:%S}", localized);
|
return AuString(fmt::format("{:%H:%M:%S}", localized));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return fmt::format("{:%Y-%m-%d %H:%M:%S}", localized);
|
return AuString(fmt::format("{:%Y-%m-%d %H:%M:%S}", localized));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
@ -84,22 +84,22 @@ namespace Aurora::Console
|
|||||||
return this->ToPersistentString();
|
return this->ToPersistentString();
|
||||||
}
|
}
|
||||||
|
|
||||||
return fmt::format("[{}] {:<8} | {}",
|
return AuString(fmt::format("[{}] {:<8} | {}",
|
||||||
StringifyTime(gRuntimeConfig.console.bStdOutShortTime),
|
StringifyTime(gRuntimeConfig.console.bStdOutShortTime),
|
||||||
GetWrappedTag(),
|
GetWrappedTag(),
|
||||||
this->line);
|
this->line));
|
||||||
}
|
}
|
||||||
|
|
||||||
AuString ConsoleMessage::ToPersistentString() const
|
AuString ConsoleMessage::ToPersistentString() const
|
||||||
{
|
{
|
||||||
return fmt::format("[{}] {:<8} | {}",
|
return AuString(fmt::format("[{}] {:<8} | {}",
|
||||||
StringifyTimeUTC(),
|
StringifyTimeUTC(),
|
||||||
GetWrappedTag(),
|
GetWrappedTag(),
|
||||||
this->line);
|
this->line));
|
||||||
}
|
}
|
||||||
|
|
||||||
AuString ConsoleMessage::ToSimplified() const
|
AuString ConsoleMessage::ToSimplified() const
|
||||||
{
|
{
|
||||||
return fmt::format("{:<9} {:<8} | {}", StringifyTime(true), GetWrappedTag(), this->line);
|
return AuString(fmt::format("{:<9} {:<8} | {}", StringifyTime(true), GetWrappedTag(), this->line));
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1437,7 +1437,7 @@ namespace Aurora::Console::ConsoleTTY
|
|||||||
void TTYConsole::WriteLine(int Y, const AuString &in)
|
void TTYConsole::WriteLine(int Y, const AuString &in)
|
||||||
{
|
{
|
||||||
#if defined(AURORA_IS_MODERNNT_DERIVED)
|
#if defined(AURORA_IS_MODERNNT_DERIVED)
|
||||||
RecordFunction(std::bind(&TTYConsole::WriteLine, this, Y, std::string(in)));
|
RecordFunction(std::bind(&TTYConsole::WriteLine, this, Y, AuString(in)));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (in.empty())
|
if (in.empty())
|
||||||
@ -1486,7 +1486,7 @@ namespace Aurora::Console::ConsoleTTY
|
|||||||
void TTYConsole::WriteBuffered(AuPair<AuUInt32, AuUInt32> pos, const AuString &in)
|
void TTYConsole::WriteBuffered(AuPair<AuUInt32, AuUInt32> pos, const AuString &in)
|
||||||
{
|
{
|
||||||
#if defined(AURORA_IS_MODERNNT_DERIVED)
|
#if defined(AURORA_IS_MODERNNT_DERIVED)
|
||||||
RecordFunction(std::bind(&TTYConsole::WriteBuffered, this, pos, std::string(in)));
|
RecordFunction(std::bind(&TTYConsole::WriteBuffered, this, pos, AuString(in)));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (in.empty())
|
if (in.empty())
|
||||||
@ -1510,7 +1510,7 @@ namespace Aurora::Console::ConsoleTTY
|
|||||||
void TTYConsole::WriteBufferedEx(AuPair<AuUInt32, AuUInt32> pos, EAnsiColor color, const AuString &in)
|
void TTYConsole::WriteBufferedEx(AuPair<AuUInt32, AuUInt32> pos, EAnsiColor color, const AuString &in)
|
||||||
{
|
{
|
||||||
#if defined(AURORA_IS_MODERNNT_DERIVED)
|
#if defined(AURORA_IS_MODERNNT_DERIVED)
|
||||||
RecordFunction(std::bind(&TTYConsole::WriteBufferedEx, this, pos, color, std::string(in)));
|
RecordFunction(std::bind(&TTYConsole::WriteBufferedEx, this, pos, color, AuString(in)));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (in.empty())
|
if (in.empty())
|
||||||
|
@ -310,7 +310,7 @@ namespace Aurora::HWInfo
|
|||||||
|
|
||||||
AuString CpuId::ToString() const
|
AuString CpuId::ToString() const
|
||||||
{
|
{
|
||||||
return fmt::format(
|
return AuString(fmt::format(
|
||||||
"FMA {}\t\tFSGSBASE {}\t\tCLFSH {}\t\t\tERMS {}{}"
|
"FMA {}\t\tFSGSBASE {}\t\tCLFSH {}\t\t\tERMS {}{}"
|
||||||
"CMPXCHG16B {}\t\tAVX512PF {}\t\tMOVBE {}\t\t\tRTM {}{}"
|
"CMPXCHG16B {}\t\tAVX512PF {}\t\tMOVBE {}\t\t\tRTM {}{}"
|
||||||
"POPCNT {}\t\tAVX512ER {}\t\tMONITOR {}\t\t\tLAHF {}{}"
|
"POPCNT {}\t\tAVX512ER {}\t\tMONITOR {}\t\t\tLAHF {}{}"
|
||||||
@ -337,7 +337,7 @@ namespace Aurora::HWInfo
|
|||||||
AVX(), AVX512F(), BMI1(), INVPCID(), Aurora::Locale::NewLine(),
|
AVX(), AVX512F(), BMI1(), INVPCID(), Aurora::Locale::NewLine(),
|
||||||
AVX2(), LZCNT(), HLE(), _3DNOWEXT(), Aurora::Locale::NewLine(),
|
AVX2(), LZCNT(), HLE(), _3DNOWEXT(), Aurora::Locale::NewLine(),
|
||||||
MMX(), ADX(), BMI2(), _3DNOW()
|
MMX(), ADX(), BMI2(), _3DNOW()
|
||||||
);
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
AuUInt32 GetCPUIDAPICDCores()
|
AuUInt32 GetCPUIDAPICDCores()
|
||||||
|
@ -88,7 +88,7 @@ namespace Aurora::IO::FS
|
|||||||
utf8Root.pop_back();
|
utf8Root.pop_back();
|
||||||
}
|
}
|
||||||
|
|
||||||
return utf8Root;
|
return AuString(utf8Root);
|
||||||
}
|
}
|
||||||
|
|
||||||
AUKN_SYM AuResult<AuString> GetDeviceFromRoot(const AuString& root)
|
AUKN_SYM AuResult<AuString> GetDeviceFromRoot(const AuString& root)
|
||||||
@ -112,7 +112,7 @@ namespace Aurora::IO::FS
|
|||||||
// Only a subset of FIXED disks get a \\.\PhysicalDevice
|
// Only a subset of FIXED disks get a \\.\PhysicalDevice
|
||||||
// The path we currently have is usually good enough for whatever IOCTLs we need to send (the same cant be said for fixed disks tho)
|
// The path we currently have is usually good enough for whatever IOCTLs we need to send (the same cant be said for fixed disks tho)
|
||||||
// (they fail; they need the following...)
|
// (they fail; they need the following...)
|
||||||
return utf8Root;
|
return AuString(utf8Root);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto hFile = Win32Open(widePath.c_str(),
|
auto hFile = Win32Open(widePath.c_str(),
|
||||||
@ -153,7 +153,7 @@ namespace Aurora::IO::FS
|
|||||||
|
|
||||||
if (extents.NumberOfDiskExtents)
|
if (extents.NumberOfDiskExtents)
|
||||||
{
|
{
|
||||||
return fmt::format("\\\\.\\PhysicalDrive{}", extents.Extents->DiskNumber);
|
return AuString(fmt::format("\\\\.\\PhysicalDrive{}", extents.Extents->DiskNumber));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -89,7 +89,7 @@ namespace Aurora::IO::IPC
|
|||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPCHandle::FromString(const AuString &in)
|
bool IPCHandle::FromString(const AuROString &in)
|
||||||
{
|
{
|
||||||
AuString nextToken;
|
AuString nextToken;
|
||||||
AuUInt nextInt;
|
AuUInt nextInt;
|
||||||
|
@ -83,7 +83,7 @@ namespace Aurora::IO::IPC
|
|||||||
|
|
||||||
AuList<IPCValue> values;
|
AuList<IPCValue> values;
|
||||||
|
|
||||||
bool FromString(const AuString &in);
|
bool FromString(const AuROString &in);
|
||||||
|
|
||||||
AuString ToString() const;
|
AuString ToString() const;
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ namespace Aurora::IO::NT
|
|||||||
static AuThreads::ThreadUnique_t gServerThread {};
|
static AuThreads::ThreadUnique_t gServerThread {};
|
||||||
static const auto kDefaultMessageSize = 8192u;
|
static const auto kDefaultMessageSize = 8192u;
|
||||||
|
|
||||||
static AuString GetIPCServerNameOfPid(AuUInt32 uPid)
|
static auto GetIPCServerNameOfPid(AuUInt32 uPid)
|
||||||
{
|
{
|
||||||
#if defined(AURORA_PLATFORM_WIN32)
|
#if defined(AURORA_PLATFORM_WIN32)
|
||||||
return fmt::format("\\\\.\\pipe\\_HANDLESOF_{}", uPid);
|
return fmt::format("\\\\.\\pipe\\_HANDLESOF_{}", uPid);
|
||||||
@ -312,7 +312,7 @@ namespace Aurora::IO::NT
|
|||||||
return handle.ToString();
|
return handle.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
AUKN_SYM void ShareFileDescriptorStop(const AuString &handle)
|
AUKN_SYM void ShareFileDescriptorStop(const AuROString &handle)
|
||||||
{
|
{
|
||||||
IPC::IPCHandle handle2;
|
IPC::IPCHandle handle2;
|
||||||
if (!handle2.FromString(handle))
|
if (!handle2.FromString(handle))
|
||||||
@ -331,7 +331,7 @@ namespace Aurora::IO::NT
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AUKN_SYM HANDLE ShareFileDescriptorAccept(const AuString &handle)
|
AUKN_SYM HANDLE ShareFileDescriptorAccept(const AuROString &handle)
|
||||||
{
|
{
|
||||||
IPC::IPCHandle handle2;
|
IPC::IPCHandle handle2;
|
||||||
HANDLE hHandle { INVALID_HANDLE_VALUE };
|
HANDLE hHandle { INVALID_HANDLE_VALUE };
|
||||||
|
@ -97,9 +97,9 @@ namespace Aurora::IO::Net
|
|||||||
switch (this->ip)
|
switch (this->ip)
|
||||||
{
|
{
|
||||||
case EIPProtocol::eIPProtocolV4:
|
case EIPProtocol::eIPProtocolV4:
|
||||||
return fmt::format("{}.{}.{}.{}", this->v4[0], this->v4[1], this->v4[2], this->v4[3]);
|
return AuString(fmt::format("{}.{}.{}.{}", this->v4[0], this->v4[1], this->v4[2], this->v4[3]));
|
||||||
case EIPProtocol::eIPProtocolV6:
|
case EIPProtocol::eIPProtocolV6:
|
||||||
return fmt::format("{:04x}:{:04x}:{:04x}:{:04x}:{:04x}:{:04x}:{:04x}:{:04x}", this->v6[0], this->v6[1], this->v6[2], this->v6[3], this->v6[4], this->v6[5], this->v6[6], this->v6[7]);
|
return AuString(fmt::format("{:04x}:{:04x}:{:04x}:{:04x}:{:04x}:{:04x}:{:04x}:{:04x}", this->v6[0], this->v6[1], this->v6[2], this->v6[3], this->v6[4], this->v6[5], this->v6[6], this->v6[7]));
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
@ -204,7 +204,7 @@ namespace Aurora::IO::Net
|
|||||||
|
|
||||||
AUKN_SYM AuString NetErrorToExtendedString(const NetError &error)
|
AUKN_SYM AuString NetErrorToExtendedString(const NetError &error)
|
||||||
{
|
{
|
||||||
return fmt::format("error: {}, code: 0x{:x}, os: {}", NetErrorToString(error), error.osError, StringifyOSError(error.osError));
|
return AuString(fmt::format("error: {}, code: 0x{:x}, os: {}", NetErrorToString(error), error.osError, StringifyOSError(error.osError)));
|
||||||
}
|
}
|
||||||
|
|
||||||
AUKN_SYM AuString NetErrorToString(const NetError &error)
|
AUKN_SYM AuString NetErrorToString(const NetError &error)
|
||||||
|
@ -172,13 +172,13 @@ namespace Aurora::Locale
|
|||||||
bool simple = time.mday == 0 && time.mon == 0 && time.year == 0;
|
bool simple = time.mday == 0 && time.mon == 0 && time.year == 0;
|
||||||
if (simple)
|
if (simple)
|
||||||
{
|
{
|
||||||
return fmt::format("{:02}-{:02}-{:02}", time.hour, time.min, time.sec);
|
return AuString(fmt::format("{:02}-{:02}-{:02}", time.hour, time.min, time.sec));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Hard-code ISO-8601 locale because, the Americans locale doesn't make any sense whatsoever, and east asia has the right idea
|
// Hard-code ISO-8601 locale because, the Americans locale doesn't make any sense whatsoever, and east asia has the right idea
|
||||||
// EU users and burgers seethe... we normalize one sane standard to disambiguate this shit across locale boundaries
|
// EU users and burgers seethe... we normalize one sane standard to disambiguate this shit across locale boundaries
|
||||||
return fmt::format("{:04}-{:02}-{:02} {:02}-{:02}-{:02}", time.year, time.mon + 1, time.mday + 1, time.hour, time.min, time.sec);
|
return AuString(fmt::format("{:04}-{:02}-{:02} {:02}-{:02}-{:02}", time.year, time.mon + 1, time.mday + 1, time.hour, time.min, time.sec));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
@ -194,9 +194,9 @@ namespace Aurora::Locale
|
|||||||
{
|
{
|
||||||
AuString tz {};
|
AuString tz {};
|
||||||
auto tnorm = AuTime::NormalizeCivilTimezone(time, shift);
|
auto tnorm = AuTime::NormalizeCivilTimezone(time, shift);
|
||||||
return fmt::format("{:04}-{:02}-{:02}T{:02}-{:02}-{:02}Z",
|
return AuString(fmt::format("{:04}-{:02}-{:02}T{:02}-{:02}-{:02}Z",
|
||||||
tnorm.year, tnorm.mon + 1, tnorm.mday + 1,
|
tnorm.year, tnorm.mon + 1, tnorm.mday + 1,
|
||||||
tnorm.hour, tnorm.min, tnorm.sec);
|
tnorm.hour, tnorm.min, tnorm.sec));
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
@ -211,9 +211,9 @@ namespace Aurora::Locale
|
|||||||
{
|
{
|
||||||
AuString tz {};
|
AuString tz {};
|
||||||
auto tnorm = AuTime::NormalizeCivilTimezone(time, shift);
|
auto tnorm = AuTime::NormalizeCivilTimezone(time, shift);
|
||||||
return fmt::format("{:04}-{:02}-{:02}T{:02}:{:02}:{:02}Z",
|
return AuString(fmt::format("{:04}-{:02}-{:02}T{:02}:{:02}:{:02}Z",
|
||||||
tnorm.year, tnorm.mon + 1, tnorm.mday + 1,
|
tnorm.year, tnorm.mon + 1, tnorm.mday + 1,
|
||||||
tnorm.hour, tnorm.min, tnorm.sec);
|
tnorm.hour, tnorm.min, tnorm.sec));
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
|
@ -786,7 +786,7 @@ namespace Aurora::Parse
|
|||||||
{
|
{
|
||||||
if (bZeroX)
|
if (bZeroX)
|
||||||
{
|
{
|
||||||
auto str = fmt::format("{0:#X}", in);
|
auto str = AuString(fmt::format("{0:#X}", in));
|
||||||
if (str.size() > 2)
|
if (str.size() > 2)
|
||||||
{
|
{
|
||||||
if (str[1] == 'X')
|
if (str[1] == 'X')
|
||||||
@ -802,7 +802,7 @@ namespace Aurora::Parse
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return fmt::format("{:X}", in);
|
return AuString(fmt::format("{:X}", in));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -810,7 +810,7 @@ namespace Aurora::Parse
|
|||||||
{
|
{
|
||||||
if (bZeroX)
|
if (bZeroX)
|
||||||
{
|
{
|
||||||
auto str = fmt::format("{0:#X}", in);
|
auto str = AuString(fmt::format("{0:#X}", in));
|
||||||
if (str.size() > 2)
|
if (str.size() > 2)
|
||||||
{
|
{
|
||||||
if (str[1] == 'X')
|
if (str[1] == 'X')
|
||||||
@ -826,7 +826,7 @@ namespace Aurora::Parse
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return fmt::format("{:X}", in);
|
return AuString(fmt::format("{:X}", in));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,12 +137,12 @@ namespace Aurora::Registry
|
|||||||
{
|
{
|
||||||
if (read == EReadType::eStoreNew)
|
if (read == EReadType::eStoreNew)
|
||||||
{
|
{
|
||||||
if (cacheDocument_.find(key) != cacheDocument_.end())
|
if (cacheDocument_.find(AuROString(key)) != cacheDocument_.end())
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cacheDocument_[key] = value;
|
cacheDocument_[AuROString(key)] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -157,7 +157,7 @@ namespace Aurora::Registry
|
|||||||
{
|
{
|
||||||
AU_LOCK_GUARD(lock_->AsReadable());
|
AU_LOCK_GUARD(lock_->AsReadable());
|
||||||
|
|
||||||
auto itrObject = cacheDocument_.find(key);
|
auto itrObject = cacheDocument_.find(AuROString(key));
|
||||||
if (itrObject == cacheDocument_.end())
|
if (itrObject == cacheDocument_.end())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@ -178,7 +178,7 @@ namespace Aurora::Registry
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FSRegistry::GetOrCreateKey(const AuString &key, const RegistryValue &ref, RegistryValue &value)
|
bool FSRegistry::GetOrCreateKey(const AuString &key, const RegistryValue &ref, RegistryValue &value)
|
||||||
{
|
{
|
||||||
AU_LOCK_GUARD(lock_->AsWritable());
|
AU_LOCK_GUARD(lock_->AsWritable());
|
||||||
|
|
||||||
@ -199,7 +199,7 @@ namespace Aurora::Registry
|
|||||||
|
|
||||||
bool FSRegistry::GetKeyLocked(const AuString &key, RegistryValue &value)
|
bool FSRegistry::GetKeyLocked(const AuString &key, RegistryValue &value)
|
||||||
{
|
{
|
||||||
auto itrObject = cacheDocument_.find(key);
|
auto itrObject = cacheDocument_.find(AuROString(key));
|
||||||
if (itrObject == cacheDocument_.end())
|
if (itrObject == cacheDocument_.end())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@ -259,7 +259,7 @@ namespace Aurora::Registry
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto oldValueItr = cacheDocument_.find(key);
|
auto oldValueItr = cacheDocument_.find(AuROString(key));
|
||||||
bool hasOldValue = oldValueItr == cacheDocument_.end();
|
bool hasOldValue = oldValueItr == cacheDocument_.end();
|
||||||
json oldValue = hasOldValue ? json{} : *oldValueItr;
|
json oldValue = hasOldValue ? json{} : *oldValueItr;
|
||||||
|
|
||||||
@ -272,11 +272,11 @@ namespace Aurora::Registry
|
|||||||
switch (writeMode_)
|
switch (writeMode_)
|
||||||
{
|
{
|
||||||
case EWriteMode::eWriteModeFileBuffer:
|
case EWriteMode::eWriteModeFileBuffer:
|
||||||
cacheDocument_[key] = object;
|
cacheDocument_[AuROString(key)] = object;
|
||||||
break;
|
break;
|
||||||
case EWriteMode::eWriteModeFileStream:
|
case EWriteMode::eWriteModeFileStream:
|
||||||
cacheDocument_[key] = object;
|
cacheDocument_[AuROString(key)] = object;
|
||||||
currentStreamDocument_[key] = object;
|
currentStreamDocument_[AuROString(key)] = object;
|
||||||
Save();
|
Save();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -292,7 +292,7 @@ namespace Aurora::Registry
|
|||||||
|
|
||||||
for (const auto &change : changes_)
|
for (const auto &change : changes_)
|
||||||
{
|
{
|
||||||
currentStreamDocument_[change] = cacheDocument_[change];
|
currentStreamDocument_[AuROString(change)] = cacheDocument_[AuROString(change)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Save();
|
Save();
|
||||||
@ -305,7 +305,7 @@ namespace Aurora::Registry
|
|||||||
|
|
||||||
for (const auto &[key, val] : cacheDocument_.items())
|
for (const auto &[key, val] : cacheDocument_.items())
|
||||||
{
|
{
|
||||||
AuTryInsert(changes_, key);
|
AuTryInsert(changes_, AuString(key));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user