The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Macros | Functions | Variables
info.cpp File Reference
#include "addon/info.hpp"
#include "addon/manager.hpp"
#include "game_config.hpp"
#include "config.hpp"
#include "gettext.hpp"
#include "image.hpp"
#include "log.hpp"
#include "serialization/string_utils.hpp"
Include dependency graph for info.cpp:

Go to the source code of this file.

Macros

#define ERR_AC   LOG_STREAM(err , log_addons_client)
 
#define LOG_AC   LOG_STREAM(info, log_addons_client)
 

Functions

void read_addons_list (const config &cfg, addons_list &dest)
 
std::string size_display_string (double size)
 Get a human-readable representation of the specified byte count. More...
 
std::string make_addon_title (const std::string &id)
 Replaces underscores to dress up file or dirnames as add-on titles. More...
 

Variables

static lg::log_domain log_addons_client ("addons-client")
 

Macro Definition Documentation

#define ERR_AC   LOG_STREAM(err , log_addons_client)

Definition at line 26 of file info.cpp.

Referenced by addon_info::display_icon(), and read_addons_list().

#define LOG_AC   LOG_STREAM(info, log_addons_client)

Definition at line 27 of file info.cpp.

Referenced by addon_info::display_icon(), and addon_info::resolve_dependencies().

Function Documentation

std::string make_addon_title ( const std::string id)

Replaces underscores to dress up file or dirnames as add-on titles.

Todo:
In the future we should store more local information about add-ons and use this only as a fallback; it could be desirable to fetch translated names as well somehow.

Definition at line 228 of file info.cpp.

References utils::replace().

Referenced by addons_client::delete_remote_addon(), addon_info::display_title(), and addons_client::upload_addon().

void read_addons_list ( const config cfg,
addons_list dest 
)
Todo:
FIXME: get rid of this legacy "campaign"/"campaigns" silliness

Definition at line 199 of file info.cpp.

References config::child_range(), and ERR_AC.

Referenced by gui2::taddon_list::taddon_list().

std::string size_display_string ( double  size)

Get a human-readable representation of the specified byte count.

The result includes the size unit, which is the largest byte multiply that makes sense. (e.g. 1 MiB for 1048576 bytes.)

Definition at line 219 of file info.cpp.

References _(), and utils::si_string().

Referenced by gui2::taddon_list::on_addon_select(), gui2::taddon_list::pre_show(), and gui2::taddon_description::taddon_description().

Variable Documentation

lg::log_domain log_addons_client("addons-client")
static