24 "unknown",
"core",
"campaign",
"scenario",
"campaign_sp_mp",
"campaign_mp",
25 "scenario_mp",
"map_pack",
"era",
"faction",
"mod_mp",
"media",
29 struct addon_name_char_illegal
34 inline bool operator()(
char c)
50 if(name.empty() || name ==
"." ||
51 std::find_if(name.begin(), name.end(), addon_name_char_illegal()) != name.end() ||
52 name.find(
"..") != std::string::npos) {
61 if(name.empty() || name ==
"." ||
62 name.find_first_of(
"/:\\~ \r\n\v\t") != std::string::npos ||
63 name.find(
"..") != std::string::npos) {
87 unsigned addon_type_num = 0;
90 if(str == addon_type_strings[addon_type_num]) {
101 return addon_type_strings[
type];
105 const char escape_char =
'\x01';
123 res.resize(str.size());
125 for(std::string::const_iterator j = str.begin(); j != str.end(); ++j) {
127 res.resize(res.size()+1);
128 res[n++] = escape_char;
141 res.resize(str.size());
144 for(std::string::const_iterator j = str.begin(); j != str.end(); ++j) {
145 if(*j == escape_char && j+1 != str.end()) {
148 res.resize(res.size()-1);
child_itors child_range(const std::string &key)
ADDON_TYPE
Values used for add-on classification; UI-only at the moment, in the future it could be used for dire...
GLuint GLuint GLsizei GLenum type
std::string encode_binary(const std::string &str)
std::string unencode_binary(const std::string &str)
bool needs_escaping(char c)
Definitions for the interface to Wesnoth Markup Language (WML).
GLsizei const char ** path
ADDON_TYPE get_addon_type(const std::string &str)
bool addon_name_legal(const std::string &name)
Checks whether an add-on id/name is legal or not.
GLuint const GLchar * name
const unsigned short default_campaignd_port
Default port number for the addon server.
std::string get_addon_type_string(ADDON_TYPE type)
bool check_names_legal(const config &dir)
Probes an add-on archive for illegal names.
A config object defines a single node in a WML file, with access to child nodes.
GLsizei const GLcharARB ** string
bool addon_filename_legal(const std::string &name)
Checks whether an add-on file name is legal or not.