#include <vector>
#include <string>
Go to the source code of this file.
Enumerations | |
enum | ADDON_TYPE { ADDON_UNKNOWN, ADDON_CORE, ADDON_SP_CAMPAIGN, ADDON_SP_SCENARIO, ADDON_SP_MP_CAMPAIGN, ADDON_MP_CAMPAIGN, ADDON_MP_SCENARIO, ADDON_MP_MAPS, ADDON_MP_ERA, ADDON_MP_FACTION, ADDON_MP_MOD, ADDON_MEDIA, ADDON_OTHER, ADDON_TYPES_COUNT } |
Values used for add-on classification; UI-only at the moment, in the future it could be used for directory allocation too, removing the need for the ADDON_GROUP constants (TODO). More... | |
Functions | |
ADDON_TYPE | get_addon_type (const std::string &str) |
std::string | get_addon_type_string (ADDON_TYPE type) |
bool | addon_name_legal (const std::string &name) |
Checks whether an add-on id/name is legal or not. More... | |
bool | addon_filename_legal (const std::string &name) |
Checks whether an add-on file name is legal or not. More... | |
bool | check_names_legal (const config &dir) |
Probes an add-on archive for illegal names. More... | |
std::string | encode_binary (const std::string &str) |
std::string | unencode_binary (const std::string &str) |
bool | needs_escaping (char c) |
Variables | |
const unsigned short | default_campaignd_port |
Default port number for the addon server. More... | |
enum ADDON_TYPE |
Values used for add-on classification; UI-only at the moment, in the future it could be used for directory allocation too, removing the need for the ADDON_GROUP constants (TODO).
Definition at line 41 of file validation.hpp.
bool addon_filename_legal | ( | const std::string & | name | ) |
Checks whether an add-on file name is legal or not.
Definition at line 59 of file validation.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), and check_names_legal().
bool addon_name_legal | ( | const std::string & | name | ) |
Checks whether an add-on id/name is legal or not.
Definition at line 48 of file validation.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), and campaignd::server::handle_upload().
bool check_names_legal | ( | const config & | dir | ) |
Probes an add-on archive for illegal names.
Definition at line 70 of file validation.cpp.
References addon_filename_legal(), check_names_legal(), and config::child_range().
Referenced by check_names_legal(), campaignd::server::handle_upload(), and addons_client::install_addon().
std::string encode_binary | ( | const std::string & | str | ) |
Definition at line 120 of file validation.cpp.
References needs_escaping().
Referenced by archive_file(), and BOOST_AUTO_TEST_CASE().
ADDON_TYPE get_addon_type | ( | const std::string & | str | ) |
Definition at line 82 of file validation.cpp.
References ADDON_TYPES_COUNT, and ADDON_UNKNOWN.
Referenced by campaignd::server::handle_upload(), and addon_info::read().
std::string get_addon_type_string | ( | ADDON_TYPE | type | ) |
Definition at line 98 of file validation.cpp.
References ADDON_TYPES_COUNT.
Referenced by addon_info::write(), and addon_info::write_minimal().
bool needs_escaping | ( | char | c | ) |
Definition at line 108 of file validation.cpp.
Referenced by encode_binary().
std::string unencode_binary | ( | const std::string & | str | ) |
Definition at line 138 of file validation.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), and unarchive_file().
const unsigned short default_campaignd_port |
Default port number for the addon server.
Definition at line 20 of file validation.cpp.
Referenced by addons_client::addons_client(), and campaignd::server::load_config().