]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/filesys.h
core.get_objects_inside_radius: Omit removed objects (#6318)
[dragonfireclient.git] / src / filesys.h
index c22e89b3eff728445ada718339bb8f1fd3441e5f..5f246e3875deefb436ae590bfd1cde934c394018 100644 (file)
@@ -17,8 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
-#ifndef FILESYS_HEADER
-#define FILESYS_HEADER
+#pragma once
 
 #include <string>
 #include <vector>
@@ -26,10 +25,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #ifdef _WIN32 // WINDOWS
 #define DIR_DELIM "\\"
-#define FILESYS_CASE_INSENSITIVE 1
+#define DIR_DELIM_CHAR '\\'
+#define FILESYS_CASE_INSENSITIVE true
+#define PATH_DELIM ";"
 #else // POSIX
 #define DIR_DELIM "/"
-#define FILESYS_CASE_INSENSITIVE 0
+#define DIR_DELIM_CHAR '/'
+#define FILESYS_CASE_INSENSITIVE false
+#define PATH_DELIM ":"
 #endif
 
 namespace fs
@@ -101,9 +104,16 @@ std::string RemoveLastPathComponent(const std::string &path,
 // this does not resolve symlinks and check for existence of directories.
 std::string RemoveRelativePathComponents(std::string path);
 
-bool safeWriteToFile(const std::string &path, const std::string &content);
+// 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);
 
-}//fs
+// Returns the filename from a path or the entire path if no directory
+// delimiter is found.
+const char *GetFilenameFromPath(const char *path);
 
-#endif
+bool safeWriteToFile(const std::string &path, const std::string &content);
+
+bool Rename(const std::string &from, const std::string &to);
 
+} // namespace fs