#include <vector>
#include "exceptions.h"
-#ifdef _WIN32 // WINDOWS
+#ifdef _WIN32
#define DIR_DELIM "\\"
#define DIR_DELIM_CHAR '\\'
#define FILESYS_CASE_INSENSITIVE true
#define PATH_DELIM ";"
-#else // POSIX
+#else
#define DIR_DELIM "/"
#define DIR_DELIM_CHAR '/'
#define FILESYS_CASE_INSENSITIVE false
#define PATH_DELIM ":"
#endif
+namespace irr { namespace io {
+class IFileSystem;
+}}
+
namespace fs
{
// Returns path to temp directory, can return "" on error
std::string TempPath();
+// Returns path to securely-created temporary file (will already exist when this function returns)
+// can return "" on error
+std::string CreateTempFile();
+
/* Returns a list of subdirectories, including the path itself, but excluding
hidden directories (whose names start with . or _)
*/
bool list_files,
const std::set<char> &ignore = {});
-// Tries to delete all, returns false if any failed
-bool DeletePaths(const std::vector<std::string> &paths);
-
// Only pass full paths to this one. True on success.
bool RecursiveDeleteContent(const std::string &path);
// Omits files and subdirectories that start with a period
bool CopyDir(const std::string &source, const std::string &target);
+// Move directory and all subdirectories
+// Behavior with files/subdirs that start with a period is undefined
+bool MoveDir(const std::string &source, const std::string &target);
+
// Check if one path is prefix of another
// For example, "/tmp" is a prefix of "/tmp" and "/tmp/file" but not "/tmp2"
// Ignores case differences and '/' vs. '\\' on Windows
bool safeWriteToFile(const std::string &path, const std::string &content);
+#ifndef SERVER
+bool extractZipFile(irr::io::IFileSystem *fs, const char *filename, const std::string &destination);
+#endif
+
+bool ReadFile(const std::string &path, std::string &out);
+
bool Rename(const std::string &from, const std::string &to);
} // namespace fs