The Battle for Wesnoth 1.21.0-dev
 
Loading...
Searching...
No Matches
deprecation.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2017 - 2025
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 <cstdint>
18#include <string>
19
20/** See https://wiki.wesnoth.org/CompatibilityStandards for more info. */
21enum class DEP_LEVEL : uint8_t { INDEFINITE = 1, PREEMPTIVE, FOR_REMOVAL, REMOVED };
22
23/**
24 * Prints a message to the deprecation log domain informing players that a given feature
25 * has been deprecated.
26 *
27 * @param elem_name The name of the feature to be deprecated.
28 * @param level The deprecation level. This indicates how long the feature will
29 * remain supported before removal.
30 * @param version If @a level is PREEMPTIVE or FOR_REMOVAL, this should be the first
31 * version in which the feature could be removed. If it's INDEFINITE
32 * or REMOVED, this is unused.
33 * @param detail Optional extra message elaborating on the deprecation. This can be
34 * used to specify which feature to use instead, for example.
35 *
36 * @returns The final translated deprecation message in case you want to output
37 * it elsewhere as well.
38 *
39 * @todo @a version should probably be made optional to handle INDEFINITE
40 * and REMOVED deprecation, but I don't think we can do that without
41 * including version_info.hpp in this header.
42 */
43std::string deprecated_message(const std::string& elem_name,
44 DEP_LEVEL level,
45 const class version_info& version,
46 const std::string& detail = "");
Represents version numbers.
DEP_LEVEL
See https://wiki.wesnoth.org/CompatibilityStandards for more info.
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...