The Battle for Wesnoth  1.17.0-dev
deprecation.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2017 - 2021
3  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 #pragma once
16 
17 #include <string>
18 
19 /** See https://wiki.wesnoth.org/CompatibilityStandards for more info. */
20 enum class DEP_LEVEL : uint8_t { INDEFINITE = 1, PREEMPTIVE, FOR_REMOVAL, REMOVED };
21 
22 /**
23  * Prints a message to the deprecation log domain informing players that a given feature
24  * has been deprecated.
25  *
26  * @param elem_name The name of the feature to be deprecated.
27  * @param level The deprecation level. This indicates how long the feature will
28  * remain supported before removal.
29  * @param version If @a level is PREEMPTIVE or FOR_REMOVAL, this should be the first
30  * version in which the feature could be removed. If it's INDEFINITE
31  * or REMOVED, this is unused.
32  * @param detail Optional extra message elaborating on the deprecation. This can be
33  * used to specify which feature to use instead, for example.
34  *
35  * @returns The final translated deprecation message in case you want to output
36  * it elsewhere as well.
37  *
38  * @todo @a version should probably be made optional to handle INDEFINITE
39  * and REMOVED deprecation, but I don't think we can do that without
40  * including version_info.hpp in this header.
41  */
42 std::string deprecated_message(const std::string& elem_name,
44  const class version_info& version,
45  const std::string& detail = "");
std::string deprecated_message(const std::string &elem_name, DEP_LEVEL level, const class version_info &version, const std::string &detail="")
Prints a message to the deprecation log domain informing players that a given feature has been deprec...
DEP_LEVEL
See https://wiki.wesnoth.org/CompatibilityStandards for more info.
Definition: deprecation.hpp:20
Represents version numbers.