OpenTTD Source 20241224-master-gee860a5c8e
saveload_error.hpp
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
7
10#ifndef SAVELOAD_ERROR_HPP
11#define SAVELOAD_ERROR_HPP
12
13#include "../3rdparty/fmt/format.h"
14#include "../strings_type.h"
15
16[[noreturn]] void SlError(StringID string, const std::string &extra_msg = {});
17[[noreturn]] void SlErrorCorrupt(const std::string &msg);
18
27template <typename ... Args>
28[[noreturn]] inline void SlErrorCorruptFmt(const fmt::format_string<Args...> format, Args&&... fmt_args)
29{
30 SlErrorCorrupt(fmt::format(format, std::forward<Args>(fmt_args)...));
31}
32
33#endif /* SAVELOAD_ERROR_HPP */
void SlError(StringID string, const std::string &extra_msg)
Error handler.
Definition saveload.cpp:321
void SlErrorCorrupt(const std::string &msg)
Error handler for corrupt savegames.
Definition saveload.cpp:351
uint32_t StringID
Numeric value that represents a string, independent of the selected language.