Tune caves
[oweals/minetest.git] / src / filesys.h
index e46b17b0def460faace60aa16759a1004890be54..07c18e446a0105401a0000ee55d72da9c4e585d2 100644 (file)
@@ -24,6 +24,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <vector>
 #include "exceptions.h"
 
+#ifdef _WIN32 // WINDOWS
+#define DIR_DELIM "\\"
+#define DIR_DELIM_C '\\'
+#else // POSIX
+#define DIR_DELIM "/"
+#define DIR_DELIM_C '/'
+#endif
+
 namespace fs
 {
 
@@ -32,7 +40,6 @@ struct DirListNode
        std::string name;
        bool dir;
 };
-
 std::vector<DirListNode> GetDirListing(std::string path);
 
 // Returns true if already exists
@@ -40,12 +47,28 @@ bool CreateDir(std::string path);
 
 bool PathExists(std::string path);
 
+bool IsDir(std::string path);
+
 // Only pass full paths to this one. True on success.
+// NOTE: The WIN32 version returns always true.
 bool RecursiveDelete(std::string path);
 
+bool DeleteSingleFileOrEmptyDirectory(std::string path);
+
+/* Multiplatform */
+
+// The path itself not included
+void GetRecursiveSubPaths(std::string path, std::vector<std::string> &dst);
+
+// 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(std::string path);
 
+// Create all directories on the given path that don't already exist.
+bool CreateAllDirs(std::string path);
+
 }//fs
 
 #endif