51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef FILESYS_HEADER
-#define FILESYS_HEADER
+#pragma once
#include <string>
#include <vector>
#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
// 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