summaryrefslogtreecommitdiffstats
path: root/source/core/slang-io.h
diff options
context:
space:
mode:
authorkaizhangNV <149626564+kaizhangNV@users.noreply.github.com>2024-09-03 15:02:48 -0500
committerGitHub <noreply@github.com>2024-09-03 13:02:48 -0700
commit1673cf934b0871a6dd3b552a80913a5737fa3f61 (patch)
treec45d1431999abe32339922affda609ce33f7e78b /source/core/slang-io.h
parent45e0eee31fb2e658f7e04771802cc18eb0b4e978 (diff)
Add Path::removeNonEmpty() to remove non-empty dir (#4984)
We've implemented a function in slang-record-replay unit test to remove the non-empty directory, now move this function into slang `Path` namespace to make this function as an utility. Close issue #4916
Diffstat (limited to 'source/core/slang-io.h')
-rw-r--r--source/core/slang-io.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/core/slang-io.h b/source/core/slang-io.h
index 763907c98..676635a36 100644
--- a/source/core/slang-io.h
+++ b/source/core/slang-io.h
@@ -217,6 +217,11 @@ namespace Slang
/// @return SLANG_OK if file or directory is removed
static SlangResult remove(const String& path);
+ /// Remove a file or directory at specified path. The directory can be non-empty.
+ /// @param path
+ /// @return SLANG_OK if file or directory is removed
+ static SlangResult removeNonEmpty(const String& path);
+
static bool equals(String path1, String path2);
/// Turn `path` into a relative path from base.