The Battle for Wesnoth  1.19.7+dev
Enumerations | Functions
deprecation.hpp File Reference
#include <cstdint>
#include <string>
Include dependency graph for deprecation.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum class  DEP_LEVEL : uint8_t { INDEFINITE = 1 , PREEMPTIVE , FOR_REMOVAL , REMOVED }
 See https://wiki.wesnoth.org/CompatibilityStandards for more info. More...
 

Functions

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 deprecated. More...
 

Enumeration Type Documentation

◆ DEP_LEVEL

enum DEP_LEVEL : uint8_t
strong

See https://wiki.wesnoth.org/CompatibilityStandards for more info.

Enumerator
INDEFINITE 
PREEMPTIVE 
FOR_REMOVAL 
REMOVED 

Definition at line 21 of file deprecation.hpp.

Function Documentation

◆ deprecated_message()

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 deprecated.

Parameters
elem_nameThe name of the feature to be deprecated.
levelThe deprecation level. This indicates how long the feature will remain supported before removal.
versionIf level is PREEMPTIVE or FOR_REMOVAL, this should be the first version in which the feature could be removed. If it's INDEFINITE or REMOVED, this is unused.
detailOptional extra message elaborating on the deprecation. This can be used to specify which feature to use instead, for example.
Returns
The final translated deprecation message in case you want to output it elsewhere as well.
Todo:
version should probably be made optional to handle INDEFINITE and REMOVED deprecation, but I don't think we can do that without including version_info.hpp in this header.