Expand FsUtils
This commit is contained in:
@@ -15,7 +15,7 @@ namespace OpenVulkano
|
||||
{
|
||||
size_t fileCount = 0, dirCount = 0;
|
||||
|
||||
size_t GetTotalEntryCount() const { return fileCount + dirCount; }
|
||||
[[maybe_unused]] [[nodiscard]] size_t GetTotalEntryCount() const { return fileCount + dirCount; }
|
||||
|
||||
FsCount& operator +=(const FsCount& other)
|
||||
{
|
||||
@@ -23,6 +23,23 @@ namespace OpenVulkano
|
||||
dirCount += other.dirCount;
|
||||
return *this;
|
||||
}
|
||||
|
||||
FsCount operator +(FsCount other)
|
||||
{
|
||||
return other += *this;
|
||||
}
|
||||
|
||||
FsCount& operator -=(const FsCount& other)
|
||||
{
|
||||
fileCount -= other.fileCount;
|
||||
dirCount -= other.dirCount;
|
||||
return *this;
|
||||
}
|
||||
|
||||
FsCount operator -(FsCount other)
|
||||
{
|
||||
return other -= *this;
|
||||
}
|
||||
};
|
||||
|
||||
struct FsUtils
|
||||
@@ -35,12 +52,12 @@ namespace OpenVulkano
|
||||
|
||||
static bool IsTreeEmpty(const std::filesystem::path& dir);
|
||||
|
||||
static ByteSize GetDirSize(const std::filesystem::path& dir);
|
||||
[[nodiscard]] static ByteSize GetDirSize(const std::filesystem::path& dir);
|
||||
|
||||
static FsCount GetDirFileAndDirCount(const std::filesystem::path& dir);
|
||||
[[nodiscard]] static FsCount GetDirFileAndDirCount(const std::filesystem::path& dir);
|
||||
|
||||
static std::string ToValidFileName(std::string filename);
|
||||
[[nodiscard]] static std::string ToValidFileName(std::string filename);
|
||||
|
||||
static std::vector<std::filesystem::path> FilesWithExtension(const std::filesystem::path& dir, std::string ext);
|
||||
[[maybe_unused]] [[nodiscard]] static std::vector<std::filesystem::path> FilesWithExtension(const std::filesystem::path& dir, std::string ext);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user