Classes | |
struct | binary_paths_manager |
The paths manager is responsible for recording the various paths that binary files may be located at. More... | |
struct | file_tree_checksum |
struct | io_exception |
An exception object used when an IO error occurs. More... | |
struct | iostream_path |
class | scoped_istream |
class | scoped_ostream |
Enumerations | |
enum | file_name_option { ENTIRE_FILE_PATH, FILE_NAME_ONLY } |
enum | file_filter_option { NO_FILTER, SKIP_MEDIA_DIR, SKIP_PBL_FILES } |
enum | file_reorder_option { DONT_REORDER, DO_REORDER } |
Functions | |
SDL_RWops * | load_RWops (const std::string &path) |
void | get_files_in_dir (const std::string &dir, std::vector< std::string > *files, std::vector< std::string > *dirs=nullptr, file_name_option mode=FILE_NAME_ONLY, file_filter_option filter=NO_FILTER, file_reorder_option reorder=DONT_REORDER, file_tree_checksum *checksum=nullptr) |
Populates 'files' with all the files and 'dirs' with all the directories in dir. More... | |
std::string | get_dir (const std::string &dir) |
std::string | get_prefs_file () |
std::string | get_default_prefs_file () |
std::string | get_save_index_file () |
std::string | get_saves_dir () |
std::string | get_intl_dir () |
std::string | get_screenshot_dir () |
std::string | get_addons_dir () |
std::string | get_next_filename (const std::string &name, const std::string &extension) |
Get the next free filename using "name + number (3 digits) + extension" maximum 1000 files then start always giving 999. More... | |
void | set_user_config_dir (std::string path) |
void | set_user_data_dir (std::string path) |
std::string | get_user_config_dir () |
std::string | get_user_data_dir () |
std::string | get_cache_dir () |
std::string | get_cwd () |
std::string | get_exe_dir () |
bool | make_directory (const std::string &dirname) |
bool | delete_directory (const std::string &dirname, const bool keep_pbl=false) |
bool | delete_file (const std::string &filename) |
bool | looks_like_pbl (const std::string &file) |
std::string | read_file (const std::string &fname) |
Basic disk I/O - read file. More... | |
std::istream * | istream_file (const std::string &fname, bool treat_failure_as_error=true) |
std::ostream * | ostream_file (std::string const &fname, bool create_directory=true) |
void | write_file (const std::string &fname, const std::string &data) |
Throws io_exception if an error occurs. More... | |
std::string | read_map (const std::string &name) |
bool | create_directory_if_missing (const std::string &dirname) |
Creates a directory if it does not exist already. More... | |
bool | create_directory_if_missing_recursive (const std::string &dirname) |
Creates a recursive directory tree if it does not exist already. More... | |
bool | is_directory (const std::string &fname) |
Returns true if the given file is a directory. More... | |
bool | file_exists (const std::string &name) |
Returns true if a file or directory with such name already exists. More... | |
time_t | file_modified_time (const std::string &fname) |
Get the modification time of a file. More... | |
bool | is_gzip_file (const std::string &filename) |
Returns true if the file ends with '.gz'. More... | |
bool | is_bzip2_file (const std::string &filename) |
Returns true if the file ends with '.bz2'. More... | |
bool | is_compressed_file (const std::string &filename) |
const file_tree_checksum & | data_tree_checksum (bool reset=false) |
Get the time at which the data/ tree was last modified at. More... | |
int | file_size (const std::string &fname) |
Returns the size of a file, or -1 if the file doesn't exist. More... | |
int | dir_size (const std::string &path) |
Returns the sum of the sizes of the files contained in a directory. More... | |
bool | ends_with (const std::string &str, const std::string &suffix) |
std::string | base_name (const std::string &file) |
Returns the base filename of a file, with directory name stripped. More... | |
std::string | directory_name (const std::string &file) |
Returns the directory name of a file, with filename stripped. More... | |
std::string | normalize_path (const std::string &path) |
Returns the absolute path of a file. More... | |
bool | is_path_sep (char c) |
Returns whether c is a path separator. More... | |
void | clear_binary_paths_cache () |
const std::vector< std::string > & | get_binary_paths (const std::string &type) |
Returns a vector with all possible paths to a given type of binary, e.g. More... | |
std::string | get_binary_file_location (const std::string &type, const std::string &filename) |
Returns a complete path to the actual file of a given type or an empty string if the file isn't present. More... | |
std::string | get_binary_dir_location (const std::string &type, const std::string &filename) |
Returns a complete path to the actual directory of a given type or an empty string if the directory isn't present. More... | |
std::string | get_wml_location (const std::string &filename, const std::string ¤t_dir=std::string()) |
Returns a complete path to the actual WML file or directory or an empty string if the file isn't present. More... | |
std::string | get_short_wml_path (const std::string &filename) |
Returns a short path to filename, skipping the (user) data directory. More... | |
std::string | get_independent_image_path (const std::string &filename) |
Returns an image path to filename for binary path-independent use in saved games. More... | |
std::string | get_program_invocation (const std::string &program_name) |
Returns the appropriate invocation for a Wesnoth-related binary, assuming that it is located in the same directory as the running wesnoth binary. More... | |
static void | push_if_exists (std::vector< std::string > *vec, const path &file, bool full) |
static bool | error_except_not_found (const error_code &ec) |
static bool | is_directory_internal (const path &fpath) |
static bool | file_exists (const path &fpath) |
static path | get_dir (const path &dirpath) |
static bool | create_directory_if_missing (const path &dirpath) |
static bool | create_directory_if_missing_recursive (const path &dirpath) |
static const std::string & | get_version_path_suffix () |
static void | setup_user_data_dir () |
static void | set_user_config_path (path newconfig) |
static const path & | get_user_data_path () |
static void | init_binary_paths () |
static bool | is_legal_file (const std::string &filename) |
static path | subtract_path (const path &full, const path &prefix) |
static void | get_file_tree_checksum_internal (const std::string &path, file_tree_checksum &res) |
static Sint64 | ifs_size (struct SDL_RWops *context) |
static Sint64 SDLCALL | ifs_seek (struct SDL_RWops *context, Sint64 offset, int whence) |
static size_t SDLCALL | ifs_read (struct SDL_RWops *context, void *ptr, size_t size, size_t maxnum) |
static size_t SDLCALL | ifs_write (struct SDL_RWops *context, const void *ptr, size_t size, size_t num) |
static int SDLCALL | ifs_close (struct SDL_RWops *context) |
Variables | |
static path | user_data_dir |
static path | user_config_dir |
static path | cache_dir |
Enumerator | |
---|---|
NO_FILTER | |
SKIP_MEDIA_DIR | |
SKIP_PBL_FILES |
Definition at line 48 of file filesystem.hpp.
Enumerator | |
---|---|
ENTIRE_FILE_PATH | |
FILE_NAME_ONLY |
Definition at line 47 of file filesystem.hpp.
Enumerator | |
---|---|
DONT_REORDER | |
DO_REORDER |
Definition at line 49 of file filesystem.hpp.
std::string filesystem::base_name | ( | const std::string & | file | ) |
Returns the base filename of a file, with directory name stripped.
Equivalent to a portable basename() function.
Definition at line 934 of file filesystem_boost.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), default_map_generator_job::default_generate_map(), game_config::config_cache::delete_cache_files(), editor::context_manager::expand_load_mru_menu(), cutter::find_configuration(), game_launcher::game_launcher(), image::get_localized_path(), main(), gui2::tscreenshot_notification::pre_show(), preprocess_resource(), preprocessor_file::preprocessor_file(), editor::map_context::save_scenario(), gui2::tcustom_tod::select_file(), editor::context_manager::set_window_title(), and unit_abilities().
void filesystem::clear_binary_paths_cache | ( | ) |
Definition at line 1029 of file filesystem_boost.cpp.
Referenced by game_config_manager::reload_changed_game_config().
bool filesystem::create_directory_if_missing | ( | const std::string & | dirname | ) |
Creates a directory if it does not exist already.
dirname | Path to directory. All parents should exist. |
Definition at line 862 of file filesystem_boost.cpp.
Referenced by create_directory_if_missing_recursive(), set_user_data_dir(), and setup_user_data_dir().
|
static |
Definition at line 257 of file filesystem_boost.cpp.
References DBG_FS, ERR_FS, error_except_not_found(), image::exists(), and is_directory().
bool filesystem::create_directory_if_missing_recursive | ( | const std::string & | dirname | ) |
Creates a recursive directory tree if it does not exist already.
dirname | Full path of target directory. Non existing parents will be created |
Definition at line 866 of file filesystem_boost.cpp.
Referenced by create_directory_if_missing_recursive(), get_cache_dir(), preprocess_resource(), set_user_config_path(), and setup_user_data_dir().
|
static |
Definition at line 278 of file filesystem_boost.cpp.
References create_directory_if_missing(), create_directory_if_missing_recursive(), DBG_FS, ERR_FS, error_except_not_found(), image::exists(), and is_directory().
const file_tree_checksum & filesystem::data_tree_checksum | ( | bool | reset = false | ) |
Get the time at which the data/ tree was last modified at.
Definition at line 184 of file filesystem_common.cpp.
References get_file_tree_checksum_internal(), get_user_data_dir(), LOG_FS, filesystem::file_tree_checksum::nfiles, filesystem::file_tree_checksum::reset(), and filesystem::file_tree_checksum::sum_size.
Referenced by game_config_manager::load_game_config(), game_config::config_cache::read_cache(), and game_config::config_cache::recheck_filetree_checksum().
bool filesystem::delete_directory | ( | const std::string & | dirname, |
const bool | keep_pbl = false |
||
) |
Definition at line 709 of file filesystem_boost.cpp.
References ENTIRE_FILE_PATH, get_files_in_dir(), i, LOG_FS, NO_FILTER, schema_validation::remove, and SKIP_PBL_FILES.
Referenced by game_config::config_cache::delete_cache_files(), remove_local_addon(), and game_config::config_cache::write_file().
bool filesystem::delete_file | ( | const std::string & | filename | ) |
Definition at line 747 of file filesystem_boost.cpp.
References ERR_FS, and schema_validation::remove.
Referenced by gui::file_menu::delete_chosen_file(), savegame::delete_game(), delete_random_sendfile(), and persist_file_context::save_context().
int filesystem::dir_size | ( | const std::string & | path | ) |
Returns the sum of the sizes of the files contained in a directory.
Definition at line 914 of file filesystem_boost.cpp.
References file_size(), i, and LOG_FS.
Referenced by gui2::tgame_cache_options::update_cache_size_display().
std::string filesystem::directory_name | ( | const std::string & | file | ) |
Returns the directory name of a file, with filename stripped.
Equivalent to a portable dirname()
Definition at line 939 of file filesystem_boost.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), do_gameloop(), preprocessor_data::get_chunk(), image::get_localized_path(), lua_fileops::intf_read_file(), lua_fileops::load_file(), editor::context_manager::load_map_dialog(), editor::map_context::map_context(), preprocess_resource(), preprocessor_file::preprocessor_file(), and gui2::tcustom_tod::select_file().
bool filesystem::ends_with | ( | const std::string & | str, |
const std::string & | suffix | ||
) |
Definition at line 153 of file filesystem_common.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), get_files_in_dir(), hotkey::hotkey_base::get_name(), gui::button::load_images(), preprocess_resource(), and image::save_image().
|
inlinestatic |
Definition at line 209 of file filesystem_boost.cpp.
Referenced by create_directory_if_missing(), create_directory_if_missing_recursive(), file_exists(), get_files_in_dir(), and is_directory_internal().
bool filesystem::file_exists | ( | const std::string & | name | ) |
Returns true if a file or directory with such name already exists.
Definition at line 876 of file filesystem_boost.cpp.
Referenced by adjust_profile(), available_addons(), BOOST_AUTO_TEST_CASE(), font::check_font_file(), editor::editor_palette< Item >::expand_palette_groups_menu(), gui::file_menu::file_menu(), lg::finish_log_file_setup(), get_binary_file_location(), get_files_in_dir(), image::get_localized_path(), hotkey::command_executor::get_menu_image(), get_next_filename(), get_wml_location(), handle_preprocess_command(), have_addon_in_vcs_tree(), have_addon_install_info(), have_addon_pbl_info(), installed_addons(), is_addon_installed(), persist_file_context::load(), game_config_manager::load_addons_cfg(), game_config_manager::load_game_config(), gui::button::load_images(), main(), editor::map_context::map_context(), open_font_impl(), desktop::os_version(), wesnothd::ban_manager::read(), game_config::config_cache::read_cache(), read_ignore_patterns(), wesnothd::room_manager::read_rooms(), refresh_addon_version_info_cache(), remove_local_addon(), savegame::save_game_exists(), events::menu_handler::save_map(), editor::context_manager::save_map_as_dialog(), editor::context_manager::save_scenario_as_dialog(), hotkey::command_executor_default::set_button_state(), gui2::tpreferences::setup_hotkey_list(), editor::start(), game_launcher::start_wesnothd(), game_events::WML_HANDLER_FUNCTION(), and game_config::config_cache::write_file().
|
static |
Definition at line 229 of file filesystem_boost.cpp.
References ERR_FS, error_except_not_found(), and image::exists().
time_t filesystem::file_modified_time | ( | const std::string & | fname | ) |
Get the modification time of a file.
Definition at line 881 of file filesystem_boost.cpp.
References LOG_FS.
Referenced by savegame::create_save_info::operator()(), and savegame::save_index_class::rebuild().
int filesystem::file_size | ( | const std::string & | fname | ) |
Returns the size of a file, or -1 if the file doesn't exist.
Definition at line 901 of file filesystem_boost.cpp.
References LOG_FS.
Referenced by dir_size(), get_files_in_dir(), campaignd::server::handle_request_campaign(), campaignd::server::handle_upload(), network::send_file(), gui2::tscreenshot_notification::tscreenshot_notification(), and WESNOTH_PARAMETERIZED_TEST_CASE().
std::string filesystem::get_addons_dir | ( | ) |
Definition at line 92 of file filesystem_common.cpp.
References get_dir(), and get_user_data_dir().
Referenced by archive_addon(), available_addons(), have_addon_in_vcs_tree(), installed_addons(), is_addon_installed(), game_config_manager::load_addons_cfg(), game_config_manager::load_game_config(), read_ignore_patterns(), remove_local_addon(), gui2::tgame_version::tgame_version(), and unarchive_addon().
std::string filesystem::get_binary_dir_location | ( | const std::string & | type, |
const std::string & | filename | ||
) |
Returns a complete path to the actual directory of a given type or an empty string if the directory isn't present.
Definition at line 1126 of file filesystem_boost.cpp.
References DBG_FS, get_binary_paths(), is_directory_internal(), and is_legal_file().
Referenced by BOOST_AUTO_TEST_CASE(), and init_textdomains().
std::string filesystem::get_binary_file_location | ( | const std::string & | type, |
const std::string & | filename | ||
) |
Returns a complete path to the actual file of a given type or an empty string if the file isn't present.
Definition at line 1096 of file filesystem_boost.cpp.
References DBG_FS, file_exists(), get_binary_paths(), is_legal_file(), and pos.
Referenced by BOOST_AUTO_TEST_CASE(), image::exists(), image::locator::file_exists(), get_independent_image_path(), sound::load_chunk(), image::load_image_file(), image::localized_file_uptodate(), and sound::music_track::resolve().
const std::vector< std::string > & filesystem::get_binary_paths | ( | const std::string & | type | ) |
Returns a vector with all possible paths to a given type of binary, e.g.
'images', 'sounds', etc,
Definition at line 1060 of file filesystem_boost.cpp.
References ERR_FS, get_user_data_dir(), init_binary_paths(), itor, and game_config::path.
Referenced by font::manager::deinit(), get_binary_dir_location(), get_binary_file_location(), font::manager::init(), and image::precache_file_existence().
std::string filesystem::get_cache_dir | ( | ) |
Definition at line 638 of file filesystem_boost.cpp.
References create_directory_if_missing_recursive(), get_dir(), and get_user_data_path().
Referenced by game_config::config_cache::clean_cache(), game_config::config_cache::purge_cache(), game_config::config_cache::read_cache(), and gui2::tgame_version::tgame_version().
std::string filesystem::get_cwd | ( | ) |
Definition at line 662 of file filesystem_boost.cpp.
References ERR_FS.
Referenced by game_launcher::game_launcher(), get_exe_dir(), get_intl_dir(), main(), process_command_args(), set_user_data_dir(), preferences::show_wesnothd_server_search(), and wesnoth_global_fixture::wesnoth_global_fixture().
std::string filesystem::get_default_prefs_file | ( | ) |
Definition at line 71 of file filesystem_common.cpp.
References game_config::default_preferences_path, and game_config::path.
Referenced by preferences::base_manager::base_manager().
std::string filesystem::get_dir | ( | const std::string & | dir | ) |
Definition at line 424 of file filesystem_boost.cpp.
Referenced by editor::context_manager::context_manager(), get_addons_dir(), get_cache_dir(), get_persist_cfg_name(), get_saves_dir(), get_screenshot_dir(), events::menu_handler::save_map(), editor::context_manager::save_map_as_dialog(), and editor::context_manager::save_scenario_as_dialog().
Definition at line 238 of file filesystem_boost.cpp.
References ERR_FS, and is_directory_internal().
std::string filesystem::get_exe_dir | ( | ) |
Definition at line 672 of file filesystem_boost.cpp.
References image::exists(), and get_cwd().
Referenced by main().
|
static |
Definition at line 173 of file filesystem_common.cpp.
References DONT_REORDER, ENTIRE_FILE_PATH, get_files_in_dir(), and SKIP_MEDIA_DIR.
Referenced by data_tree_checksum().
void filesystem::get_files_in_dir | ( | const std::string & | dir, |
std::vector< std::string > * | files, | ||
std::vector< std::string > * | dirs = nullptr , |
||
file_name_option | mode = FILE_NAME_ONLY , |
||
file_filter_option | filter = NO_FILTER , |
||
file_reorder_option | reorder = DONT_REORDER , |
||
file_tree_checksum * | checksum = nullptr |
||
) |
Populates 'files' with all the files and 'dirs' with all the directories in dir.
If files or dirs are nullptr they will not be used.
mode: determines whether the entire path or just the filename is retrieved. filter: determines if we skip images and sounds directories reorder: triggers the special handling of _main.cfg and _final.cfg checksum: can be used to store checksum info
Definition at line 303 of file filesystem_boost.cpp.
References DO_REORDER, ends_with(), ENTIRE_FILE_PATH, error_except_not_found(), file_exists(), file_size(), i, is_directory_internal(), LOG_FS, looks_like_pbl(), filesystem::file_tree_checksum::modified, filesystem::file_tree_checksum::nfiles, game_config::path, push_if_exists(), SKIP_MEDIA_DIR, SKIP_PBL_FILES, sort(), and filesystem::file_tree_checksum::sum_size.
Referenced by archive_dir(), available_addons(), BOOST_AUTO_TEST_CASE(), game_config::config_cache::clean_cache(), ng::create_engine::create_engine(), font::manager::deinit(), delete_directory(), get_file_tree_checksum_internal(), savegame::get_saves_list(), font::manager::init(), installed_addons(), game_config_manager::load_addons_cfg(), game_config_manager::load_game_config(), main(), image::precache_file_existence_internal(), preprocess_resource(), preprocessor_file::preprocessor_file(), game_config::config_cache::purge_cache(), and gui::file_menu::update_file_lists().
std::string filesystem::get_independent_image_path | ( | const std::string & | filename | ) |
Returns an image path to filename for binary path-independent use in saved games.
Example: units/konrad-fighter.png -> data/campaigns/Heir_To_The_Throne/images/units/konrad-fighter.png
Definition at line 1214 of file filesystem_boost.cpp.
References get_binary_file_location(), get_user_data_path(), preferences::editor::TransitionUpdateMode::partial, game_config::path, and subtract_path().
Referenced by BOOST_AUTO_TEST_CASE(), and savegame::extract_summary_from_config().
std::string filesystem::get_intl_dir | ( | ) |
Definition at line 98 of file filesystem_common.cpp.
References get_cwd(), LOCALEDIR, and game_config::path.
Referenced by test_utils::game_config_manager::game_config_manager(), init_locale(), and init_textdomains().
std::string filesystem::get_next_filename | ( | const std::string & | name, |
const std::string & | extension | ||
) |
Get the next free filename using "name + number (3 digits) + extension" maximum 1000 files then start always giving 999.
Definition at line 429 of file filesystem_boost.cpp.
References file_exists(), and right.
std::string filesystem::get_prefs_file | ( | ) |
Definition at line 66 of file filesystem_common.cpp.
References get_user_config_dir().
Referenced by preferences::base_manager::base_manager(), and preferences::write_preferences().
std::string filesystem::get_program_invocation | ( | const std::string & | program_name | ) |
Returns the appropriate invocation for a Wesnoth-related binary, assuming that it is located in the same directory as the running wesnoth binary.
This is just a string-transformation based on argv[0], so the returned program is not guaranteed to actually exist. '-debug' variants are handled correctly.
Definition at line 1232 of file filesystem_boost.cpp.
References game_config::wesnoth_program_dir.
Referenced by game_launcher::start_wesnothd().
std::string filesystem::get_save_index_file | ( | ) |
Definition at line 80 of file filesystem_common.cpp.
References get_user_data_dir().
Referenced by savegame::save_index_class::data(), and savegame::save_index_class::write_save_index().
std::string filesystem::get_saves_dir | ( | ) |
Definition at line 85 of file filesystem_common.cpp.
References get_dir(), and get_user_data_dir().
Referenced by savegame::delete_game(), savegame::find_save_file(), savegame::savegame::open_save_game(), savegame::save_index_class::rebuild(), savegame::save_game_exists(), and gui2::tgame_version::tgame_version().
std::string filesystem::get_screenshot_dir | ( | ) |
Definition at line 118 of file filesystem_common.cpp.
References get_dir(), and get_user_data_dir().
std::string filesystem::get_short_wml_path | ( | const std::string & | filename | ) |
Returns a short path to filename, skipping the (user) data directory.
Definition at line 1199 of file filesystem_boost.cpp.
References get_user_data_path(), preferences::editor::TransitionUpdateMode::partial, game_config::path, and subtract_path().
Referenced by preprocessor_file::preprocessor_file().
std::string filesystem::get_user_config_dir | ( | ) |
Definition at line 611 of file filesystem_boost.cpp.
References get_user_data_path(), and set_user_config_path().
Referenced by get_prefs_file(), process_command_args(), game_launcher::start_wesnothd(), and gui2::tgame_version::tgame_version().
std::string filesystem::get_user_data_dir | ( | ) |
Definition at line 634 of file filesystem_boost.cpp.
References get_user_data_path().
Referenced by BOOST_AUTO_TEST_CASE(), editor::context_manager::context_manager(), ng::create_engine::create_engine(), data_tree_checksum(), lg::finish_log_file_setup(), get_addons_dir(), get_binary_paths(), get_persist_cfg_name(), get_save_index_file(), get_saves_dir(), get_screenshot_dir(), ng::create_engine::init_all_levels(), process_command_args(), read_map(), events::menu_handler::save_map(), and gui2::tgame_version::tgame_version().
|
static |
Definition at line 603 of file filesystem_boost.cpp.
References set_user_data_dir(), and user_data_dir.
Referenced by get_cache_dir(), get_independent_image_path(), get_short_wml_path(), get_user_config_dir(), get_user_data_dir(), and get_wml_location().
|
static |
Definition at line 450 of file filesystem_boost.cpp.
References version_info::major_version(), version_info::minor_version(), and game_config::wesnoth_version.
Referenced by set_user_data_dir().
std::string filesystem::get_wml_location | ( | const std::string & | filename, |
const std::string & | current_dir = std::string() |
||
) |
Returns a complete path to the actual WML file or directory or an empty string if the file isn't present.
Definition at line 1146 of file filesystem_boost.cpp.
References DBG_FS, file_exists(), get_user_data_path(), is_legal_file(), and game_config::path.
Referenced by BOOST_AUTO_TEST_CASE(), preprocessor_data::get_chunk(), ai::configuration::get_side_config_from_file(), lua_fileops::intf_have_file(), lua_fileops::intf_read_file(), lua_fileops::load_file(), font::load_font_config(), game_config_manager::load_game_config(), load_language_list(), gui2::load_settings(), editor::map_context::map_context(), read_map(), game_launcher::start_wesnothd(), and game_events::WML_HANDLER_FUNCTION().
|
static |
Definition at line 108 of file filesystem_sdl.cpp.
Referenced by load_RWops().
|
static |
Definition at line 90 of file filesystem_sdl.cpp.
Referenced by load_RWops().
|
static |
|
static |
Definition at line 41 of file filesystem_sdl.cpp.
Referenced by load_RWops().
|
static |
Definition at line 104 of file filesystem_sdl.cpp.
Referenced by load_RWops().
|
static |
Definition at line 979 of file filesystem_boost.cpp.
Referenced by get_binary_paths(), and filesystem::binary_paths_manager::set_paths().
bool filesystem::is_bzip2_file | ( | const std::string & | filename | ) |
Returns true if the file ends with '.bz2'.
Definition at line 896 of file filesystem_boost.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), is_compressed_file(), process_command_args(), and savegame::read_save_file().
|
inline |
Definition at line 144 of file filesystem.hpp.
References is_bzip2_file(), and is_gzip_file().
Referenced by BOOST_AUTO_TEST_CASE(), and savegame::savegame::check_filename().
bool filesystem::is_directory | ( | const std::string & | fname | ) |
Returns true if the given file is a directory.
Definition at line 871 of file filesystem_boost.cpp.
References is_directory_internal().
Referenced by BOOST_AUTO_TEST_CASE(), create_directory_if_missing(), create_directory_if_missing_recursive(), font::manager::deinit(), gui::file_menu::file_menu(), gui::file_menu::get_path(), font::manager::init(), gui::file_menu::is_directory(), is_directory_internal(), persist_file_context::load(), main(), editor::map_context::map_context(), image::precache_file_existence_internal(), preprocess_resource(), preprocessor_file::preprocessor_file(), process_command_args(), editor::context_manager::save_all_maps(), editor::context_manager::save_map(), preferences::show_wesnothd_server_search(), and editor::start().
|
static |
Definition at line 219 of file filesystem_boost.cpp.
References error_except_not_found(), is_directory(), and LOG_FS.
Referenced by get_binary_dir_location(), get_dir(), get_files_in_dir(), and is_directory().
bool filesystem::is_gzip_file | ( | const std::string & | filename | ) |
Returns true if the file ends with '.gz'.
Definition at line 891 of file filesystem_boost.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), is_compressed_file(), process_command_args(), and savegame::read_save_file().
|
static |
Definition at line 1034 of file filesystem_boost.cpp.
References DBG_FS, ERR_FS, LOG_FS, and looks_like_pbl().
Referenced by get_binary_dir_location(), get_binary_file_location(), and get_wml_location().
bool filesystem::is_path_sep | ( | char | c | ) |
Returns whether c is a path separator.
Definition at line 943 of file filesystem_boost.cpp.
std::istream * filesystem::istream_file | ( | const std::string & | fname, |
bool | treat_failure_as_error = true |
||
) |
Definition at line 787 of file filesystem_boost.cpp.
References ERR_FS, and LOG_FS.
Referenced by preferences::base_manager::base_manager(), savegame::save_index_class::data(), savegame::find_save_file(), get_addon_install_info(), get_addon_pbl_info(), handle_preprocess_command(), game_launcher::init_lua_script(), lua_fileops::intf_read_file(), persist_file_context::load(), campaignd::server::load_blacklist(), campaignd::server::load_config(), load_RWops(), preprocessor_file::preprocessor_file(), wesnothd::ban_manager::read(), read_file(), game_config::config_cache::read_file(), read_ignore_patterns(), and wesnothd::room_manager::read_rooms().
SDL_RWops * filesystem::load_RWops | ( | const std::string & | path | ) |
Definition at line 18 of file filesystem_sdl.cpp.
References ERR_FS, ifs_close(), ifs_read(), ifs_seek(), ifs_size(), ifs_write(), and istream_file().
Referenced by image::add_localized_overlay(), sound::load_chunk(), image::load_image_file(), open_font_impl(), and sound::play_new_music().
bool filesystem::looks_like_pbl | ( | const std::string & | file | ) |
Definition at line 124 of file filesystem_common.cpp.
References utf8::lowercase(), and utils::wildcard_string_match().
Referenced by archive_dir(), BOOST_AUTO_TEST_CASE(), get_files_in_dir(), and is_legal_file().
bool filesystem::make_directory | ( | const std::string & | dirname | ) |
Definition at line 700 of file filesystem_boost.cpp.
References ERR_FS.
Referenced by lg::finish_log_file_setup(), main(), gui::file_menu::make_directory(), and unarchive_dir().
std::string filesystem::normalize_path | ( | const std::string & | path | ) |
Returns the absolute path of a file.
Definition at line 949 of file filesystem_boost.cpp.
Referenced by game_launcher::goto_editor(), and main().
std::ostream * filesystem::ostream_file | ( | std::string const & | fname, |
bool | create_directory = true |
||
) |
Definition at line 820 of file filesystem_boost.cpp.
Referenced by create_random_sendfile(), handle_preprocess_command(), campaignd::server::handle_upload(), savegame::savegame::open_save_game(), preprocess_resource(), persist_file_context::save_context(), wesnothd::game::save_replay(), set_addon_pbl_info(), wesnothd::ban_manager::write(), campaignd::server::write_config(), write_file(), game_config::config_cache::write_file(), preferences::write_preferences(), wesnothd::room_manager::write_rooms(), and savegame::save_index_class::write_save_index().
|
static |
Definition at line 200 of file filesystem_boost.cpp.
Referenced by get_files_in_dir().
std::string filesystem::read_file | ( | const std::string & | fname | ) |
Basic disk I/O - read file.
Definition at line 757 of file filesystem_boost.cpp.
References istream_file().
Referenced by campaignd::add_license(), archive_file(), wesnothd::server::load_config(), image::localized_file_uptodate(), editor::map_context::map_context(), read_map(), editor::map_context::save_map(), game_launcher::start_wesnothd(), and game_events::WML_HANDLER_FUNCTION().
std::string filesystem::read_map | ( | const std::string & | name | ) |
Definition at line 158 of file filesystem_common.cpp.
References get_user_data_dir(), get_wml_location(), and read_file().
Referenced by saved_game::expand_random_scenario(), game_info::game_info(), ng::create_engine::init_all_levels(), and mp::gamebrowser::populate_game_item_map_info().
void filesystem::set_user_config_dir | ( | std::string | path | ) |
Definition at line 598 of file filesystem_boost.cpp.
References set_user_config_path().
Referenced by process_command_args().
Definition at line 590 of file filesystem_boost.cpp.
References create_directory_if_missing_recursive(), and ERR_FS.
Referenced by get_user_config_dir(), and set_user_config_dir().
void filesystem::set_user_data_dir | ( | std::string | path | ) |
Definition at line 505 of file filesystem_boost.cpp.
References create_directory_if_missing(), ERR_FS, get_cwd(), get_version_path_suffix(), and setup_user_data_dir().
Referenced by get_user_data_path(), and process_command_args().
|
static |
Definition at line 467 of file filesystem_boost.cpp.
References create_directory_if_missing(), create_directory_if_missing_recursive(), ERR_FS, and lg::finish_log_file_setup().
Referenced by set_user_data_dir().
Definition at line 1180 of file filesystem_boost.cpp.
Referenced by get_independent_image_path(), and get_short_wml_path().
void filesystem::write_file | ( | const std::string & | fname, |
const std::string & | data | ||
) |
Throws io_exception if an error occurs.
Definition at line 844 of file filesystem_boost.cpp.
References i, and ostream_file().
Referenced by campaignd::server::handle_delete(), preprocess_resource(), events::menu_handler::save_map(), editor::map_context::save_map(), editor::map_context::save_scenario(), game_launcher::start_wesnothd(), and unarchive_file().
|
static |
Definition at line 448 of file filesystem_boost.cpp.
|
static |
Definition at line 448 of file filesystem_boost.cpp.
|
static |
Definition at line 448 of file filesystem_boost.cpp.
Referenced by get_user_data_path().