#include "global.hpp"
#include "config.hpp"
#include "filesystem.hpp"
#include "publish_campaign.hpp"
#include "serialization/parser.hpp"
#include <algorithm>
#include <cstring>
Go to the source code of this file.
Functions | |
static const std::string & | campaign_dir () |
static void | setup_dirs () |
void | get_campaign_info (const std::string &campaign_name, config &cfg) |
void | set_campaign_info (const std::string &campaign_name, const config &cfg) |
std::vector< std::string > | available_campaigns () |
std::vector< std::string > | installed_campaigns () |
Return the names of all installed campaigns. | |
std::vector< config * > | find_scripts (const config &cfg, std::string extension) |
static bool | needs_escaping (char c) |
static std::string | encode_binary (const std::string &str) |
static std::string | unencode_binary (const std::string &str) |
static std::pair< std::vector < std::string >, std::vector < std::string > > | read_ignore_patterns (const std::string &campaign_name) |
static void | archive_file (const std::string &path, const std::string &fname, config &cfg) |
static void | archive_dir (const std::string &path, const std::string &dirname, config &cfg, std::pair< std::vector< std::string >, std::vector< std::string > > &ignore_patterns) |
void | archive_campaign (const std::string &campaign_name, config &cfg) |
static void | unarchive_file (const std::string &path, const config &cfg) |
static void | unarchive_dir (const std::string &path, const config &cfg) |
void | unarchive_campaign (const config &cfg) |
static bool | two_dots (char a, char b) |
bool | campaign_name_legal (const std::string &name) |
bool | check_names_legal (const config &dir) |
Variables | |
const char | escape_char = 1 |
void archive_campaign | ( | const std::string & | campaign_name, | |
config & | cfg | |||
) |
Definition at line 250 of file publish_campaign.cpp.
References config::add_child(), archive_dir(), archive_file(), campaign_dir(), file_exists(), and read_ignore_patterns().
static void archive_dir | ( | const std::string & | path, | |
const std::string & | dirname, | |||
config & | cfg, | |||
std::pair< std::vector< std::string >, std::vector< std::string > > & | ignore_patterns | |||
) | [static] |
Definition at line 216 of file publish_campaign.cpp.
References config::add_child(), archive_file(), get_files_in_dir(), and utils::wildcard_string_match().
Referenced by archive_campaign().
static void archive_file | ( | const std::string & | path, | |
const std::string & | fname, | |||
config & | cfg | |||
) | [static] |
Definition at line 210 of file publish_campaign.cpp.
References encode_binary(), and read_file().
Referenced by archive_campaign(), and archive_dir().
std::vector<std::string> available_campaigns | ( | ) |
Definition at line 59 of file publish_campaign.cpp.
References campaign_dir(), file_exists(), and get_files_in_dir().
static const std::string& campaign_dir | ( | ) | [static] |
Definition at line 25 of file publish_campaign.cpp.
References get_user_data_dir().
Referenced by archive_campaign(), available_campaigns(), get_campaign_info(), installed_campaigns(), read_ignore_patterns(), set_campaign_info(), setup_dirs(), and unarchive_campaign().
bool campaign_name_legal | ( | const std::string & | name | ) |
Definition at line 295 of file publish_campaign.cpp.
References two_dots().
Referenced by check_names_legal().
bool check_names_legal | ( | const config & | dir | ) |
Definition at line 308 of file publish_campaign.cpp.
References campaign_name_legal(), check_names_legal(), and config::get_children().
Referenced by check_names_legal().
static std::string encode_binary | ( | const std::string & | str | ) | [static] |
Definition at line 133 of file publish_campaign.cpp.
References escape_char, and needs_escaping().
Referenced by archive_file().
Definition at line 100 of file publish_campaign.cpp.
References find_scripts(), and config::get_children().
Referenced by check_python_scripts(), find_scripts(), and validate_all_python_scripts().
void get_campaign_info | ( | const std::string & | campaign_name, | |
config & | cfg | |||
) |
Definition at line 37 of file publish_campaign.cpp.
References campaign_dir(), file_exists(), istream_file(), read(), and stream.
std::vector<std::string> installed_campaigns | ( | ) |
Return the names of all installed campaigns.
Definition at line 81 of file publish_campaign.cpp.
References campaign_dir(), file_exists(), and get_files_in_dir().
static bool needs_escaping | ( | char | c | ) | [static] |
Definition at line 131 of file publish_campaign.cpp.
References escape_char.
Referenced by encode_binary().
static std::pair<std::vector<std::string>, std::vector<std::string> > read_ignore_patterns | ( | const std::string & | campaign_name | ) | [static] |
Definition at line 170 of file publish_campaign.cpp.
References campaign_dir(), file_exists(), istream_file(), and stream.
Referenced by archive_campaign().
void set_campaign_info | ( | const std::string & | campaign_name, | |
const config & | cfg | |||
) |
Definition at line 53 of file publish_campaign.cpp.
References campaign_dir(), ostream_file(), stream, and write().
static void setup_dirs | ( | ) | [static] |
Definition at line 31 of file publish_campaign.cpp.
References campaign_dir(), get_user_data_dir(), and make_directory().
Referenced by unarchive_campaign().
static bool two_dots | ( | char | a, | |
char | b | |||
) | [static] |
Definition at line 293 of file publish_campaign.cpp.
Referenced by campaign_name_legal(), and do_interpolation().
void unarchive_campaign | ( | const config & | cfg | ) |
Definition at line 287 of file publish_campaign.cpp.
References campaign_dir(), setup_dirs(), and unarchive_dir().
static void unarchive_dir | ( | const std::string & | path, | |
const config & | cfg | |||
) | [static] |
Definition at line 266 of file publish_campaign.cpp.
References config::get_children(), make_directory(), and unarchive_file().
Referenced by unarchive_campaign().
static void unarchive_file | ( | const std::string & | path, | |
const config & | cfg | |||
) | [static] |
Definition at line 261 of file publish_campaign.cpp.
References unencode_binary(), and write_file().
Referenced by unarchive_dir().
static std::string unencode_binary | ( | const std::string & | str | ) | [static] |
Definition at line 151 of file publish_campaign.cpp.
References escape_char.
Referenced by unarchive_file().
const char escape_char = 1 [static] |
Definition at line 127 of file publish_campaign.cpp.
Referenced by help::convert_to_wml(), encode_binary(), needs_escaping(), help::parse_text(), and unencode_binary().
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |