2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-07-03 09:41:50 +00:00

fix: make file name verification consider max file name length in zone properly

This commit is contained in:
Jan
2025-01-15 00:46:22 +01:00
parent a1d3e64813
commit d9f23a0b76
4 changed files with 15 additions and 14 deletions

View File

@ -1,6 +1,8 @@
#include "InvalidFileNameException.h"
InvalidFileNameException::InvalidFileNameException(std::string& actualFileName, std::string& expectedFileName)
#include <format>
InvalidFileNameException::InvalidFileNameException(const std::string& actualFileName, const std::string& expectedFileName)
{
m_actual_file_name = actualFileName;
m_expected_file_name = expectedFileName;
@ -8,7 +10,7 @@ InvalidFileNameException::InvalidFileNameException(std::string& actualFileName,
std::string InvalidFileNameException::DetailedMessage()
{
return "Name verification failed: The fastfile was created as '" + m_expected_file_name + "' but loaded as '" + m_actual_file_name + "'";
return std::format("Name verification failed: The fastfile was created as '{}' but loaded as '{}'", m_expected_file_name, m_actual_file_name);
}
char const* InvalidFileNameException::what() const noexcept

View File

@ -3,12 +3,12 @@
class InvalidFileNameException final : public LoadingException
{
std::string m_actual_file_name;
std::string m_expected_file_name;
public:
InvalidFileNameException(std::string& actualFileName, std::string& expectedFileName);
InvalidFileNameException(const std::string& actualFileName, const std::string& expectedFileName);
std::string DetailedMessage() override;
char const* what() const noexcept override;
std::string m_actual_file_name;
std::string m_expected_file_name;
};