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