#include <info.hpp>
Public Member Functions | |
addon_info () | |
addon_info (const config &cfg) | |
addon_info (const addon_info &)=default | |
addon_info & | operator= (const addon_info &o)=default |
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... | |
addon_info_translation | translated_info () const |
std::string | display_title_translated () const |
std::string | display_title_translated_or_original () const |
std::string | display_title_full () const |
std::string | description_translated () const |
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 | current_version |
std::set< version_info, std::greater< version_info > > | versions |
std::string | author |
int | size |
int | downloads |
int | uploads |
ADDON_TYPE | type |
std::vector< std::string > | tags |
std::vector< std::string > | locales |
std::string | core |
std::vector< std::string > | depends |
std::string | feedback_url |
std::chrono::system_clock::time_point | updated |
std::chrono::system_clock::time_point | created |
bool | local_only |
std::map< std::string, addon_info_translation > | info_translations |
|
inlineexplicit |
|
default |
std::string addon_info::description_translated | ( | ) | const |
Definition at line 213 of file info.cpp.
References description, lg::info(), and translated_info().
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 232 of file info.cpp.
References ERR_AC, image::exists(), icon, and LOG_AC.
Referenced by gui2::addon_list::set_addons().
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 155 of file info.cpp.
References font::escape_text(), make_addon_title(), and title.
Referenced by display_title_full(), gui2::addon_list::display_title_full_shift(), and display_title_translated_or_original().
std::string addon_info::display_title_full | ( | ) | const |
Definition at line 224 of file info.cpp.
References display_title(), and display_title_translated().
Referenced by gui2::dialogs::addon_manager::execute_default_action(), addons_client::try_fetch_addon(), and gui2::dialogs::addon_manager::uninstall_addon().
std::string addon_info::display_title_translated | ( | ) | const |
Definition at line 196 of file info.cpp.
References lg::info(), and translated_info().
Referenced by display_title_full(), gui2::addon_list::display_title_full_shift(), and display_title_translated_or_original().
std::string addon_info::display_title_translated_or_original | ( | ) | const |
Definition at line 207 of file info.cpp.
References display_title(), display_title_translated(), and title.
std::string addon_info::display_type | ( | ) | const |
Get an add-on type identifier for display in the user's language.
Definition at line 249 of file info.cpp.
References _(), ADDON_CORE, ADDON_MEDIA, ADDON_MOD, ADDON_MP_CAMPAIGN, ADDON_MP_ERA, ADDON_MP_FACTION, ADDON_MP_MAPS, ADDON_MP_SCENARIO, ADDON_OTHER, ADDON_SP_CAMPAIGN, ADDON_SP_MP_CAMPAIGN, ADDON_SP_SCENARIO, and type.
Referenced by gui2::addon_list::set_addons().
|
default |
void addon_info::read | ( | const config & | cfg | ) |
Definition at line 75 of file info.cpp.
References author, config::child_range(), core, created, current_version, depends, description, downloads, feedback_url, get_addon_type(), icon, info_translations, local_only, locales, chrono::parse_timestamp(), size, utils::split(), tags, title, type, updated, uploads, and versions.
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 281 of file info.cpp.
References LOG_AC.
Referenced by addons_client::do_resolve_addon_dependencies().
addon_info_translation addon_info::translated_info | ( | ) | const |
Definition at line 166 of file info.cpp.
References translation::get_effective_locale_info(), lg::info(), info_translations, and addon_info_translation::invalid.
Referenced by description_translated(), and display_title_translated().
void addon_info::write | ( | config & | cfg | ) | const |
Definition at line 112 of file info.cpp.
References config::add_child(), author, core, created, current_version, depends, description, downloads, feedback_url, get_addon_type_string(), icon, id, info_translations, utils::join(), chrono::serialize_timestamp(), size, version_info::str(), tags, title, type, updated, uploads, and versions.
void addon_info::write_minimal | ( | config & | cfg | ) | const |
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 145 of file info.cpp.
References core, current_version, depends, get_addon_type_string(), utils::join(), version_info::str(), title, type, and uploads.
std::string addon_info::author |
Definition at line 84 of file info.hpp.
Referenced by read(), gui2::addon_list::set_addons(), and write().
std::string addon_info::core |
Definition at line 95 of file info.hpp.
Referenced by read(), write(), and write_minimal().
std::chrono::system_clock::time_point addon_info::created |
version_info addon_info::current_version |
Definition at line 81 of file info.hpp.
Referenced by ad_hoc_addon_fetch_session(), get_addon_tracking_info(), gui2::dialogs::addon_manager::install_addon(), read(), addons_client::try_fetch_addon(), write(), and write_minimal().
std::vector<std::string> addon_info::depends |
Definition at line 97 of file info.hpp.
Referenced by read(), write(), and write_minimal().
std::string addon_info::description |
Definition at line 77 of file info.hpp.
Referenced by description_translated(), read(), and write().
int addon_info::downloads |
Definition at line 87 of file info.hpp.
Referenced by read(), gui2::addon_list::set_addons(), and write().
std::string addon_info::feedback_url |
std::string addon_info::icon |
Definition at line 79 of file info.hpp.
Referenced by display_icon(), read(), and write().
std::string addon_info::id |
Definition at line 75 of file info.hpp.
Referenced by gui2::dialogs::addon_manager::delete_addon(), addons_client::do_check_before_overwriting_addon(), gui2::dialogs::addon_manager::execute_default_action(), get_addon_tracking_info(), gui2::addon_list::get_remote_addon_id(), gui2::dialogs::addon_manager::get_status_filter_visibility(), gui2::dialogs::addon_manager::install_addon(), gui2::dialogs::addon_manager::publish_addon(), addons_client::try_fetch_addon(), gui2::dialogs::addon_manager::uninstall_addon(), and write().
std::map<std::string, addon_info_translation> addon_info::info_translations |
Definition at line 109 of file info.hpp.
Referenced by read(), translated_info(), and write().
bool addon_info::local_only |
Definition at line 107 of file info.hpp.
Referenced by get_addon_tracking_info(), and read().
std::vector<std::string> addon_info::locales |
Definition at line 93 of file info.hpp.
Referenced by gui2::dialogs::addon_manager::get_lang_filter_visibility(), gui2::dialogs::addon_manager::pre_show(), and read().
int addon_info::size |
Definition at line 86 of file info.hpp.
Referenced by read(), gui2::addon_list::set_addons(), and write().
std::vector<std::string> addon_info::tags |
Definition at line 92 of file info.hpp.
Referenced by gui2::dialogs::addon_manager::get_tag_filter_visibility(), read(), and write().
std::string addon_info::title |
Definition at line 76 of file info.hpp.
Referenced by display_title(), display_title_translated_or_original(), addons_client::do_check_before_overwriting_addon(), addons_client::do_resolve_addon_dependencies(), read(), write(), and write_minimal().
ADDON_TYPE addon_info::type |
Definition at line 90 of file info.hpp.
Referenced by display_type(), read(), write(), and write_minimal().
std::chrono::system_clock::time_point addon_info::updated |
int addon_info::uploads |
Definition at line 88 of file info.hpp.
Referenced by read(), write(), and write_minimal().
std::set<version_info, std::greater<version_info> > addon_info::versions |
Definition at line 82 of file info.hpp.
Referenced by get_addon_tracking_info(), read(), gui2::addon_list::set_addons(), and write().