25 #define LOG_CS if (lg::err().dont_log(log_network)) ; else lg::err()(log_network, false)
29 typedef std::map<std::string, std::string> plain_string_map;
40 std::string fast_interpolate_variables_into_string(
const std::string &str,
const plain_string_map *
const symbols)
45 for(
const plain_string_map::value_type& sym : *symbols) {
63 if(!format.empty() && !params.
empty()) {
64 plain_string_map escaped;
79 fast_interpolate_variables_into_string(format, &escaped);
97 if(dir[
"name"] ==
"LC_MESSAGES") {
98 addon.
add_child(
"translation")[
"language"] = base_dir[
"name"];
115 if(dir.
find_child(
"file",
"name",
"COPYING.txt")
117 || dir.
find_child(
"file",
"name",
"copying.txt")
118 || dir.
find_child(
"file",
"name",
"Copying.txt")
119 || dir.
find_child(
"file",
"name",
"COPYING.TXT"))
126 if (contents.empty()) {
132 copying[
"name"] =
"COPYING.txt";
133 copying[
"contents"] = contents;
child_itors child_range(const std::string &key)
std::string urlencode(const std::string &str)
Percent-escape characters in a UTF-8 string intended to be part of a URL.
std::pair< const_attribute_iterator, const_attribute_iterator > const_attr_itors
attribute_map::value_type attribute
Definitions for the interface to Wesnoth Markup Language (WML).
void add_license(config &cfg)
Adds a COPYING.txt file with the full text of the GNU GPL to an add-on.
static lg::log_domain log_network("network")
GLboolean GLboolean GLboolean GLboolean a
config & add_child(const std::string &key)
std::string read_file(const std::string &fname)
Basic disk I/O - read file.
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
const_attr_itors attribute_range() const
Declarations for File-IO.
std::string replace(std::string str, const std::string &src, const std::string &dst)
Replace all instances of src in str with dst.
config & find_child(const std::string &key, const std::string &name, const std::string &value)
Returns the first child of tag key with a name attribute containing value.
Standard logging facilities (interface).
void find_translations(const config &base_dir, config &addon)
Scans an add-on archive directory for translations.
const std::string illegal_markup_chars
Markup characters recognized by GUI1 code.
A config object defines a single node in a WML file, with access to child nodes.
std::string format_addon_feedback_url(const std::string &format, const config ¶ms)
Format a feedback URL for an add-on.
GLsizei const GLcharARB ** string