#include <info.hpp>
Public Member Functions | |
addon_info () | |
addon_info (const config &cfg) | |
addon_info & | operator= (const addon_info &o) |
void | read (const config &cfg) |
void | write (config &cfg) const |
void | write_minimal (config &cfg) const |
Write only minimal WML used for state tracking (_info.cfg) files. More... | |
std::string | display_title () const |
Get a title or automatic title for display. More... | |
std::string | display_icon () const |
Get an icon path fixed for display (e.g. More... | |
std::string | display_type () const |
Get an add-on type identifier for display in the user's language. More... | |
std::set< std::string > | resolve_dependencies (const addons_list &addons) const |
Resolve an add-on's dependency tree in a recursive fashion. More... | |
Public Attributes | |
std::string | id |
std::string | title |
std::string | description |
std::string | icon |
version_info | version |
std::string | author |
int | size |
int | downloads |
int | uploads |
ADDON_TYPE | type |
std::vector< std::string > | locales |
std::string | core |
std::vector< std::string > | depends |
std::string | feedback_url |
time_t | updated |
time_t | created |
unsigned | order |
|
inlineexplicit |
std::string addon_info::display_icon | ( | ) | const |
Get an icon path fixed for display (e.g.
when TC is missing, or the image doesn't exist).
Definition at line 133 of file info.cpp.
References game_config::debug, ERR_AC, image::exists(), icon, LOG_AC, and game_config::images::missing.
Referenced by gui2::taddon_list::on_addon_select(), gui2::taddon_list::pre_show(), and gui2::taddon_description::taddon_description().
std::string addon_info::display_title | ( | ) | const |
Get a title or automatic title for display.
If the real title is empty, the returned value is the id with underscores replaced with blanks.
Definition at line 124 of file info.cpp.
References make_addon_title(), and title.
Referenced by gui2::taddon_list::on_addon_select(), and gui2::taddon_list::pre_show().
std::string addon_info::display_type | ( | ) | const |
Get an add-on type identifier for display in the user's language.
Definition at line 154 of file info.cpp.
References _(), ADDON_CORE, ADDON_MEDIA, ADDON_MP_CAMPAIGN, ADDON_MP_ERA, ADDON_MP_FACTION, ADDON_MP_MAPS, ADDON_MP_MOD, ADDON_MP_SCENARIO, ADDON_OTHER, ADDON_SP_CAMPAIGN, ADDON_SP_MP_CAMPAIGN, and ADDON_SP_SCENARIO.
Referenced by gui2::taddon_list::on_addon_select(), gui2::taddon_list::pre_show(), and gui2::taddon_description::taddon_description().
|
inline |
Definition at line 62 of file info.cpp.
References author, config::child_range(), core, created, depends, description, downloads, feedback_url, get_addon_type(), icon, locales, utils::split(), title, updated, uploads, and version.
Referenced by addon_info().
std::set< std::string > addon_info::resolve_dependencies | ( | const addons_list & | addons | ) | const |
Resolve an add-on's dependency tree in a recursive fashion.
The returned vector contains the list of resolved dependencies for this and any other add-ons upon which it depends.
addons | The add-ons list. |
Definition at line 186 of file info.cpp.
References LOG_AC.
Definition at line 89 of file info.cpp.
References config::add_child(), author, core, created, depends, description, downloads, feedback_url, get_addon_type_string(), icon, id, utils::join(), locales, size, version_info::str(), title, updated, uploads, and version.
Write only minimal WML used for state tracking (_info.cfg) files.
This currently only includes the add-on type, upload count, title, and version number.
cfg | Target WML config object. |
Definition at line 114 of file info.cpp.
References core, depends, get_addon_type_string(), utils::join(), version_info::str(), title, uploads, and version.
Referenced by addons_client::install_addon().
std::string addon_info::author |
Definition at line 39 of file info.hpp.
Referenced by gui2::taddon_list::on_addon_select(), operator=(), gui2::taddon_list::pre_show(), read(), gui2::taddon_description::taddon_description(), and write().
std::string addon_info::core |
Definition at line 49 of file info.hpp.
Referenced by operator=(), read(), write(), and write_minimal().
time_t addon_info::created |
Definition at line 57 of file info.hpp.
Referenced by gui2::taddon_list::on_addon_select(), operator=(), read(), gui2::taddon_description::taddon_description(), and write().
std::vector<std::string> addon_info::depends |
Definition at line 51 of file info.hpp.
Referenced by operator=(), read(), gui2::taddon_description::taddon_description(), write(), and write_minimal().
std::string addon_info::description |
Definition at line 33 of file info.hpp.
Referenced by gui2::taddon_list::on_addon_select(), operator=(), read(), gui2::taddon_description::taddon_description(), and write().
int addon_info::downloads |
Definition at line 42 of file info.hpp.
Referenced by gui2::taddon_list::on_addon_select(), operator=(), gui2::taddon_list::pre_show(), read(), gui2::taddon_description::taddon_description(), and write().
std::string addon_info::feedback_url |
Definition at line 54 of file info.hpp.
Referenced by gui2::taddon_list::on_addon_select(), operator=(), read(), gui2::taddon_description::taddon_description(), and write().
std::string addon_info::icon |
Definition at line 35 of file info.hpp.
Referenced by display_icon(), operator=(), read(), and write().
std::string addon_info::id |
Definition at line 31 of file info.hpp.
Referenced by get_addon_tracking_info(), addons_client::install_addon(), gui2::taddon_list::on_addon_select(), operator=(), gui2::taddon_list::pre_show(), and write().
std::vector<std::string> addon_info::locales |
Definition at line 47 of file info.hpp.
Referenced by operator=(), read(), gui2::taddon_description::taddon_description(), and write().
unsigned addon_info::order |
Definition at line 62 of file info.hpp.
Referenced by operator=().
int addon_info::size |
Definition at line 41 of file info.hpp.
Referenced by gui2::taddon_list::on_addon_select(), operator=(), gui2::taddon_list::pre_show(), gui2::taddon_description::taddon_description(), and write().
std::string addon_info::title |
Definition at line 32 of file info.hpp.
Referenced by display_title(), addons_client::install_addon(), operator=(), read(), gui2::taddon_description::taddon_description(), write(), and write_minimal().
ADDON_TYPE addon_info::type |
Definition at line 45 of file info.hpp.
Referenced by operator=().
time_t addon_info::updated |
Definition at line 56 of file info.hpp.
Referenced by gui2::taddon_list::on_addon_select(), operator=(), read(), gui2::taddon_description::taddon_description(), and write().
int addon_info::uploads |
Definition at line 43 of file info.hpp.
Referenced by operator=(), read(), write(), and write_minimal().
version_info addon_info::version |
Definition at line 37 of file info.hpp.
Referenced by get_addon_tracking_info(), gui2::taddon_list::on_addon_select(), operator=(), gui2::taddon_list::pre_show(), read(), gui2::taddon_description::taddon_description(), write(), and write_minimal().