The Battle for Wesnoth  1.17.4+dev
build_info.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2015 - 2022
3  by Iris Morelle <shadowm2006@gmail.com>
4  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY.
12 
13  See the COPYING file for more details.
14 */
15 
16 #pragma once
17 
18 #include <string>
19 #include <vector>
20 
21 namespace game_config
22 {
23 
25 {
28 
30 
33 
38 
40 };
41 
43 {
44  std::string name;
45  bool enabled;
46 
47  optional_feature(const char* n) : name(n), enabled(false) {}
48 };
49 
50 /**
51  * Obtain the processor architecture for this build.
52  */
53 std::string build_arch();
54 
55 /**
56  * Retrieve the features table.
57  */
58 std::vector<optional_feature> optional_features_table(bool localize = true);
59 
60 /**
61  * Produce a plain-text report of features suitable for stdout/stderr.
62  */
63 std::string optional_features_report();
64 
65 /**
66  * Return the distribution channel identifier, or "Default" if missing.
67  */
68 std::string dist_channel_id();
69 
70 /**
71  * Retrieve the build-time version number of the given library.
72  */
73 const std::string& library_build_version(LIBRARY_ID lib);
74 
75 /**
76  * Retrieve the runtime version number of the given library.
77  */
78 const std::string& library_runtime_version(LIBRARY_ID lib);
79 
80 /**
81  * Retrieve the user-visible name for the given library.
82  */
83 const std::string& library_name(LIBRARY_ID lib);
84 
85 /**
86  * Produce a plain-text report of library versions suitable for stdout/stderr.
87  */
88 std::string library_versions_report();
89 
90 /**
91  * Produce a bug report-style info dump.
92  */
93 std::string full_build_report();
94 
95 } // end namespace game_config
std::string library_versions_report()
Produce a plain-text report of library versions suitable for stdout/stderr.
Definition: build_info.cpp:643
std::string optional_features_report()
Produce a plain-text report of features suitable for stdout/stderr.
Definition: build_info.cpp:648
const std::string & library_build_version(LIBRARY_ID lib)
Retrieve the build-time version number of the given library.
Definition: build_info.cpp:356
std::vector< optional_feature > optional_features_table(bool localize)
Retrieve the features table.
Definition: build_info.cpp:337
const std::string & library_name(LIBRARY_ID lib)
Retrieve the user-visible name for the given library.
Definition: build_info.cpp:374
std::string dist_channel_id()
Return the distribution channel identifier, or "Default" if missing.
Definition: build_info.cpp:383
std::string build_arch()
Obtain the processor architecture for this build.
Definition: build_info.cpp:304
Game configuration data as global variables.
Definition: build_info.cpp:60
const std::string & library_runtime_version(LIBRARY_ID lib)
Retrieve the runtime version number of the given library.
Definition: build_info.cpp:365
optional_feature(const char *n)
Definition: build_info.hpp:47
static map_location::DIRECTION n
std::string full_build_report()
Produce a bug report-style info dump.
Definition: build_info.cpp:653