diff --git a/openVulkanoCpp/IO/FsUtils.hpp b/openVulkanoCpp/IO/FsUtils.hpp index 74952ce..e30756c 100644 --- a/openVulkanoCpp/IO/FsUtils.hpp +++ b/openVulkanoCpp/IO/FsUtils.hpp @@ -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 FilesWithExtension(const std::filesystem::path& dir, std::string ext); + [[maybe_unused]] [[nodiscard]] static std::vector FilesWithExtension(const std::filesystem::path& dir, std::string ext); }; }