28 typedef std::map<std::string, addon_info>
addons_list;
69 return !title.empty();
82 std::set<version_info, std::greater<version_info>>
versions;
92 std::vector<std::string>
tags;
112 : id(), title(), description(), icon()
113 , current_version(), versions(), author(), size()
114 , downloads(), uploads(), type(), tags(), locales()
121 , info_translations()
125 : id(), title(), description(), icon()
126 , current_version(), versions(), author(), size()
127 , downloads(), uploads(), type(), tags(), locales()
134 , info_translations()
155 void write_minimal(
config& cfg)
const;
166 std::string display_title()
const;
170 std::string display_title_translated()
const;
172 std::string display_title_translated_or_original()
const;
174 std::string display_title_full()
const;
176 std::string description_translated()
const;
179 std::string display_icon()
const;
182 std::string display_type()
const;
195 std::set<std::string> resolve_dependencies(
const addons_list& addons)
const;
ADDON_TYPE
Values used for add-on classification; UI-only at the moment, in the future it could be used for dire...
Interfaces for manipulating version numbers of engine, add-ons, etc.
std::string size_display_string(double size)
Get a human-readable representation of the specified byte count.
addon_info(const config &cfg)
std::vector< std::string > tags
std::string make_addon_title(const std::string &id)
Replaces underscores to dress up file or dirnames as add-on titles.
addon_info_translation & operator=(const addon_info_translation &o)=default
std::map< std::string, addon_info_translation > info_translations
std::size_t size(const std::string &str)
Length in characters of a UTF-8 string.
static addon_info_translation invalid
addon_info_translation(const config &cfg)
std::vector< std::string > locales
std::set< version_info, std::greater< version_info > > versions
Represents version numbers.
std::vector< std::string > depends
void read(const config &cfg)
A config object defines a single node in a WML file, with access to child nodes.
version_info current_version
void write(config &cfg) const
std::map< std::string, addon_info > addons_list
void read_addons_list(const config &cfg, addons_list &dest)
Parse the specified add-ons list WML into an actual addons_list object.
addon_info_translation(bool sup, std::string titl, std::string desc)