Classes | |
struct | DirListNode |
Functions | |
std::vector< DirListNode > | GetDirListing (const std::string &pathstring) |
bool | CreateDir (const std::string &path) |
bool | PathExists (const std::string &path) |
bool | IsPathAbsolute (const std::string &path) |
bool | IsDir (const std::string &path) |
bool | IsDirDelimiter (char c) |
bool | RecursiveDelete (const std::string &path) |
bool | DeleteSingleFileOrEmptyDirectory (const std::string &path) |
std::string | TempPath () |
void | GetRecursiveDirs (std::vector< std::string > &dirs, const std::string &dir) |
std::vector< std::string > | GetRecursiveDirs (const std::string &dir) |
void | GetRecursiveSubPaths (const std::string &path, std::vector< std::string > &dst, bool list_files, const std::set< char > &ignore) |
bool | RecursiveDeleteContent (const std::string &path) |
bool | CreateAllDirs (const std::string &path) |
bool | CopyFileContents (const std::string &source, const std::string &target) |
bool | CopyDir (const std::string &source, const std::string &target) |
bool | PathStartsWith (const std::string &path, const std::string &prefix) |
std::string | RemoveLastPathComponent (const std::string &path, std::string *removed, int count) |
std::string | RemoveRelativePathComponents (std::string path) |
std::string | AbsolutePath (const std::string &path) |
const char * | GetFilenameFromPath (const char *path) |
bool | safeWriteToFile (const std::string &path, const std::string &content) |
bool | ReadFile (const std::string &path, std::string &out) |
bool | Rename (const std::string &from, const std::string &to) |
std::string fs::AbsolutePath | ( | const std::string & | path | ) |
bool fs::CopyDir | ( | const std::string & | source, |
const std::string & | target | ||
) |
References CopyFileContents(), CreateAllDirs(), DIR_DELIM, GetDirListing(), and PathExists().
Referenced by ModApiMainMenu::l_copy_dir().
bool fs::CopyFileContents | ( | const std::string & | source, |
const std::string & | target | ||
) |
References errorstream, and infostream.
Referenced by CopyDir().
bool fs::CreateAllDirs | ( | const std::string & | path | ) |
References CreateDir(), PathExists(), and RemoveLastPathComponent().
Referenced by CopyDir(), ClientMediaDownloader::initialStep(), Client::initLocalMapSaving(), ModApiMainMenu::l_create_dir(), ModApiMainMenu::l_extract_zip(), ModApiUtil::l_mkdir(), loadGameConfAndInitWorld(), Database_SQLite3::openDatabase(), ModMetadata::save(), and MapSettingsManager::saveMapMeta().
bool fs::CreateDir | ( | const std::string & | path | ) |
Referenced by PlayerDatabaseFiles::PlayerDatabaseFiles(), create_userdata_path(), CreateAllDirs(), TestBase::getTestTempDirectory(), Client::makeScreenshot(), ServerEnvironment::migratePlayersDatabase(), and PlayerDatabaseFiles::savePlayer().
bool fs::DeleteSingleFileOrEmptyDirectory | ( | const std::string & | path | ) |
References errorstream, and IsDir().
Referenced by RollbackManager::RollbackManager(), GUIEngine::downloadFile(), ServerEnvironment::migratePlayersDatabase(), TestBan::reinitTestEnv(), PlayerDatabaseFiles::removePlayer(), and TestAuthDatabase::runTests().
std::vector< DirListNode > fs::GetDirListing | ( | const std::string & | pathstring | ) |
References fs::DirListNode::dir, and fs::DirListNode::name.
Referenced by ServerMap::ServerMap(), CopyDir(), Server::fillMediaCache(), getAvailableGameIds(), getAvailableWorlds(), getModsInPath(), GetRecursiveSubPaths(), ModApiUtil::l_get_dir_list(), PlayerDatabaseFiles::listPlayers(), RecursiveDeleteContent(), and Client::scanModSubfolder().
const char * fs::GetFilenameFromPath | ( | const char * | path | ) |
References DIR_DELIM_CHAR.
Referenced by Server::dynamicAddMedia(), and Server::init().
std::vector< std::string > fs::GetRecursiveDirs | ( | const std::string & | dir | ) |
void fs::GetRecursiveDirs | ( | std::vector< std::string > & | dirs, |
const std::string & | dir | ||
) |
References dir(), GetRecursiveSubPaths(), and IsDir().
Referenced by Server::fillMediaCache(), ServerModManager::getModsMediaPaths(), GetRecursiveDirs(), getTextureDirs(), and Server::init().
void fs::GetRecursiveSubPaths | ( | const std::string & | path, |
std::vector< std::string > & | dst, | ||
bool | list_files, | ||
const std::set< char > & | ignore | ||
) |
References DIR_DELIM, and GetDirListing().
Referenced by GetRecursiveDirs().
bool fs::IsDir | ( | const std::string & | path | ) |
Referenced by DeleteSingleFileOrEmptyDirectory(), GetRecursiveDirs(), Client::initLocalMapSaving(), ModApiMainMenu::l_is_dir(), porting::open_directory(), and ModMetadata::save().
bool fs::IsDirDelimiter | ( | char | c | ) |
Referenced by PathStartsWith(), RemoveLastPathComponent(), RemoveRelativePathComponents(), and TestFilePath::testIsDirDelimiter().
bool fs::IsPathAbsolute | ( | const std::string & | path | ) |
Referenced by load_schematic(), and Client::makeScreenshot().
bool fs::PathExists | ( | const std::string & | path | ) |
Referenced by RollbackManager::RollbackManager(), ServerMap::ServerMap(), CopyDir(), create_userdata_path(), CreateAllDirs(), findSubgame(), findWorldSubgame(), getAvailableWorlds(), getImagePath(), getShaderPath(), getWorldExists(), getWorldGameId(), RollbackManager::initDatabase(), porting::initializePaths(), FontEngine::initSimpleFont(), ModApiMainMenu::l_extract_zip(), ClientLauncher::launch_game(), loadGameConfAndInitWorld(), ServerEnvironment::loadMeta(), ServerEnvironment::migrateAuthDatabase(), porting::migrateCachePath(), Database_SQLite3::openDatabase(), ModMetadata::save(), PlayerDatabaseFiles::savePlayer(), GUIEngine::setTexture(), and TestMapSettingsManager::testMapMetaFailures().
bool fs::PathStartsWith | ( | const std::string & | path, |
const std::string & | prefix | ||
) |
References FILESYS_CASE_INSENSITIVE, and IsDirDelimiter().
Referenced by ScriptApiSecurity::checkPath(), ModApiMainMenu::mayModifyPath(), and TestFilePath::testPathStartsWith().
bool fs::ReadFile | ( | const std::string & | path, |
std::string & | out | ||
) |
Referenced by Server::addMediaFile(), Server::getTranslationLanguage(), Client::scanModSubfolder(), and TestMapSettingsManager::testMapSettingsManager().
bool fs::RecursiveDelete | ( | const std::string & | path | ) |
References infostream, and verbosestream.
Referenced by ModApiMainMenu::l_copy_dir(), ModApiMainMenu::l_delete_dir(), ModApiMainMenu::l_delete_world(), porting::migrateCachePath(), RecursiveDeleteContent(), and TestBase::testModule().
bool fs::RecursiveDeleteContent | ( | const std::string & | path | ) |
References DIR_DELIM, errorstream, GetDirListing(), infostream, RecursiveDelete(), and trim().
std::string fs::RemoveLastPathComponent | ( | const std::string & | path, |
std::string * | removed, | ||
int | count | ||
) |
References DIR_DELIM, and IsDirDelimiter().
Referenced by ScriptApiSecurity::checkPath(), CreateAllDirs(), ModApiMainMenu::l_extract_zip(), MapSettingsManager::saveMapMeta(), TestFilePath::testRemoveLastPathComponent(), and TestFilePath::testRemoveLastPathComponentWithTrailingDelimiter().
std::string fs::RemoveRelativePathComponents | ( | std::string | path | ) |
References DIR_DELIM, and IsDirDelimiter().
Referenced by ModApiMainMenu::l_copy_dir(), ModApiMainMenu::l_delete_dir(), ModApiMainMenu::l_download_file(), ModApiMainMenu::l_extract_zip(), ModApiMainMenu::l_get_cache_path(), ModApiMainMenu::l_get_clientmodpath(), ModApiMainMenu::l_get_gamepath(), ModApiMainMenu::l_get_modpath(), ModApiMainMenu::l_get_texturepath(), ModApiMainMenu::l_get_texturepath_share(), ModApiMainMenu::l_get_user_path(), ModApiMainMenu::l_may_modify_path(), ModApiMainMenu::mayModifyPath(), and TestFilePath::testRemoveRelativePathComponent().
bool fs::Rename | ( | const std::string & | from, |
const std::string & | to | ||
) |
Referenced by ServerEnvironment::migrateAuthDatabase(), porting::migrateCachePath(), and ServerEnvironment::migratePlayersDatabase().
bool fs::safeWriteToFile | ( | const std::string & | path, |
const std::string & | content | ||
) |
References sleep_ms, and warningstream.
Referenced by ModApiUtil::l_safe_file_write(), LuaAreaStore::l_to_file(), loadGameConfAndInitWorld(), BanManager::save(), ModMetadata::save(), ServerEnvironment::saveMeta(), PlayerDatabaseFiles::savePlayer(), Schematic::saveSchematicToFile(), Settings::updateConfigFile(), and AuthDatabaseFiles::writeAuthFile().
std::string fs::TempPath | ( | ) |
References DIR_DELIM, and porting::path_cache.
Referenced by TestBase::getTestTempDirectory(), ModApiMainMenu::l_get_temp_path(), and ModApiMainMenu::mayModifyPath().