OpenTTD Source  14.0-beta3
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 
27 template <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 */
StringID
uint32_t StringID
Numeric value that represents a string, independent of the selected language.
Definition: strings_type.h:16
SlErrorCorrupt
void SlErrorCorrupt(const std::string &msg)
Error handler for corrupt savegames.
Definition: saveload.cpp:362
SlError
void SlError(StringID string, const std::string &extra_msg)
Error handler.
Definition: saveload.cpp:332