mirror of
https://github.com/AxioDL/nod.git
synced 2025-12-08 21:17:51 +00:00
Update fmtlib
This commit is contained in:
@@ -41,7 +41,7 @@ public:
|
||||
WriteStream(SystemStringView path, int64_t maxWriteSize, bool& err) : m_maxWriteSize(maxWriteSize) {
|
||||
fp = Fopen(path.data(), _SYS_STR("wb"));
|
||||
if (!fp) {
|
||||
LogModule.report(logvisor::Error, fmt(_SYS_STR("unable to open '{}' for writing")), path);
|
||||
LogModule.report(logvisor::Error, FMT_STRING(_SYS_STR("unable to open '{}' for writing")), path);
|
||||
err = true;
|
||||
}
|
||||
}
|
||||
@@ -57,14 +57,14 @@ public:
|
||||
FSeek(fp, offset, SEEK_SET);
|
||||
return;
|
||||
FailLoc:
|
||||
LogModule.report(logvisor::Error, fmt(_SYS_STR("unable to open '{}' for writing")), path);
|
||||
LogModule.report(logvisor::Error, FMT_STRING(_SYS_STR("unable to open '{}' for writing")), path);
|
||||
err = true;
|
||||
}
|
||||
~WriteStream() override { fclose(fp); }
|
||||
uint64_t write(const void* buf, uint64_t length) override {
|
||||
if (m_maxWriteSize >= 0) {
|
||||
if (FTell(fp) + length > m_maxWriteSize) {
|
||||
LogModule.report(logvisor::Error, fmt(_SYS_STR("write operation exceeds file's {}-byte limit")),
|
||||
LogModule.report(logvisor::Error, FMT_STRING(_SYS_STR("write operation exceeds file's {}-byte limit")),
|
||||
m_maxWriteSize);
|
||||
return 0;
|
||||
}
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
fp = Fopen(path.data(), _SYS_STR("rb"));
|
||||
if (!fp) {
|
||||
err = true;
|
||||
LogModule.report(logvisor::Error, fmt(_SYS_STR("unable to open '{}' for reading")), path);
|
||||
LogModule.report(logvisor::Error, FMT_STRING(_SYS_STR("unable to open '{}' for reading")), path);
|
||||
}
|
||||
}
|
||||
ReadStream(SystemStringView path, uint64_t offset, bool& err) : ReadStream(path, err) {
|
||||
@@ -117,11 +117,11 @@ public:
|
||||
while (length) {
|
||||
uint64_t thisSz = nod::min(uint64_t(0x7c00), length);
|
||||
if (read(buf, thisSz) != thisSz) {
|
||||
LogModule.report(logvisor::Error, fmt("unable to read enough from file"));
|
||||
LogModule.report(logvisor::Error, FMT_STRING("unable to read enough from file"));
|
||||
return written;
|
||||
}
|
||||
if (discio.write(buf, thisSz) != thisSz) {
|
||||
LogModule.report(logvisor::Error, fmt("unable to write enough to disc"));
|
||||
LogModule.report(logvisor::Error, FMT_STRING("unable to write enough to disc"));
|
||||
return written;
|
||||
}
|
||||
length -= thisSz;
|
||||
|
||||
Reference in New Issue
Block a user