]> git.lizzy.rs Git - minetest.git/blobdiff - src/filesys.h
Make ClientInterface::statenames consistent with the state enum again
[minetest.git] / src / filesys.h
index c22e89b3eff728445ada718339bb8f1fd3441e5f..19fcbb6734a3dc5281ee7abdcf1ef4fba69ed348 100644 (file)
@@ -26,9 +26,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #ifdef _WIN32 // WINDOWS
 #define DIR_DELIM "\\"
+#define DIR_DELIM_CHAR '\\'
 #define FILESYS_CASE_INSENSITIVE 1
 #else // POSIX
 #define DIR_DELIM "/"
+#define DIR_DELIM_CHAR '/'
 #define FILESYS_CASE_INSENSITIVE 0
 #endif
 
@@ -101,9 +103,17 @@ std::string RemoveLastPathComponent(const std::string &path,
 // this does not resolve symlinks and check for existence of directories.
 std::string RemoveRelativePathComponents(std::string path);
 
+// Returns the absolute path for the passed path, with "." and ".." path
+// components and symlinks removed.  Returns "" on error.
+std::string AbsolutePath(const std::string &path);
+
+// Returns the filename from a path or the entire path if no directory
+// delimiter is found.
+const char *GetFilenameFromPath(const char *path);
+
 bool safeWriteToFile(const std::string &path, const std::string &content);
 
-}//fs
+} // namespace fs
 
 #endif