16#define DIR_DELIM_CHAR '\\'
17#define FILESYS_CASE_INSENSITIVE true
21#define DIR_DELIM_CHAR '/'
22#define FILESYS_CASE_INSENSITIVE false
39std::vector<DirListNode>
GetDirListing(
const std::string &path);
48bool IsDir(
const std::string &path);
52inline bool IsFile(
const std::string &path)
92 std::vector<std::string> &dst,
94 const std::set<char> &ignore = {});
107bool CopyDir(
const std::string &source,
const std::string &target);
111bool MoveDir(
const std::string &source,
const std::string &target);
116bool PathStartsWith(
const std::string &path,
const std::string &prefix);
123 std::string *removed = NULL,
int count = 1);
141bool safeWriteToFile(
const std::string &path, std::string_view content);
144bool extractZipFile(irr::io::IFileSystem *
fs,
const char *filename,
const std::string &destination);
147bool ReadFile(
const std::string &path, std::string &out,
bool log_error =
false);
149bool Rename(
const std::string &from,
const std::string &to);
161bool OpenStream(std::filebuf &stream,
const char *filename,
162 std::ios::openmode mode,
bool log_error,
bool log_warn);
179 std::ios::openmode mode = std::ios::openmode())
181 mode |= std::ios::out | std::ios::binary;
182 if (!(mode & std::ios::app))
183 mode |= std::ios::trunc;
186 ofs.setstate(std::ios::failbit);
201 std::ios::openmode mode = std::ios::openmode())
203 mode |= std::ios::in | std::ios::binary;
206 ifs.setstate(std::ios::failbit);
static v2f dir(const v2f &pos_dist)
Definition camera.cpp:191
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).
Definition filesys.h:178
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).
Definition filesys.h:200
Definition filesys.cpp:53
void GetRecursiveDirs(std::vector< std::string > &dirs, const std::string &dir)
Definition filesys.cpp:566
bool IsPathAbsolute(const std::string &path)
Definition filesys.cpp:343
bool IsDirDelimiter(char c)
Definition filesys.cpp:361
bool CopyDir(const std::string &source, const std::string &target)
Definition filesys.cpp:634
std::string RemoveRelativePathComponents(std::string path)
Definition filesys.cpp:780
std::string AbsolutePath(const std::string &path)
Definition filesys.cpp:833
bool DeleteSingleFileOrEmptyDirectory(const std::string &path)
Definition filesys.cpp:410
void GetRecursiveSubPaths(const std::string &path, std::vector< std::string > &dst, bool list_files, const std::set< char > &ignore)
Definition filesys.cpp:582
bool RecursiveDeleteContent(const std::string &path)
Definition filesys.cpp:599
std::string TempPath()
Returns path to temp directory.
Definition filesys.cpp:427
bool RecursiveDelete(const std::string &path)
Definition filesys.cpp:366
bool IsDir(const std::string &path)
Definition filesys.cpp:348
bool PathExists(const std::string &path)
Definition filesys.cpp:337
bool MoveDir(const std::string &source, const std::string &target)
Definition filesys.cpp:663
const char * GetFilenameFromPath(const char *path)
Definition filesys.cpp:846
std::string CreateTempFile()
Returns path to securely-created temporary file (will already exist when this function returns).
Definition filesys.cpp:446
bool IsFile(const std::string &path)
Definition filesys.h:52
bool CreateAllDirs(const std::string &path)
Definition filesys.cpp:616
bool Rename(const std::string &from, const std::string &to)
Definition filesys.cpp:1019
std::vector< DirListNode > GetDirListing(const std::string &pathstring)
Definition filesys.cpp:270
bool IsExecutable(const std::string &path)
Definition filesys.cpp:356
std::string RemoveLastPathComponent(const std::string &path, std::string *removed, int count)
Definition filesys.cpp:748
bool CopyFileContents(const std::string &source, const std::string &target)
Definition filesys.cpp:475
bool CreateDir(const std::string &path)
Definition filesys.cpp:323
bool ReadFile(const std::string &path, std::string &out, bool log_error)
Definition filesys.cpp:1005
bool PathStartsWith(const std::string &path, const std::string &prefix)
Definition filesys.cpp:687
bool safeWriteToFile(const std::string &path, std::string_view content)
Definition filesys.cpp:859
bool 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().
Definition filesys.cpp:1024
std::string CreateTempDir()
Returns path to securely-created temporary directory (will already exist when this function returns).
Definition filesys.cpp:456
std::string name
Definition filesys.h:35
bool dir
Definition filesys.h:36