Allow error message to be formatted

This commit is contained in:
SirLynix
2023-08-14 23:16:37 +02:00
committed by Jérôme Leclercq
parent 25957c4b7f
commit a741672a51
119 changed files with 707 additions and 490 deletions

View File

@@ -69,7 +69,7 @@ namespace Nz
std::string extension = ToLower(PathToString(filePath.extension()));
if (extension.empty())
{
NazaraError("Failed to get file extension from \"" + PathToString(filePath) + '"');
NazaraError("failed to get file extension from \"{0}\"", filePath);
return false;
}
@@ -93,7 +93,7 @@ namespace Nz
if (!file.Open(OpenMode::WriteOnly | OpenMode::Truncate))
{
NazaraError("failed to save to file: unable to open \"" + PathToString(filePath) + "\" in write mode");
NazaraError("failed to save to file: unable to open \"{0}\" in write mode", filePath);
return false;
}
@@ -107,7 +107,7 @@ namespace Nz
if (found)
NazaraError("failed to save resource: all savers failed");
else
NazaraError("failed to save resource: no saver found for extension \"" + extension + '"');
NazaraError("failed to save resource: no saver found for extension \"extension\"", extension);
return false;
}
@@ -152,7 +152,7 @@ namespace Nz
if (found)
NazaraError("failed to save resource: all savers failed");
else
NazaraError("failed to save resource: no saver found for format \"" + format + '"');
NazaraError("failed to save resource: no saver found for format \"{0}\"", format);
return false;
}