mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Better file/directory removal platform code and utilities
This commit is contained in:
parent
dcef5183f7
commit
5b31d32da8
2 changed files with 129 additions and 24 deletions
|
@ -40,24 +40,35 @@ struct DirListNode
|
|||
std::string name;
|
||||
bool dir;
|
||||
};
|
||||
|
||||
std::vector<DirListNode> 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<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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue