mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-11-15 10:40:22 +01:00
Downgrade to C++20 & switch to fmtlib.
This commit is contained in:
1 parent
1ab25d5b41
commit
4b728f4a2b
21 files changed
+70
-69
No files matched your search
@@ -72,14 +72,14 @@ static bool copyFile(const FilePair &pair, const uint64_t *fileHashes, VirtualFi
|
||||
if (!sourceVfs.exists(filename))
|
||||
{
|
||||
journal.lastResult = Journal::Result::FileMissing;
|
||||
journal.lastErrorMessage = std::format("File {} does not exist in the file system.", filename);
|
||||
journal.lastErrorMessage = fmt::format("File {} does not exist in the file system.", filename);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!sourceVfs.load(filename, fileData))
|
||||
{
|
||||
journal.lastResult = Journal::Result::FileReadFailed;
|
||||
journal.lastErrorMessage = std::format("Failed to read file {} from the file system.", filename);
|
||||
journal.lastErrorMessage = fmt::format("Failed to read file {} from the file system.", filename);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ static bool copyFile(const FilePair &pair, const uint64_t *fileHashes, VirtualFi
|
||||
if (!fileHashFound)
|
||||
{
|
||||
journal.lastResult = Journal::Result::FileHashFailed;
|
||||
journal.lastErrorMessage = std::format("File {} from the file system did not match any of the known hashes.", filename);
|
||||
journal.lastErrorMessage = fmt::format("File {} from the file system did not match any of the known hashes.", filename);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -122,7 +122,7 @@ static bool copyFile(const FilePair &pair, const uint64_t *fileHashes, VirtualFi
|
||||
if (!outStream.is_open())
|
||||
{
|
||||
journal.lastResult = Journal::Result::FileCreationFailed;
|
||||
journal.lastErrorMessage = std::format("Failed to create file at {}.", targetPath.string());
|
||||
journal.lastErrorMessage = fmt::format("Failed to create file at {}.", targetPath.string());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ static bool copyFile(const FilePair &pair, const uint64_t *fileHashes, VirtualFi
|
||||
if (outStream.bad())
|
||||
{
|
||||
journal.lastResult = Journal::Result::FileWriteFailed;
|
||||
journal.lastErrorMessage = std::format("Failed to create file at {}.", targetPath.string());
|
||||
journal.lastErrorMessage = fmt::format("Failed to create file at {}.", targetPath.string());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ static DLC detectDLC(const std::filesystem::path &sourcePath, VirtualFileSystem
|
||||
if (!sourceVfs.load(DLCValidationFile, dlcXmlBytes))
|
||||
{
|
||||
journal.lastResult = Journal::Result::FileMissing;
|
||||
journal.lastErrorMessage = std::format("File {} does not exist in the file system.", DLCValidationFile);
|
||||
journal.lastErrorMessage = fmt::format("File {} does not exist in the file system.", DLCValidationFile);
|
||||
return DLC::Unknown;
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ bool Installer::computeTotalSize(std::span<const FilePair> filePairs, const uint
|
||||
if (!sourceVfs.exists(filename))
|
||||
{
|
||||
journal.lastResult = Journal::Result::FileMissing;
|
||||
journal.lastErrorMessage = std::format("File {} does not exist in the file system.", filename);
|
||||
journal.lastErrorMessage = fmt::format("File {} does not exist in the file system.", filename);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ bool Installer::copyFiles(std::span<const FilePair> filePairs, const uint64_t *f
|
||||
else
|
||||
{
|
||||
journal.lastResult = Journal::Result::ValidationFileMissing;
|
||||
journal.lastErrorMessage = std::format("Unable to find validation file {} in file system.", validationFile);
|
||||
journal.lastErrorMessage = fmt::format("Unable to find validation file {} in file system.", validationFile);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -635,7 +635,7 @@ bool XContentFileSystem::check(const std::filesystem::path &contentPath)
|
||||
|
||||
uint32_t packageTypeUint = 0;
|
||||
contentStream.read((char *)(&packageTypeUint), sizeof(uint32_t));
|
||||
packageTypeUint = std::byteswap(packageTypeUint);
|
||||
packageTypeUint = ByteSwap(packageTypeUint);
|
||||
XContentPackageType packageType = XContentPackageType(packageTypeUint);
|
||||
return packageType == XContentPackageType::CON || packageType == XContentPackageType::LIVE || packageType == XContentPackageType::PIRS;
|
||||
}
|
||||
Reference in new issue
Block a user