From 6cc31f660c923ac3928f8bd91a63a0c1a523b632 Mon Sep 17 00:00:00 2001 From: Redstone1024 <2824517378@qq.com> Date: Fri, 24 Jan 2025 18:27:34 +0800 Subject: [PATCH] style(miscellaneous): add comments to the file system operation functions --- .../Source/Public/Miscellaneous/FileSystem.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Redcraft.Utility/Source/Public/Miscellaneous/FileSystem.h b/Redcraft.Utility/Source/Public/Miscellaneous/FileSystem.h index 369b092..2c99a69 100644 --- a/Redcraft.Utility/Source/Public/Miscellaneous/FileSystem.h +++ b/Redcraft.Utility/Source/Public/Miscellaneous/FileSystem.h @@ -9,7 +9,7 @@ #include "Strings/String.h" NAMESPACE_REDCRAFT_BEGIN - NAMESPACE_MODULE_BEGIN(Redcraft) +NAMESPACE_MODULE_BEGIN(Redcraft) NAMESPACE_MODULE_BEGIN(Utility) NAMESPACE_BEGIN(FileSystem) @@ -82,22 +82,31 @@ bool SaveStringToFile(T&& String, FStringView Path, FileSystem::EEncoding Encodi return false; } +/** @return The size of the file at the specified path. */ REDCRAFTUTILITY_API size_t FileSize(FStringView Path); +/** Deletes the file at the specified path. */ REDCRAFTUTILITY_API bool Delete(FStringView Path); +/** @return true if the regular file at the specified path exists, false otherwise. */ REDCRAFTUTILITY_API bool Exists(FStringView Path); +/** Copies the file from the source path to the destination path. */ REDCRAFTUTILITY_API bool Copy(FStringView Destination, FStringView Source); +/** Renames the file from the source path to the destination path. */ REDCRAFTUTILITY_API bool Rename(FStringView Destination, FStringView Source); +/** Creates the directory at the specified path. If recursive, it will not delete the created items on failure. */ REDCRAFTUTILITY_API bool CreateDirectory(FStringView Path, bool bRecursive = false); +/** Deletes the directory at the specified path. If recursive, it will not recreate the deleted items on failure. */ REDCRAFTUTILITY_API bool DeleteDirectory(FStringView Path, bool bRecursive = false); +/** @return true if the directory at the specified path exists, false otherwise. */ REDCRAFTUTILITY_API bool ExistsDirectory(FStringView Path); +/** Iterates items in the directory at the specified path. */ REDCRAFTUTILITY_API bool IterateDirectory(FStringView Path, TFunctionRef Visitor); NAMESPACE_END(FileSystem)