|
| std::vector< DirListNode > | fs::GetDirListing (const std::string &pathstring) |
| bool | fs::CreateDir (const std::string &path) |
| bool | fs::PathExists (const std::string &path) |
| bool | fs::IsPathAbsolute (const std::string &path) |
| bool | fs::IsDir (const std::string &path) |
| bool | fs::IsExecutable (const std::string &path) |
| bool | fs::IsFile (const std::string &path) |
| bool | fs::IsDirDelimiter (char c) |
| bool | fs::RecursiveDelete (const std::string &path) |
| bool | fs::DeleteSingleFileOrEmptyDirectory (const std::string &path, bool log_error) |
| std::string | fs::TempPath () |
| | Returns path to temp directory.
|
| std::string | fs::CreateTempFile () |
| | Returns path to securely-created temporary file (will already exist when this function returns).
|
| std::string | fs::CreateTempDir () |
| | Returns path to securely-created temporary directory (will already exist when this function returns).
|
| void | fs::GetRecursiveDirs (std::vector< std::string > &dirs, const std::string &dir) |
| std::vector< std::string > | fs::GetRecursiveDirs (const std::string &dir) |
| void | fs::GetRecursiveSubPaths (const std::string &path, std::vector< std::string > &dst, bool list_files, std::string_view ignore) |
| bool | fs::CreateAllDirs (const std::string &path) |
| bool | fs::CopyFileContents (const std::string &source, const std::string &target) |
| bool | fs::CopyDir (const std::string &source, const std::string &target) |
| bool | fs::MoveDir (const std::string &source, const std::string &target) |
| bool | fs::PathsEqual (const std::string &p1, const std::string &p2) |
| bool | fs::PathStartsWith (const std::string &path, const std::string &prefix) |
| std::string | fs::MakePathRelativeTo (const std::string &child, const std::string &parent) |
| std::string | fs::RemoveLastPathComponent (const std::string &path, std::string *removed, int count) |
| std::string | fs::RemoveRelativePathComponents (std::string path) |
| std::string | fs::AbsolutePath (const std::string &path) |
| std::string | fs::AbsolutePathPartial (const std::string &path) |
| const char * | fs::GetFilenameFromPath (const char *path) |
| bool | fs::safeWriteToFile (const std::string &path, std::string_view content) |
| bool | fs::ReadFile (const std::string &path, std::string &out, bool log_error) |
| bool | fs::Rename (const std::string &from, const std::string &to) |
| bool | fs::OpenStream (std::filebuf &stream, const char *filename, std::ios::openmode mode, bool log_error, bool log_warn) |
| | Open a file buffer with error handling, commonly used with std::fstream.rdbuf().
|
| std::ofstream | open_ofstream (const char *name, bool log, std::ios::openmode mode=std::ios::openmode()) |
| | Helper function to open an output file stream (= writing).
|
| std::ifstream | open_ifstream (const char *name, bool log, std::ios::openmode mode=std::ios::openmode()) |
| | Helper function to open an input file stream (= reading).
|
| std::ifstream open_ifstream |
( |
const char * | name, |
|
|
bool | log, |
|
|
std::ios::openmode | mode = std::ios::openmode() ) |
|
inlinenodiscard |
Helper function to open an input file stream (= reading).
For compatibility with fopen() binary mode is always set. Use fs::OpenStream for more control.
- Parameters
-
| name | file name |
| log | if true, failure to open the file will be logged to errorstream |
| mode | additional mode bits (e.g. std::ios::ate) |
- Returns
- file stream, will be !good in case of error
References open_ifstream(), and fs::OpenStream().
Referenced by TextureOverrideSource::TextureOverrideSource(), ModStorageDatabaseFiles::getOrCreateJson(), LuaAreaStore::l_from_file(), PlayerDatabaseFiles::listPlayers(), BanManager::load(), FileCache::loadByPath(), MapSettingsManager::loadMapMeta(), ServerEnvironment::loadMeta(), PlayerDatabaseFiles::loadPlayer(), Schematic::loadSchematicFromFile(), open_ifstream(), AuthDatabaseFiles::readAuthFile(), fs::ReadFile(), PlayerDatabaseFiles::removePlayer(), PlayerDatabaseFiles::savePlayer(), and TestFileSys::testNonExist().
| std::ofstream open_ofstream |
( |
const char * | name, |
|
|
bool | log, |
|
|
std::ios::openmode | mode = std::ios::openmode() ) |
|
inlinenodiscard |
Helper function to open an output file stream (= writing).
For compatibility with fopen() binary mode and truncate are always set. Use fs::OpenStream for more control.
- Parameters
-
| name | file name |
| log | if true, failure to open the file will be logged to errorstream |
| mode | additional mode bits (e.g. std::ios::app) |
- Returns
- file stream, will be !good in case of error
References open_ofstream(), and fs::OpenStream().
Referenced by porting::createCacheDirTag(), GUIEngine::downloadFile(), open_ofstream(), TestFileSys::testGetRecursiveSubPaths(), TestFileSys::testMakePathRelativeTo(), TestFileSys::testRecursiveDelete(), TestFileSys::testUnicodePathsFuzz(), and FileCache::updateByPath().