mirror of
https://github.com/AxioDL/nod.git
synced 2025-12-15 08:06:23 +00:00
Massive libfmt refactor
This commit is contained in:
@@ -55,7 +55,7 @@ public:
|
||||
fp = CreateFile2(path.data(), GENERIC_WRITE, FILE_SHARE_WRITE, CREATE_ALWAYS, nullptr);
|
||||
#endif
|
||||
if (fp == INVALID_HANDLE_VALUE) {
|
||||
LogModule.report(logvisor::Error, _SYS_STR("unable to open '%s' for writing"), path.data());
|
||||
LogModule.report(logvisor::Error, fmt(_SYS_STR("unable to open '%s' for writing")), path.data());
|
||||
err = true;
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
fp = CreateFile2(path.data(), GENERIC_WRITE, FILE_SHARE_WRITE, OPEN_ALWAYS, nullptr);
|
||||
#endif
|
||||
if (fp == INVALID_HANDLE_VALUE) {
|
||||
LogModule.report(logvisor::Error, _SYS_STR("unable to open '%s' for writing"), path.data());
|
||||
LogModule.report(logvisor::Error, fmt(_SYS_STR("unable to open '%s' for writing")), path.data());
|
||||
err = true;
|
||||
return;
|
||||
}
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
LARGE_INTEGER res;
|
||||
SetFilePointerEx(fp, li, &res, FILE_CURRENT);
|
||||
if (res.QuadPart + int64_t(length) > m_maxWriteSize) {
|
||||
LogModule.report(logvisor::Error, _SYS_STR("write operation exceeds file's %" PRIi64 "-byte limit"),
|
||||
LogModule.report(logvisor::Error, fmt(_SYS_STR("write operation exceeds file's %" PRIi64 "-byte limit")),
|
||||
m_maxWriteSize);
|
||||
return 0;
|
||||
}
|
||||
@@ -120,7 +120,7 @@ public:
|
||||
#endif
|
||||
if (fp == INVALID_HANDLE_VALUE) {
|
||||
err = true;
|
||||
LogModule.report(logvisor::Error, _SYS_STR("unable to open '%s' for reading"), path.data());
|
||||
LogModule.report(logvisor::Error, fmt(_SYS_STR("unable to open '%s' for reading")), path.data());
|
||||
}
|
||||
}
|
||||
ReadStream(SystemStringView path, uint64_t offset, bool& err) : ReadStream(path, err) {
|
||||
@@ -153,11 +153,11 @@ public:
|
||||
while (length) {
|
||||
uint64_t thisSz = nod::min(uint64_t(0x7c00), length);
|
||||
if (read(buf, thisSz) != thisSz) {
|
||||
LogModule.report(logvisor::Error, "unable to read enough from file");
|
||||
LogModule.report(logvisor::Error, fmt("unable to read enough from file"));
|
||||
return written;
|
||||
}
|
||||
if (discio.write(buf, thisSz) != thisSz) {
|
||||
LogModule.report(logvisor::Error, "unable to write enough to disc");
|
||||
LogModule.report(logvisor::Error, fmt("unable to write enough to disc"));
|
||||
return written;
|
||||
}
|
||||
length -= thisSz;
|
||||
|
||||
Reference in New Issue
Block a user