The Battle for Wesnoth  1.17.0-dev
build_info.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2015 - 2018 by Iris Morelle <shadowm2006@gmail.com>
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 #include <vector>
19 
20 namespace game_config
21 {
22 
24 {
27 
29 
32 
37 
39 };
40 
42 {
43  std::string name;
44  bool enabled;
45 
46  optional_feature(const char* n) : name(n), enabled(false) {}
47 };
48 
49 /**
50  * Obtain the processor architecture for this build.
51  */
52 std::string build_arch();
53 
54 /**
55  * Retrieve the features table.
56  */
57 std::vector<optional_feature> optional_features_table(bool localize = true);
58 
59 /**
60  * Produce a plain-text report of features suitable for stdout/stderr.
61  */
62 std::string optional_features_report();
63 
64 /**
65  * Return the distribution channel identifier, or "Default" if missing.
66  */
67 std::string dist_channel_id();
68 
69 /**
70  * Retrieve the build-time version number of the given library.
71  */
72 const std::string& library_build_version(LIBRARY_ID lib);
73 
74 /**
75  * Retrieve the runtime version number of the given library.
76  */
77 const std::string& library_runtime_version(LIBRARY_ID lib);
78 
79 /**
80  * Retrieve the user-visible name for the given library.
81  */
82 const std::string& library_name(LIBRARY_ID lib);
83 
84 /**
85  * Produce a plain-text report of library versions suitable for stdout/stderr.
86  */
87 std::string library_versions_report();
88 
89 /**
90  * Produce a bug report-style info dump.
91  */
92 std::string full_build_report();
93 
94 } // 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:636
std::string optional_features_report()
Produce a plain-text report of features suitable for stdout/stderr.
Definition: build_info.cpp:641
const std::string & library_build_version(LIBRARY_ID lib)
Retrieve the build-time version number of the given library.
Definition: build_info.cpp:354
std::vector< optional_feature > optional_features_table(bool localize)
Retrieve the features table.
Definition: build_info.cpp:335
const std::string & library_name(LIBRARY_ID lib)
Retrieve the user-visible name for the given library.
Definition: build_info.cpp:372
std::string dist_channel_id()
Return the distribution channel identifier, or "Default" if missing.
Definition: build_info.cpp:381
std::string build_arch()
Obtain the processor architecture for this build.
Definition: build_info.cpp:302
Game configuration data as global variables.
Definition: build_info.cpp:58
const std::string & library_runtime_version(LIBRARY_ID lib)
Retrieve the runtime version number of the given library.
Definition: build_info.cpp:363
optional_feature(const char *n)
Definition: build_info.hpp:46
static map_location::DIRECTION n
std::string full_build_report()
Produce a bug report-style info dump.
Definition: build_info.cpp:646