The Battle for Wesnoth  1.15.9+dev
Public Member Functions | Public Attributes | List of all members
addon_info Struct Reference

#include <info.hpp>

Public Member Functions

 addon_info ()
 addon_info (const config &cfg)
 addon_info (const addon_info &)=default
addon_infooperator= (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
std::vector< std::string > tags
std::vector< std::string > locales
std::string core
std::vector< std::string > depends
std::string feedback_url
std::time_t updated
std::time_t created
bool local_only
std::map< std::string, addon_info_translationinfo_translations

Detailed Description

Definition at line 73 of file info.hpp.

Constructor & Destructor Documentation

◆ addon_info() [1/3]

addon_info::addon_info ( )

Definition at line 111 of file info.hpp.

◆ addon_info() [2/3]

addon_info::addon_info ( const config cfg)

◆ addon_info() [3/3]

addon_info::addon_info ( const addon_info )

Member Function Documentation

◆ description_translated()

std::string addon_info::description_translated ( ) const

◆ display_icon()

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 231 of file info.cpp.

References ERR_AC, image::exists(), and LOG_AC.

Referenced by gui2::dialogs::addon_manager::on_addon_select(), and gui2::addon_list::set_addons().

◆ display_title()

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.

FIXME: Is it even possible for the add-ons server to provide untitled add-ons in its reply anymore? Titles seem to be required at upload time.

Definition at line 154 of file info.cpp.

References font::escape_text(), addon_info_translation::invalid, make_addon_title(), and addon_info_translation::title.

Referenced by gui2::addon_list::display_title_full_shift().

◆ display_title_full()

std::string addon_info::display_title_full ( ) const

◆ display_title_translated()

std::string addon_info::display_title_translated ( ) const

◆ display_title_translated_or_original()

std::string addon_info::display_title_translated_or_original ( ) const

Definition at line 206 of file info.cpp.

References addon_info_translation::title.

Referenced by gui2::dialogs::addon_manager::on_addon_select().

◆ display_type()

std::string addon_info::display_type ( ) const

◆ operator=()

addon_info& addon_info::operator= ( const addon_info o)

◆ read()

void addon_info::read ( const config cfg)

◆ resolve_dependencies()

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.

addonsThe add-ons list.
Tag resolved dependencies with information about where they come from, and implement more dependency tiers.

Definition at line 280 of file info.cpp.

References LOG_AC.

Referenced by addons_client::do_resolve_addon_dependencies().

◆ translated_info()

addon_info_translation addon_info::translated_info ( ) const

◆ write()

void addon_info::write ( config cfg) const

◆ write_minimal()

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.

cfgTarget WML config object.

Definition at line 144 of file info.cpp.

References get_addon_type_string(), utils::join(), and addon_info_translation::title.

Referenced by addons_client::install_addon().

Member Data Documentation

◆ author

std::string addon_info::author

◆ core

std::string addon_info::core

Definition at line 95 of file info.hpp.

◆ created

std::time_t addon_info::created

Definition at line 103 of file info.hpp.

Referenced by gui2::dialogs::addon_manager::on_addon_select().

◆ current_version

version_info addon_info::current_version

◆ depends

std::vector<std::string> addon_info::depends

Definition at line 97 of file info.hpp.

Referenced by gui2::dialogs::addon_manager::on_addon_select().

◆ description

std::string addon_info::description

Definition at line 77 of file info.hpp.

◆ downloads

int addon_info::downloads

◆ feedback_url

std::string addon_info::feedback_url

Definition at line 100 of file info.hpp.

Referenced by gui2::dialogs::addon_manager::on_addon_select().

◆ icon

std::string addon_info::icon

Definition at line 79 of file info.hpp.

◆ id

std::string addon_info::id

◆ info_translations

std::map<std::string, addon_info_translation> addon_info::info_translations

Definition at line 109 of file info.hpp.

◆ local_only

bool addon_info::local_only

◆ locales

std::vector<std::string> addon_info::locales

Definition at line 93 of file info.hpp.

Referenced by gui2::dialogs::addon_manager::on_addon_select().

◆ size

int addon_info::size

◆ tags

std::vector<std::string> addon_info::tags

Definition at line 92 of file info.hpp.

◆ title

std::string addon_info::title

◆ type

ADDON_TYPE addon_info::type

Definition at line 90 of file info.hpp.

◆ updated

std::time_t addon_info::updated

Definition at line 102 of file info.hpp.

Referenced by gui2::dialogs::addon_manager::on_addon_select().

◆ uploads

int addon_info::uploads

Definition at line 88 of file info.hpp.

◆ versions

std::set<version_info, std::greater<version_info> > addon_info::versions

The documentation for this struct was generated from the following files: