Update fmtlib

This commit is contained in:
Jack Andersen
2020-04-11 12:45:06 -10:00
parent dffcac50c5
commit 2783337c36
12 changed files with 105 additions and 105 deletions

View File

@@ -109,7 +109,7 @@ Node::Node(const IPartition& parent, const FSTNode& node, std::string_view name)
std::unique_ptr<IPartReadStream> Node::beginReadStream(uint64_t offset) const {
if (m_kind != Kind::File) {
LogModule.report(logvisor::Error, fmt("unable to stream a non-file {}"), m_name);
LogModule.report(logvisor::Error, FMT_STRING("unable to stream a non-file {}"), m_name);
return std::unique_ptr<IPartReadStream>();
}
return m_parent.beginReadStream(m_discOffset + offset);
@@ -117,7 +117,7 @@ std::unique_ptr<IPartReadStream> Node::beginReadStream(uint64_t offset) const {
std::unique_ptr<uint8_t[]> Node::getBuf() const {
if (m_kind != Kind::File) {
LogModule.report(logvisor::Error, fmt("unable to buffer a non-file {}"), m_name);
LogModule.report(logvisor::Error, FMT_STRING("unable to buffer a non-file {}"), m_name);
return nullptr;
}
@@ -135,7 +135,7 @@ bool Node::extractToDirectory(SystemStringView basePath, const ExtractionContext
if (ctx.progressCB && !getName().empty())
ctx.progressCB(getName(), m_parent.m_curNodeIdx / float(m_parent.getNodeCount()));
if (Mkdir(path.c_str(), 0755) && errno != EEXIST) {
LogModule.report(logvisor::Error, fmt(_SYS_STR("unable to mkdir '{}'")), path);
LogModule.report(logvisor::Error, FMT_STRING(_SYS_STR("unable to mkdir '{}'")), path);
return false;
}
for (Node& subnode : *this)
@@ -164,14 +164,14 @@ bool Node::extractToDirectory(SystemStringView basePath, const ExtractionContext
bool IPartition::extractToDirectory(SystemStringView path, const ExtractionContext& ctx) {
m_curNodeIdx = 0;
if (Mkdir(path.data(), 0755) && errno != EEXIST) {
LogModule.report(logvisor::Error, fmt(_SYS_STR("unable to mkdir '{}'")), path);
LogModule.report(logvisor::Error, FMT_STRING(_SYS_STR("unable to mkdir '{}'")), path);
return false;
}
SystemString basePath = m_isWii ? SystemString(path) + _SYS_STR("/") + getKindString(m_kind) : SystemString(path);
if (m_isWii) {
if (Mkdir(basePath.c_str(), 0755) && errno != EEXIST) {
LogModule.report(logvisor::Error, fmt(_SYS_STR("unable to mkdir '{}'")), basePath);
LogModule.report(logvisor::Error, FMT_STRING(_SYS_STR("unable to mkdir '{}'")), basePath);
return false;
}
}
@@ -190,7 +190,7 @@ bool IPartition::extractToDirectory(SystemStringView path, const ExtractionConte
/* Extract Filesystem */
SystemString fsPath = basePath + _SYS_STR("/files");
if (Mkdir(fsPath.c_str(), 0755) && errno != EEXIST) {
LogModule.report(logvisor::Error, fmt(_SYS_STR("unable to mkdir '{}'")), fsPath);
LogModule.report(logvisor::Error, FMT_STRING(_SYS_STR("unable to mkdir '{}'")), fsPath);
return false;
}
@@ -200,7 +200,7 @@ bool IPartition::extractToDirectory(SystemStringView path, const ExtractionConte
bool IPartition::extractSysFiles(SystemStringView basePath, const ExtractionContext& ctx) const {
SystemString basePathStr(basePath);
if (Mkdir((basePathStr + _SYS_STR("/sys")).c_str(), 0755) && errno != EEXIST) {
LogModule.report(logvisor::Error, fmt(_SYS_STR("unable to mkdir '{}/sys'")), basePath);
LogModule.report(logvisor::Error, FMT_STRING(_SYS_STR("unable to mkdir '{}/sys'")), basePath);
return false;
}
@@ -712,7 +712,7 @@ bool DiscBuilderBase::PartitionBuilderBase::RecursiveCalculateTotalSize(uint64_t
bool DiscBuilderBase::PartitionBuilderBase::buildFromDirectory(IPartWriteStream& ws, SystemStringView dirIn) {
if (dirIn.empty()) {
LogModule.report(logvisor::Error, fmt(_SYS_STR("all arguments must be supplied to buildFromDirectory()")));
LogModule.report(logvisor::Error, FMT_STRING(_SYS_STR("all arguments must be supplied to buildFromDirectory()")));
return false;
}
@@ -737,7 +737,7 @@ bool DiscBuilderBase::PartitionBuilderBase::buildFromDirectory(IPartWriteStream&
{
Sstat dolStat;
if (Stat(dolIn.c_str(), &dolStat)) {
LogModule.report(logvisor::Error, fmt(_SYS_STR("unable to stat {}")), dolIn);
LogModule.report(logvisor::Error, FMT_STRING(_SYS_STR("unable to stat {}")), dolIn);
return false;
}
size_t fileSz = ROUND_UP_32(dolStat.st_size);
@@ -778,7 +778,7 @@ std::optional<uint64_t> DiscBuilderBase::PartitionBuilderBase::CalculateTotalSiz
Sstat dolStat;
if (Stat(dolIn.c_str(), &dolStat)) {
LogModule.report(logvisor::Error, fmt(_SYS_STR("unable to stat {}")), dolIn);
LogModule.report(logvisor::Error, FMT_STRING(_SYS_STR("unable to stat {}")), dolIn);
return std::nullopt;
}
uint64_t totalSz = ROUND_UP_32(dolStat.st_size);
@@ -790,7 +790,7 @@ std::optional<uint64_t> DiscBuilderBase::PartitionBuilderBase::CalculateTotalSiz
bool DiscBuilderBase::PartitionBuilderBase::mergeFromDirectory(IPartWriteStream& ws, const IPartition* partIn,
SystemStringView dirIn) {
if (dirIn.empty()) {
LogModule.report(logvisor::Error, fmt(_SYS_STR("all arguments must be supplied to mergeFromDirectory()")));
LogModule.report(logvisor::Error, FMT_STRING(_SYS_STR("all arguments must be supplied to mergeFromDirectory()")));
return false;
}