From 5b31d32da8b1dc8b5e60b495bdfc20a563487cc7 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Mon, 26 Mar 2012 00:21:38 +0300 Subject: Better file/directory removal platform code and utilities --- src/filesys.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/filesys.h') diff --git a/src/filesys.h b/src/filesys.h index 8bf43c3fa..07c18e446 100644 --- a/src/filesys.h +++ b/src/filesys.h @@ -40,24 +40,35 @@ struct DirListNode std::string name; bool dir; }; - std::vector GetDirListing(std::string path); // Returns true if already exists bool CreateDir(std::string path); -// Create all directories on the given path that don't already exist. -bool CreateAllDirs(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 &dst); + +// Tries to delete all, returns false if any failed +bool DeletePaths(const std::vector &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 -- cgit v1.2.3